diff --git a/envs/example/group_vars/all.yml b/envs/example/group_vars/all.yml index 7bd9d8c13..2c5b22147 100644 --- a/envs/example/group_vars/all.yml +++ b/envs/example/group_vars/all.yml @@ -74,6 +74,13 @@ neutron: enable_dhcp: "true" gateway_ip: 172.16.255.1 ip_version: 4 + routers: + - name: default + tenant_name: admin + router_interfaces: + - router_name: default + subnet_name: internal + tenant_name: admin glance: rev: 563c71c1 diff --git a/roles/openstack-setup/tasks/networks.yml b/roles/openstack-setup/tasks/networks.yml index 735c92885..97bea0178 100644 --- a/roles/openstack-setup/tasks/networks.yml +++ b/roles/openstack-setup/tasks/networks.yml @@ -30,28 +30,28 @@ cacert=/opt/stack/ssl/openstack.crt with_items: neutron.subnets -#- name: neutron routers -# action: | -# neutron_router -# state=present -# name={{ item.name }} -# tenant_name={{ item.tenant_name }} -# admin_state_up=true -# auth_url=https://{{ endpoints.main }}:5001/v2.0/ -# login_tenant_name=admin -# login_password={{ secrets.admin_password }} -# cacert=/opt/stack/ssl/openstack.crt -# with_items: neutron.routers +- name: neutron routers + action: | + neutron_router + state=present + name={{ item.name }} + tenant_name={{ item.tenant_name }} + admin_state_up=true + auth_url=https://{{ endpoints.main }}:5001/v2.0/ + login_tenant_name=admin + login_password={{ secrets.admin_password }} + cacert=/opt/stack/ssl/openstack.crt + with_items: neutron.routers -#- name: neutron router interfaces -# action: | -# neutron_router_interface -# router_name={{ item.router_name }} -# subnet_name={{ item.subnet_name }} -# tenant_name={{ item.tenant_name }} -# state=present -# auth_url=https://{{ endpoints.main }}:5001/v2.0/ -# login_tenant_name=admin -# login_password={{ secrets.admin_password }} -# cacert=/opt/stack/ssl/openstack.crt -# with_items: neutron.router_interfaces +- name: neutron router interfaces + action: | + neutron_router_interface + router_name={{ item.router_name }} + subnet_name={{ item.subnet_name }} + tenant_name={{ item.tenant_name }} + state=present + auth_url=https://{{ endpoints.main }}:5001/v2.0/ + login_tenant_name=admin + login_password={{ secrets.admin_password }} + cacert=/opt/stack/ssl/openstack.crt + with_items: neutron.router_interfaces