Commit Graph

42713 Commits (cd9471ef17c985006c7d77687030890003cf395d)
 

Author SHA1 Message Date
Dag Wieers cd9471ef17 Introduce new 'required_by' argument_spec option (#28662)
* Introduce new "required_by' argument_spec option

This PR introduces a new **required_by** argument_spec option which allows you to say *"if parameter A is set, parameter B and C are required as well"*.

- The difference with **required_if** is that it can only add dependencies if a parameter is set to a specific value, not when it is just defined.
- The difference with **required_together** is that it has a commutative property, so: *"Parameter A and B are required together, if one of them has been defined"*.

As an example, we need this for the complex options that the xml module provides. One of the issues we often see is that users are not using the correct combination of options, and then are surprised that the module does not perform the requested action(s).

This would be solved by adding the correct dependencies, and mutual exclusives. For us this is important to get this shipped together with the new xml module in Ansible v2.4. (This is related to bugfix https://github.com/ansible/ansible/pull/28657)

```python
    module = AnsibleModule(
        argument_spec=dict(
            path=dict(type='path', aliases=['dest', 'file']),
            xmlstring=dict(type='str'),
            xpath=dict(type='str'),
            namespaces=dict(type='dict', default={}),
            state=dict(type='str', default='present', choices=['absent',
'present'], aliases=['ensure']),
            value=dict(type='raw'),
            attribute=dict(type='raw'),
            add_children=dict(type='list'),
            set_children=dict(type='list'),
            count=dict(type='bool', default=False),
            print_match=dict(type='bool', default=False),
            pretty_print=dict(type='bool', default=False),
            content=dict(type='str', choices=['attribute', 'text']),
            input_type=dict(type='str', default='yaml', choices=['xml',
'yaml']),
            backup=dict(type='bool', default=False),
        ),
        supports_check_mode=True,
        required_by=dict(
            add_children=['xpath'],
            attribute=['value', 'xpath'],
            content=['xpath'],
            set_children=['xpath'],
            value=['xpath'],
        ),
        required_if=[
            ['count', True, ['xpath']],
            ['print_match', True, ['xpath']],
        ],
        required_one_of=[
            ['path', 'xmlstring'],
            ['add_children', 'content', 'count', 'pretty_print', 'print_match', 'set_children', 'value'],
        ],
        mutually_exclusive=[
            ['add_children', 'content', 'count', 'print_match','set_children', 'value'],
            ['path', 'xmlstring'],
        ],
    )
```

* Rebase and fix conflict

* Add modules that use required_by functionality

* Update required_by schema

* Fix rebase issue
5 years ago
Dag Wieers be9c75703a
Add new WG members 5 years ago
René Moser 0cc23de776
cloudstack: test: ensure network is implemented (#52204)
In ACS 4.12, it is no longer possbile to acquire IPs to a (...) network
not already in implemented state.

With deployment of a VM instance, we enforce the implementation of the
network. Also see 323f791efc
5 years ago
Emmanouil Kampitakis 1219aa811a Feature/alphanumeric password in passwordstore (#38121)
* Alphanumeric only password may be generated

* Bump the ansible version this will have been added to 2.8
5 years ago
Matt Clay d2c5fc8cac Update pytest and pytest-forked constraints. 5 years ago
Matt Clay aea4902822 Add constraint for pyone to keep tests passing. 5 years ago
Guillaume Martinez f7328693f2 gitlab_runner: refresh deprecated documentation notes (#52221) 5 years ago
Matt Clay 9bb1c59686
Add FreeBSD 12.0 to CI. (#52195) 5 years ago
Matt Clay 3e778d3f8f Fix pycodestyle E117 issues. 5 years ago
Jordan Borean 7b8e814a10 Ansible.Basic: make module options case insensitive with dep warning (#51583)
* Ansible.Basic: make module options case insensitive with dep warning

* Add porting guide info
5 years ago
Dag Wieers f254d0074d
BOTMETA: Update team_mysql (#52212) 5 years ago
Matt Clay 7016559b1a Fix openssl_privatekey test on FreeBSD 12.0. 5 years ago
Yunge Zhu bccf6d31bd add azure_applicationsecuritygroup module (#51214)
* add applicationsecurity group module

* fix lint
5 years ago
Matt Clay 1a4163cb88 Fix misuse of `is not` testing a string. 5 years ago
Adam Miller ea0e2bf2b3 yum always return changes dict, not only in check mode (#51987)
Previously the yum module would provide a `changes` dict when
executed in check mode but omit it when not in check mode in favor
of the `results` data which is raw output from the yum command. This
pull request makes that output uniform.

Fixes #51724

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago
René Moser 9e71ec71a3
cloudstack: ensure return api_timeout is int (#52191) 5 years ago
Felix Fontein 132d920113 Also return some information in case the docker daemon does not run, is not in swarm mode or not a swarm manager. (#52189) 5 years ago
Chris Archibald 6a06e9f485 New Module: na_ontap_nvme (#51182)
* changes to clusteR

* Revert "changes to clusteR"

This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.

* Add new module nvme
5 years ago
Miguel Angel Muñoz González 1b5575c669 Fortinet's FortiOS log fortianalyzer2 setting (#52159) 5 years ago
Miguel Angel Muñoz González d875ca3e58 Fortinet's FortiOS log fortianalyzer override setting (#52164) 5 years ago
Miguel Angel Muñoz González aac3ff364f Fortinet's FortiOS log fortianalyzer setting (#52165) 5 years ago
Miguel Angel Muñoz González cd06cdf1dc Fortinet's FortiOS log fortianalyzer3 filter (#52160)
* Fortinet's FortiOS log fortianalyzer3 filter

* Avoid fields with empty choices

* Avoid fields with empty choices
5 years ago
Simon Westphahl 02e87b7d70 Raise AnsibleConnectionError on winrm connnection errors (#51744)
* Raise AnsibleConnectionError on winrm con errors

Currently all uncaught exceptions of the requests library that is used
in winrm will lead to an "Unexpected failure during module execution".

Instead of letting all exceptions bubble up we catch the connection
related errors (inkl. timeouts) and re-raise them as
AnsibleConnectionError so Ansible will mark the host as unreachable and
exit with the correct return code.

This is especially important for Zuul (https://zuul-ci.org) to
distinguish between failures and connection/host related errors.

* Update lib/ansible/plugins/connection/winrm.py

Co-Authored-By: westphahl <westphahl@gmail.com>

* Add changelog fragment
5 years ago
Miguel Angel Muñoz González 2de41ae8f4 Fortinet's FortiOS log fortianalyzer3 setting (#52161) 5 years ago
Miguel Angel Muñoz González b51e3137a4 Fortinet's FortiOS log fortiguard override setting (#52169) 5 years ago
Miguel Angel Muñoz González d643108d5c Fortinet's FortiOS log fortiguard setting (#52170) 5 years ago
Miguel Angel Muñoz González 402c41d97f Fortinet's FortiOS log gui display (#52171) 5 years ago
Matt Clay 3f387f225c Fix safe_eval on Python 3.8. 5 years ago
René Moser 02f51e865c cloudscale: combine docs in fragment (#52069)
* cloudscale: combine docs in fragment

* workaround false negative E305
5 years ago
Sandra McCann 6c17c55b51 move modules to community support (#52184) 5 years ago
おすし c2a409a9e0 Fix: Yum module does not use proxy when username is not set #51548 (#51994)
* add test of yum with proxy

* Properly handle unauthenticated yum proxy config

Fixes #51548

* shell executable is bash
5 years ago
Felix Fontein d7fd4d0550 docker_*: always use client.fail() over module.fail_json(), allow to always return data on failure (#51999)
* Always use client.fail() instead of module.fail_json().

* Allow to pass on results on module failure.

* Linting.
5 years ago
Sam Doran ad386290b4
Update command/shell docs with note about modules for rebooting(#51499)
- Update integration test syntax
5 years ago
Kevin c512471428 Add two more failure conditions to unarchive (#51914) 5 years ago
Matt Martz cdb53ff1a4
Restore behavior for detecting only localhost, and no limit match. Fixes #52152 (#52172)
* Restore behavior for detecting only localhost, and no limit match. Fixes #52152

* Add test for non-matching limit
5 years ago
Jordan Borean 847d089d6b Re-add support for setting shell from play context (#52139)
* Re-add support for setting shell from play context

* Add integration tests

* Add more tests for shell override

* fix sanity issue
5 years ago
Matt Martz b34d141eed
Disallow use of remote home directories containing .. in their path (CVE-2019-3828) (#52133)
* Disallow use of remote home directories containing .. in their path

* Add CVE to changelog
5 years ago
Juan Antonio Osorio 9f081ca04f identity: Add GSSAPI suport for FreeIPA authentication (#52031)
* identity: Add GSSAPI suport for FreeIPA authentication

This enables the usage of GSSAPI for authentication, instead of having
to pass the username and password as part of the playbook run.

If there is GSSAPI support, this makes the password optional, and will
be able to use the KRB5_CLIENT_KTNAME or the KRB5CCNAME environment
variables; which are standard when using kerberos authentication.

Note that this depends on the urllib_gssapi library, and will only
enable this if that library is available.

* identity: Add documentation for GSSAPI authentication for FreeIPA

This documentation describes how to use GSSAPI authentication with the
IPA identity modules.

* identity: Add changelog for GSSAPI support for IPA

This adds the changelog entry for the GSSAPI authentication feature for
the IPA identity module.
5 years ago
Chris Archibald 7d55dc1a38 Add ontap version to gather facts (#51181)
* changes to clusteR

* Revert "changes to clusteR"

This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.

* Add FlexGroup to Gather facts:

* fix call error
5 years ago
Chris Archibald 93237edcda New Module: na_ontap_qos_policy_group (#51392)
* changes to clusteR

* Revert "changes to clusteR"

This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.

* add new module na_ontap_qos_policy_group

* fix issues
5 years ago
Gavin Kyte a722021207 Change un-ordered list to ordered (#52033)
Makes sense to make implied order explicit with an ordered list
5 years ago
Chris Archibald 311a076dae New Module: na_ontap_nvme_subsystem (#50887)
* changes to clusteR

* Revert "changes to clusteR"

This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.

* New module na_ontap_nvme_subsystem

* updates

* update author

* fix author
5 years ago
Alan Rominger af9ff07c74 Send openstack inventory logs to stderr (#51827) 5 years ago
Abhijeet Kasurde 32fce43311
hashi_vault: fix multiple spaces in params (#51524)
Fixes param parsing in hashi_vault

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Miguel Angel Muñoz González 196e82ec8a Fortinet's FortiOS User Tacacs+ (#52071) 5 years ago
Miguel Angel Muñoz González edcf07500f Fortinet's FortiOS Firewall Schedule Group (#52072) 5 years ago
Miguel Angel Muñoz González 05381db474 Fortinet's FortiOS fortios firewall service group (#52090) 5 years ago
Miguel Angel Muñoz González 3718a6b79f Fortinet's FortiOS fortios firewall shaper per ip shaper (#52092) 5 years ago
Miguel Angel Muñoz González a5ed17e462 Fortinet's FortiOS fortios firewall shaper traffic shaper (#52093) 5 years ago
Miguel Angel Muñoz González ac25361de5 Fortinet's FortiOS firewall shaping policy (#52094) 5 years ago