community.general/lib/ansible
Ganesh Nalawade 97a34cf008 Add options sub spec validation (#27119)
* Add aggregate parameter validation

aggregate parameter validation will support checking each individual dict
to resolve conditions for aliases, no_log, mutually_exclusive,
required, type check, values, required_together, required_one_of
and required_if conditions in argspec. It will also set default values.

eg:
tasks:
  - name: Configure interface attribute with aggregate
    net_interface:
      aggregate:
        - {name: ge-0/0/1, description: test-interface-1, duplex: full, state: present}
        - {name: ge-0/0/2, description: test-interface-2, active: False}
    register: response
    purge: Yes

Usage:
```
from ansible.module_utils.network_common import AggregateCollection

transform = AggregateCollection(module)
param = transform(module.params.get('aggregate'))
```

Aggregate allows supports for `purge` parameter, it will instruct the module
to remove resources from remote device that hasn’t been explicitly
defined in aggregate. This is not supported by with_* iterators

Also, it improves performace as compared to with_* iterator for network device
that has seperate candidate and running datastore.
For with_* iteration the sequence of operartion is
load-config-1 (candidate db) -> commit (running db) -> load_config-2
(candidate db) -> commit (running db) ...

With aggregate the sequence of operation is
load-config-1 (candidate db) -> load-config-2 (candidate db) -> commit
(running db)

As commit is executed only once per task for aggregate it has
huge perfomance benefit for large configurations.

* Fix CI issues

* Fix review comments

*  Add support for options validation for aliases, no_log,
   mutually_exclusive, required, type check, value check,
   required_together, required_one_of and required_if
   conditions in sub-argspec.
*  Add unit test for options in argspec.
*  Reverted aggregate implementaion.

* Minor change

* Add multi-level argspec support

*  Multi-level argspec support with module's top most
   conditionals options.

* Fix unit test failure

* Add parent context in errors for sub options

* Resolve merge conflict

* Fix CI issue
2017-08-01 09:32:18 -07:00
..
cli Give precedence to user supplied --roles-path option (#27524) 2017-07-31 18:46:49 -04:00
compat Remove wildcard imports 2017-07-28 22:10:17 -07:00
config Support multiple vault passwords (#22756) 2017-07-28 15:20:58 -04:00
errors correct, cleanup & simplify dwim stack (#25956) 2017-07-03 15:27:53 -04:00
executor rename legacy PS module_utils to remove PowerShell prefix (#27495) 2017-07-31 10:06:12 -07:00
galaxy Fix wildcard import in galaxy/token.py 2017-07-27 15:37:26 -07:00
inventory ensure all groups inherit from 'all' 2017-07-13 18:38:39 -04:00
module_utils Add options sub spec validation (#27119) 2017-08-01 09:32:18 -07:00
modules iosxr implemetation for net_interface (#27513) 2017-08-01 20:19:54 +05:30
parsing Support multiple vault passwords (#22756) 2017-07-28 15:20:58 -04:00
playbook Fix undefined variables, basestring usage, and some associated python3 issues 2017-07-25 15:58:23 -07:00
plugins Add fix to read correct socket path recieved from ansible-connection (#27560) 2017-08-01 19:32:25 +05:30
template Try to show original exception info for yaml (and other) errors (#24468) 2017-06-09 13:13:15 -04:00
utils ACI module_utils library for ACI modules (#27070) 2017-07-31 12:44:27 +01:00
vars Remove wildcard imports 2017-07-28 22:10:17 -07:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py Fix undefined variables, basestring usage, and some associated python3 issues 2017-07-25 15:58:23 -07:00
release.py Collated PEP8 fixes (#25293) 2017-06-02 12:14:11 +01:00