mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Fix disable_gateway_ip for subnet
When creating a subnet with disable_gateway_ip, the value was not passed into the creation which would lead into a subnet being created with a gateway, and then on updates it would have the gateway removed. Change-Id: I816d4a4d09b2116c00cf868a590bd92dac4bfc5b
This commit is contained in:
committed by
Andrew Bonney
parent
08d8cd8c25
commit
3fd79d342c
@@ -142,6 +142,41 @@
|
|||||||
assert:
|
assert:
|
||||||
that: subnet is not changed
|
that: subnet is not changed
|
||||||
|
|
||||||
|
- name: Create subnet {{ subnet_name }} on network {{ network_name }} without gateway IP
|
||||||
|
openstack.cloud.subnet:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
network_name: "{{ network_name }}"
|
||||||
|
name: "{{ subnet_name }}"
|
||||||
|
state: present
|
||||||
|
cidr: 192.168.0.0/24
|
||||||
|
disable_gateway_ip: true
|
||||||
|
register: subnet
|
||||||
|
|
||||||
|
- name: Assert changed
|
||||||
|
assert:
|
||||||
|
that: subnet is changed
|
||||||
|
|
||||||
|
- name: Create subnet {{ subnet_name }} on network {{ network_name }} without gateway IP
|
||||||
|
openstack.cloud.subnet:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
network_name: "{{ network_name }}"
|
||||||
|
name: "{{ subnet_name }}"
|
||||||
|
state: present
|
||||||
|
cidr: 192.168.0.0/24
|
||||||
|
disable_gateway_ip: true
|
||||||
|
register: subnet
|
||||||
|
|
||||||
|
- name: Assert not changed
|
||||||
|
assert:
|
||||||
|
that: subnet is not changed
|
||||||
|
|
||||||
|
- name: Delete subnet {{ subnet_name }} again
|
||||||
|
openstack.cloud.subnet:
|
||||||
|
cloud: "{{ cloud }}"
|
||||||
|
name: "{{ subnet_name }}"
|
||||||
|
state: absent
|
||||||
|
register: subnet
|
||||||
|
|
||||||
- name: Delete network {{ network_name }}
|
- name: Delete network {{ network_name }}
|
||||||
openstack.cloud.network:
|
openstack.cloud.network:
|
||||||
cloud: "{{ cloud }}"
|
cloud: "{{ cloud }}"
|
||||||
|
|||||||
@@ -382,6 +382,8 @@ class SubnetModule(OpenStackModule):
|
|||||||
params['allocation_pools'] = self.params['allocation_pools']
|
params['allocation_pools'] = self.params['allocation_pools']
|
||||||
params = self._add_extra_attrs(params)
|
params = self._add_extra_attrs(params)
|
||||||
params = {k: v for k, v in params.items() if v is not None}
|
params = {k: v for k, v in params.items() if v is not None}
|
||||||
|
if self.params['disable_gateway_ip']:
|
||||||
|
params['gateway_ip'] = None
|
||||||
return params
|
return params
|
||||||
|
|
||||||
def _build_updates(self, subnet, params):
|
def _build_updates(self, subnet, params):
|
||||||
|
|||||||
Reference in New Issue
Block a user