Allow neutron routers to be configured in neutron-net role

This commit is contained in:
Mark Goddard 2017-05-09 14:14:13 +01:00
parent eb9b799f9b
commit 17babeba3f
2 changed files with 23 additions and 0 deletions

View File

@ -25,6 +25,9 @@ neutron_net_segmentation_id:
# Whether the Neutron network is shared.
neutron_net_shared:
# Whether the Neutron network is external.
neutron_net_external:
# Name of the Neutron subnet.
neutron_net_subnet_name:
@ -39,3 +42,12 @@ neutron_net_allocation_pool_start:
# End of the Neutron subnet's IP allocation pool.
neutron_net_allocation_pool_end:
# Name of the Neutron router.
neutron_net_router_name:
# List of subnets to attach to the router internal interface.
neutron_net_router_interfaces:
# Unique name or ID of the external gateway network.
neutron_net_router_network:

View File

@ -14,6 +14,7 @@
provider_physical_network: "{{ neutron_net_physical_network | default(omit) }}"
provider_segmentation_id: "{{ neutron_net_segmentation_id | default(omit) }}"
shared: "{{ neutron_net_shared }}"
external: "{{ neutron_net_external }}"
state: present
- name: Ensure subnet is registered with Neutron
@ -29,6 +30,16 @@
allocation_pool_end: "{{ neutron_net_allocation_pool_end | default(omit) }}"
state: present
- name: Ensure router is registered with Neutron
os_router:
auth_type: "{{ neutron_net_openstack_auth_type }}"
auth: "{{ neutron_net_openstack_auth }}"
name: "{{ neutron_net_router_name }}"
interfaces: "{{ neutron_net_router_interfaces or omit }}"
network: "{{ neutron_net_router_network or omit }}"
state: present
when: "{{ neutron_net_router_name != None }}"
# This variable is unset before we set it, and it does not appear to be
# possible to unset a variable in Ansible.
- name: Set a fact to reset the Ansible python interpreter