Playbook - configure_network¶
Warning
When the edpm_network_config_tool is set to ‘os-net-config’, the ctlplane_gateway_ip and ctlplane_ip variables must be set on the host for the playbook to function properly.
Warning
When migrating between network providers, you MUST include minimum_config
in your edpm_network_config_template to maintain control plane connectivity.
Example:
.. code-block:: yaml
- edpm_network_config_template:
network_config:
- ...
minimum_config:
- ...
Calls edpm_network_config role to set up network. Uses value of the edpm_network_config_tool variable to determine which tool to use. The ‘nmstate’ value will leave the process to the systemroles.network role, while the ‘os-net-config’ will import custom tasks using os-net-config.
---
- name: Deploy EDPM Network
hosts: "{{ edpm_override_hosts | default('all', true) }}"
strategy: linear
gather_facts: "{{ gather_facts | default(false) }}"
any_errors_fatal: "{{ edpm_any_errors_fatal | default(true) }}"
max_fail_percentage: "{{ edpm_max_fail_percentage | default(0) }}"
environment: "{{ edpm_playbook_environment | default({}) }}"
tasks:
- name: Gather ansible_local facts
ansible.builtin.setup:
gather_subset:
- "!all"
- "!min"
- "local"
- name: Import edpm_ovs to install ovs packages
ansible.builtin.include_role:
name: osp.edpm.edpm_ovs
when: edpm_network_config_purge_provider | default('') | length == 0
tags:
- edpm_ovs
- name: Purge edpm_network_config
ansible.builtin.include_role:
name: osp.edpm.edpm_network_config
tasks_from: purge_os_net_config.yml
when: edpm_network_config_purge_provider | default('') | length > 0
tags:
- edpm_purge_network_config
# Sets up EDPM network using os-net-config
- name: Import edpm_network_config
ansible.builtin.import_role:
name: osp.edpm.edpm_network_config
tags:
- edpm_network_config