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.

Scenario: default

Driver: podman
Molecule Inventory
hosts:
  all:
    hosts:
      ubi8:
        ansible_python_interpreter: /usr/bin/python3
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 }}'
    - 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