Role - tripleo-network-config¶
Role Documentation¶
Welcome to the “tripleo-network-config” role documentation.
Role Defaults¶
This section highlights all of the defaults and variables set within the “tripleo-network-config” role.
# All variables intended for modification should be placed in this file.
# All variables within this role should have a prefix of "tripleo_network_config"
tripleo_network_config_action: CREATE
tripleo_network_config_async_poll: 3
tripleo_network_config_async_timeout: 300
tripleo_network_config_bridge_name: br-ex
tripleo_network_config_debug: '{{ (ansible_verbosity | int) >= 2 | bool }}'
tripleo_network_config_hide_sensitive_logs: true
tripleo_network_config_interface_name: nic1
tripleo_network_config_manage_service: true
tripleo_network_config_network_deployment_actions: []
Molecule Scenarios¶
Molecule is being used to test the “tripleo-network-config” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.
- Driver: delegated
Scenario: default¶
Molecule Options¶
managed: false
login_cmd_template: >-
ssh
-o UserKnownHostsFile=/dev/null
-o StrictHostKeyChecking=no
-o Compression=no
-o TCPKeepAlive=yes
-o VerifyHostKeyDNS=no
-o ForwardX11=no
-o ForwardAgent=no
{instance}
ansible_connection_options:
ansible_connection: ssh
Molecule Inventory¶
hosts:
all:
hosts:
instance:
ansible_host: localhost
Example default playbook¶
- name: Converge
hosts: all
tasks:
- name: Success network script
block:
- name: Temp network script file
set_fact:
dummy_network_script: /var/tmp/dummy_network_script.sh
- name: Write out empty dummy network script
delegate_to: localhost
copy:
dest: '{{ dummy_network_script }}'
content: |
#/bin/bash
echo "stderr" >&2
exit 0
mode: '0755'
- import_role:
name: tripleo-network-config
vars:
tripleo_network_config_script_path: '{{ dummy_network_script }}'
# skip service management in a container
tripleo_network_config_manage_service: false
- name: Check returncode file
slurp:
path: /var/lib/tripleo-config/os-net-config.returncode
register: rc_file
- name: returncode file value is
debug:
msg: '{{ rc_file.content | b64decode }}'
- name: Check return code content
assert:
that:
- rc_file.content | b64decode | int == 0
always:
- name: Remove dummy script
become: true
file:
path: '{{ dummy_network_script }}'
state: absent
ignore_errors: true