kayobe/ansible/provision-net.yml
Mark Goddard d8fe45b3d8 Tag all (well, some of) the things (plays)
Having tagged plays allows us to easily run a subset of the plays for a
command, and perform targeted operations with less risk of unintended
consequences.

The tags are typically named after the playbook, although some of the
overcloud playbooks have been tagged without an overcloud- prefix.
2017-12-19 16:58:21 +00:00

49 lines
2.0 KiB
YAML

---
- name: Check whether Ironic is enabled
hosts: controllers
tags:
- provision-net
tasks:
- name: Create controllers group with ironic enabled
group_by:
key: "controllers_with_ironic_enabled_{{ kolla_enable_ironic | bool }}"
- name: Ensure provisioning network and subnet are registered in neutron
# Only required to run on a single host.
hosts: controllers_with_ironic_enabled_True[0]
gather_facts: False
tags:
- provision-net
pre_tasks:
- name: Validate OpenStack password authentication parameters
fail:
msg: >
Required OpenStack authentication parameter {{ item }} is
{% if item in openstack_auth %}empty{% else %}not present{% endif %}
in openstack_auth. Have you sourced the environment file?
when:
- openstack_auth_type == 'password'
- item not in openstack_auth or not openstack_auth[item]
with_items: "{{ openstack_auth_password_required_params }}"
tags:
- config-validation
roles:
- role: stackhpc.os-networks
os_networks_venv: "{{ virtualenv_path }}/shade"
os_networks_auth_type: "{{ openstack_auth_type }}"
os_networks_auth: "{{ openstack_auth }}"
# Network configuration.
os_networks:
- name: "{{ kolla_ironic_provisioning_network }}"
provider_network_type: "{% if provision_wl_net_name | net_vlan %}vlan{% else %}flat{% endif %}"
provider_physical_network: "physnet1"
provider_segmentation_id: "{{ provision_wl_net_name | net_vlan }}"
shared: True
subnets:
- name: "{{ kolla_ironic_provisioning_network }}"
cidr: "{{ provision_wl_net_name | net_cidr }}"
gateway_ip: "{{ provision_wl_net_name | net_neutron_gateway or provision_wl_net_name | net_gateway }}"
allocation_pool_start: "{{ provision_wl_net_name | net_neutron_allocation_pool_start }}"
allocation_pool_end: "{{ provision_wl_net_name | net_neutron_allocation_pool_end }}"