The os_subnet module works quite well for most use cases today, however, a relatively new feature in OpenStack known as routed provider networks requires that an OpenStack subnet be created with the --network-segment flag in order to place the subnet in the proper network segment.
What problems exist that this proposal will solve?
As it stands the current module will create automate the subnet creation process, however, the configuration of the network segment must be accomplished as a separate task using command. There are also a few other obstacles that one must overcome to make a change like this. For example, one must gather the subnet and segment ID prior to manually adding the subnet to the segment.
Alternatively, the entire subnet can be created (network segment included) if the command method is used. However, this defeats the purpose of the model.
Solution proposal
Add a new parameter to the module. For example, segment. This parameter would be optional.
A possible example would be:
- name: configure subnet with a specific CIDR range to a specific network, project, and segment
os_subnet:
state: present
name: netsub1
project: admin
network_name: net1
cidr: 192.168.0.0/24
segment: segment1
The support of this new parameter will prevent users the need to create separate tasks in order to assign the subnet to a segment.
Dependencies (optional)
This flag is dependent on python-openstackclient 3.14.2-0ubuntu1. Otherwise, the flag will yield an unrecognized argument error via the openstack cli.
Testing (optional)
Deploy an OpenStack cloud, create a network, create a subnet using the os_subnet module.
Proposal: Add
--network-segment
support for OpenStack os_subnet module.Author: Javier Diaz <@jdiaz9>
Date: 2019-05-12
Motivation
The os_subnet module works quite well for most use cases today, however, a relatively new feature in OpenStack known as
routed provider networks
requires that an OpenStack subnet be created with the--network-segment
flag in order to place the subnet in the proper network segment.More details:
https://docs.openstack.org/neutron/latest/admin/config-routed-networks.html
Problems
What problems exist that this proposal will solve?
As it stands the current module will create automate the subnet creation process, however, the configuration of the network segment must be accomplished as a separate task using
command
. There are also a few other obstacles that one must overcome to make a change like this. For example, one must gather the subnet and segment ID prior to manually adding the subnet to the segment.Alternatively, the entire subnet can be created (network segment included) if the
command
method is used. However, this defeats the purpose of the model.Solution proposal
segment
. This parameter would be optional.The support of this new parameter will prevent users the need to create separate tasks in order to assign the subnet to a segment.
Dependencies (optional)
Testing (optional)
Deploy an OpenStack cloud, create a network, create a subnet using the os_subnet module.
Documentation (optional)
Update: https://docs.ansible.com/ansible/latest/modules/os_subnet_module.html