ansible / proposals

Repository for sharing and tracking progress on enhancement proposals for Ansible.
Creative Commons Zero v1.0 Universal
93 stars 19 forks source link

Add `--network-segment` support for OpenStack os_subnet module. #163

Closed jdiaz9 closed 5 years ago

jdiaz9 commented 5 years ago

Proposal: Add --network-segment support for OpenStack os_subnet module.

$ openstack subnet create --help
usage: openstack subnet create [-h] [-f {json,shell,table,value,yaml}]
                               [-c COLUMN] [--max-width <integer>]
                               [--fit-width] [--print-empty] [--noindent]
                               [--prefix PREFIX] [--project <project>]
                               [--project-domain <project-domain>]
                               [--subnet-pool <subnet-pool> | --use-prefix-delegation USE_PREFIX_DELEGATION | --use-default-subnet-pool]
                               [--prefix-length <prefix-length>]
                               [--subnet-range <subnet-range>]
                               [--dhcp | --no-dhcp] [--gateway <gateway>]
                               [--ip-version {4,6}]
                               [--ipv6-ra-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}]
                               [--ipv6-address-mode {dhcpv6-stateful,dhcpv6-stateless,slaac}]
                               **[--network-segment <network-segment>]** --network
                               <network> [--description <description>]
                               [--allocation-pool start=<ip-address>,end=<ip-address>]
                               [--dns-nameserver <dns-nameserver>]
                               [--host-route destination=<subnet>,gateway=<ip-address>]
                               [--service-type <service-type>]
                               [--tag <tag> | --no-tag]
                               <name>

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?

Solution proposal

- 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)

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

agaffney commented 5 years ago

Proposals are for far-reaching changes in Ansible. This should be a simple feature request in the ansible/ansible repo.

jdiaz9 commented 5 years ago

Thanks, will close and move to ansible/ansible.