Merge pull request #1685 from j2sol/feature/os_subnet_ipv6
Plumb ipv6 modes into os_subnet
This commit is contained in:
commit
350063532e
1 changed files with 36 additions and 2 deletions
|
@ -92,6 +92,18 @@ options:
|
||||||
- A list of host route dictionaries for the subnet.
|
- A list of host route dictionaries for the subnet.
|
||||||
required: false
|
required: false
|
||||||
default: None
|
default: None
|
||||||
|
ipv6_ra_mode:
|
||||||
|
description:
|
||||||
|
- IPv6 router advertisement mode
|
||||||
|
choices: ['dhcpv6-stateful', 'dhcpv6-stateless', 'slaac']
|
||||||
|
required: false
|
||||||
|
default: None
|
||||||
|
ipv6_address_mode:
|
||||||
|
description:
|
||||||
|
- IPv6 address mode
|
||||||
|
choices: ['dhcpv6-stateful', 'dhcpv6-stateless', 'slaac']
|
||||||
|
required: false
|
||||||
|
default: None
|
||||||
requirements:
|
requirements:
|
||||||
- "python >= 2.6"
|
- "python >= 2.6"
|
||||||
- "shade"
|
- "shade"
|
||||||
|
@ -117,6 +129,19 @@ EXAMPLES = '''
|
||||||
- os_subnet:
|
- os_subnet:
|
||||||
state=absent
|
state=absent
|
||||||
name=net1subnet
|
name=net1subnet
|
||||||
|
|
||||||
|
# Create an ipv6 stateless subnet
|
||||||
|
- os_subnet:
|
||||||
|
state: present
|
||||||
|
name: intv6
|
||||||
|
network_name: internal
|
||||||
|
ip_version: 6
|
||||||
|
cidr: 2db8:1::/64
|
||||||
|
dns_nameservers:
|
||||||
|
- 2001:4860:4860::8888
|
||||||
|
- 2001:4860:4860::8844
|
||||||
|
ipv6_ra_mode: dhcpv6-stateless
|
||||||
|
ipv6_address_mode: dhcpv6-stateless
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,6 +188,7 @@ def _system_state_change(module, subnet):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
ipv6_mode_choices = ['dhcpv6-stateful', 'dhcpv6-stateless', 'slaac']
|
||||||
argument_spec = openstack_full_argument_spec(
|
argument_spec = openstack_full_argument_spec(
|
||||||
name=dict(required=True),
|
name=dict(required=True),
|
||||||
network_name=dict(default=None),
|
network_name=dict(default=None),
|
||||||
|
@ -174,6 +200,8 @@ def main():
|
||||||
allocation_pool_start=dict(default=None),
|
allocation_pool_start=dict(default=None),
|
||||||
allocation_pool_end=dict(default=None),
|
allocation_pool_end=dict(default=None),
|
||||||
host_routes=dict(default=None, type='list'),
|
host_routes=dict(default=None, type='list'),
|
||||||
|
ipv6_ra_mode=dict(default=None, choice=ipv6_mode_choices),
|
||||||
|
ipv6_address_mode=dict(default=None, choice=ipv6_mode_choices),
|
||||||
state=dict(default='present', choices=['absent', 'present']),
|
state=dict(default='present', choices=['absent', 'present']),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -196,6 +224,8 @@ def main():
|
||||||
pool_start = module.params['allocation_pool_start']
|
pool_start = module.params['allocation_pool_start']
|
||||||
pool_end = module.params['allocation_pool_end']
|
pool_end = module.params['allocation_pool_end']
|
||||||
host_routes = module.params['host_routes']
|
host_routes = module.params['host_routes']
|
||||||
|
ipv6_ra_mode = module.params['ipv6_ra_mode']
|
||||||
|
ipv6_a_mode = module.params['ipv6_address_mode']
|
||||||
|
|
||||||
# Check for required parameters when state == 'present'
|
# Check for required parameters when state == 'present'
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
|
@ -226,7 +256,9 @@ def main():
|
||||||
gateway_ip=gateway_ip,
|
gateway_ip=gateway_ip,
|
||||||
dns_nameservers=dns,
|
dns_nameservers=dns,
|
||||||
allocation_pools=pool,
|
allocation_pools=pool,
|
||||||
host_routes=host_routes)
|
host_routes=host_routes,
|
||||||
|
ipv6_ra_mode=ipv6_ra_mode,
|
||||||
|
ipv6_address_mode=ipv6_a_mode)
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
if _needs_update(subnet, module):
|
if _needs_update(subnet, module):
|
||||||
|
@ -236,7 +268,9 @@ def main():
|
||||||
gateway_ip=gateway_ip,
|
gateway_ip=gateway_ip,
|
||||||
dns_nameservers=dns,
|
dns_nameservers=dns,
|
||||||
allocation_pools=pool,
|
allocation_pools=pool,
|
||||||
host_routes=host_routes)
|
host_routes=host_routes,
|
||||||
|
ipv6_ra_mode=ipv6_ra_mode,
|
||||||
|
ipv6_address_mode=ipv6_a_mode)
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
changed = False
|
changed = False
|
||||||
|
|
Loading…
Reference in a new issue