|
62 | 62 | - "{{ os_networks }}"
|
63 | 63 | - subnets
|
64 | 64 |
|
| 65 | +# - name: Ensure router is registered with neutron |
| 66 | +# openstack.cloud.router: |
| 67 | +# auth_type: "{{ os_networks_auth_type }}" |
| 68 | +# auth: "{{ os_networks_auth }}" |
| 69 | +# cacert: "{{ os_networks_cacert | default(omit) }}" |
| 70 | +# cloud: "{{ os_networks_cloud | default(omit) }}" |
| 71 | +# interface: "{{ os_networks_interface | default(omit, true) }}" |
| 72 | +# name: "{{ item.name }}" |
| 73 | +# interfaces: "{{ item.interfaces | default(omit) }}" |
| 74 | +# network: "{{ item.network }}" |
| 75 | +# external_fixed_ips: "{{ item.external_fixed_ips | default(omit) }}" |
| 76 | +# project: "{{ item.project | default(omit) }}" |
| 77 | +# state: "{{ item.state | default(omit) }}" |
| 78 | +# loop: "{{ os_networks_routers }}" |
| 79 | +# when: item.state | default('present') == 'present' |
| 80 | + |
| 81 | +# Workaround bug https://bugs.launchpad.net/ansible-collections-openstack/+bug/2049658 |
| 82 | +# by looking up external network information using networks_info and then explicitly |
| 83 | +# passing the network ID into the openstack.cloud.router. Remove this workaround and |
| 84 | +# uncomment code above when bug is fixed. |
| 85 | + |
65 | 86 | - name: Ensure router is registered with neutron
|
66 |
| - openstack.cloud.router: |
67 |
| - auth_type: "{{ os_networks_auth_type }}" |
68 |
| - auth: "{{ os_networks_auth }}" |
69 |
| - cacert: "{{ os_networks_cacert | default(omit) }}" |
70 |
| - cloud: "{{ os_networks_cloud | default(omit) }}" |
71 |
| - interface: "{{ os_networks_interface | default(omit, true) }}" |
72 |
| - name: "{{ item.name }}" |
73 |
| - interfaces: "{{ item.interfaces | default(omit) }}" |
74 |
| - network: "{{ item.network | default(omit) }}" |
75 |
| - external_fixed_ips: "{{ item.external_fixed_ips | default(omit) }}" |
76 |
| - project: "{{ item.project | default(omit) }}" |
77 |
| - state: "{{ item.state | default(omit) }}" |
| 87 | + # Can't loop over blocks in Ansible so have to |
| 88 | + # include separate tasks file instead :( |
| 89 | + ansible.builtin.include_tasks: router_workaround.yml |
78 | 90 | with_items: "{{ os_networks_routers }}"
|
79 | 91 | when: item.state | default('present') == 'present'
|
80 | 92 |
|
|
0 commit comments