kayobe/ansible/provision-net.yml
2017-04-05 11:23:44 +01:00

38 lines
1.7 KiB
YAML

---
- name: Ensure provisioning network and subnet are registered in neutron
# Only required to run on a single host.
hosts: controllers[0]
vars:
venv: "{{ ansible_env.PWD }}/shade-venv"
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: neutron-net
neutron_net_venv: "{{ venv }}"
neutron_net_openstack_auth_type: "{{ openstack_auth_type }}"
neutron_net_openstack_auth: "{{ openstack_auth }}"
# Network configuration.
neutron_net_name: "{{ kolla_ironic_provisioning_network }}"
neutron_net_type: "{% if provision_wl_net_name | net_vlan %}vlan{% else %}flat{% endif %}"
neutron_net_physical_network: "physnet1"
neutron_net_segmentation_id: "{{ provision_wl_net_name | net_vlan }}"
neutron_net_shared: True
# Subnet configuration.
neutron_net_subnet_name: "{{ kolla_ironic_provisioning_network }}"
neutron_net_cidr: "{{ provision_wl_net_name | net_cidr }}"
neutron_net_gateway_ip: "{{ provision_wl_net_name | net_gateway }}"
neutron_net_allocation_pool_start: "{{ provision_wl_net_name | net_neutron_allocation_pool_start }}"
neutron_net_allocation_pool_end: "{{ provision_wl_net_name | net_neutron_allocation_pool_end }}"