With this change, multiple allocation pool may be specified when creating
a subnet. Allocation pools are defined as a list of dictionaries.
For example:
openstack.cloud.subnet:
name: sub1
network: network1
cidr: 192.168.0.0/24
ip_version: 4
allocation_pools:
- start: 192.168.0.10
end: 192.168.0.50
- start: 192.168.0.100
end: 192.168.0.150
Change-Id: I77a06990de082466dc6265a14c379b8bbaf789e8
Specifying CIDR during creation of subnet from subnet pool is a valid
operation. Moreover, in case of use of a subnet pool with multiple
subnets, cidr is a mandatory paramter for creating subnet.
Following code should be valid:
- name: Create subnet
openstack.cloud.subnet:
name: "subnet_name"
network: "some_network"
gateway_ip: "192.168.0.1"
allocation_pool_start: "192.168.0.2"
allocation_pool_end: "192.168.0.254"
cidr: "192.168.0.0/24"
ip_version: 4
subnet_pool: "192.168.0.0/24"
This scenario is added as a subnet-pool.yaml test in the test role.
Change-Id: I1163ba34ac3079f76dd0b7477a80a2135985a650
With "extends_documentation_fragment: ['openstack.cloud.openstack']"
it is not necessary to list required Python libraries in section
'requirements' of DOCUMENTATION docstring in modules. Ansible will
merge requirements from doc fragments and DOCUMENTATION docstring
which previously resulted in duplicates such as in server module [0]:
* openstacksdk
* openstacksdk >= 0.36, < 0.99.0
* python >= 3.6
When removing the 'requirements' section from server module, then
Ansible will list openstacksdk once only:
* openstacksdk >= 0.36, < 0.99.0
* python >= 3.6
To see what documentation Ansible will produce for server module run:
ansible-doc --type module openstack.cloud.server
[0] https://docs.ansible.com/ansible/latest/collections/openstack/\
cloud/server_module.html
Change-Id: I727ed95ee480bb644b5a533f6a9526973677064c
Previously, all subnet properties were updated if any value did not match.
But this behaviour caused errors like e.g. "Current gateway ip 192.168.0.1
already in use by port [ID]. Unable to update." even if that gateway was
not about to be changed.
Task: 40927
Story: 2008172
Change-Id: I049b0dade4c7ea3e1ef24777ae558f650caa136c
1. Created class SubnetModule with run method
2. Changed argument_spec from openstack_full_argument_spec to dict
3. Moved "netid != subnet['network_id']:" check inside "if network:" loop
4. Moved the methods using "module" inside SubnetModule class
Change-Id: I8f19359e70f8565ebfb096d30ab75e727f748be6
Fix subnet idempotency for allocation pools, see the linked story.
Return updated subnet information.
Remove adding allocation pools that were introduced in
Ib8becf5e958f1bc8e5c9fd76f1722536bf1c9f1a
in order to add allocation pools, either add new variable or
recreate the subnet.
Task: 41307
Story: 2008384
Change-Id: Ibe808227de159c6975dc94ef8ad0ab03a9345e17
We don't use github, so having @ mentions of specific humans is
not valuable. Also, we are a team and own the modules as a team,
so calling out individual authors is philosophically contrary.
We landed a patch upstream to special-case this author string.
Change-Id: I38b4e68f14bbba6e13e8a50e2b202874ab74e3bc
This is separate from the previous patch - it's just the results
of running the script so we can review the two a little independently.
We should probably squash them.
Change-Id: I838f15cf4a32455a5be20033c8ddc27db6ca15c0