os_subnet: allow using non-default subnet pool (#52608)

pull/59933/head
James Cassell 5 years ago committed by ansibot
parent 025e30ea0c
commit 17f2b5f73e

@ -0,0 +1,5 @@
---
bugfixes:
- >
os_subnet - it is valid to specify an explicit ``subnetpool_id`` rather than
``use_default_subnetpool`` or ``cidr``

@ -272,9 +272,10 @@ def main():
if state == 'present': if state == 'present':
if not module.params['network_name']: if not module.params['network_name']:
module.fail_json(msg='network_name required with present state') module.fail_json(msg='network_name required with present state')
if not module.params['cidr'] and not use_default_subnetpool: if (not module.params['cidr'] and not use_default_subnetpool and
module.fail_json(msg='cidr or use_default_subnetpool required ' not extra_specs.get('subnetpool_id', False)):
'with present state') module.fail_json(msg='cidr or use_default_subnetpool or '
'subnetpool_id required with present state')
if pool_start and pool_end: if pool_start and pool_end:
pool = [dict(start=pool_start, end=pool_end)] pool = [dict(start=pool_start, end=pool_end)]

Loading…
Cancel
Save