Commit Graph

6995 Commits (ea0e2bf2b31cd5124ce850bda56c5a7d75885d5c)

Author SHA1 Message Date
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
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
おすし 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
Sam Doran ad386290b4
Update command/shell docs with note about modules for rebooting(#51499)
- Update integration test syntax
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
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
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
Abhijeet Kasurde 22bddb434a
test for ipaddr filter (#52088)
based upon work of mscherer

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Pilou 51270be883 tower modules: check that 'verify_ssl' defined in ~/.tower_cli.cfg isn't ignored (#50687)
* Check that verify_ssl defined in tower_cli.cfg isn't ignored

* Avoid to override verify_ssl value defined in tower_cli.cfg

By default, tower-cli library enables SSL certificates check. But
verify_ssl false value defined in config files read by default by
tower-cli library (for example /etc/tower/tower_cli.cfg) was ignored
because overriden by the tower_verify_ssl parameter default value.

* fix a typo in comment
5 years ago
Ondra Machacek 797a5218fb kubevirt: Add new kubevirt_vm module (#50768)
This module is managing virtual machines using KubeVirt.

Signed-off-by: Ondra Machacek <omachace@redhat.com>
5 years ago
Straff d4a07f9573 Added support for user-specified log file in win_package (#51104)
* Added support for user-specified log file in win_package - feature (#38353)

* added integration tests for win_package log_path support feature (#38353), and applied review feedback

* win_package log_path support feature (#38353) - fixed typo in win-package.py documentation

* win_package log_path support feature (#38353) - improved an integration test and better doc in win-package.py
5 years ago
Matt Clay 467d2ebecd Fix unit tests on Python 3.8. 5 years ago
Amol Kahat 563725ba98 Fixed typo from adress to address (#52143)
Signed-off-by: Amol Kahat <akahat@redhat.com>
5 years ago
Matt Clay 1c352dfea2
Update test constraints for Python 2.6. (#52055) 5 years ago
Abhijeet Kasurde 928c4f08ca
Fix test case in vmware_guest (#52142)
Due to changes in https://github.com/ansible/ansible/pull/45412
vmware_guest testcase delete_vm failed. This patch will fix that testcase.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Will Thames 46fbcf08bc
aws_kms enhancements (#31960)
* Allow creation and deletion of keys (deletion just schedules for
  deletion, recreating an old key is just cancelling its deletion)
* Allow grants to be set, thus enabling encryption contexts to be
  used with keys
* Allow tags to be added and modified
* Add testing for KMS module
* Tidy up aws_kms module to latest standards
5 years ago
Matt Clay 1f3a74c0c8
Improve import sanity test output handling. (#52136)
Handling of unexpected output for the following is improved:

- stdout
- stderr
- warnings
5 years ago
Wojciech Sciesinski a431e802ed Add posibilities to run the integration tests for PowerShell < 5.0 (#50808)
* Add posibilities to run the integration tests for PowerShell < 5.0

* Update of tests - based at a review comments for #50612

* The correction of YAML structure
5 years ago
Wojciech Sciesinski a7528cdd25 Update the NuGet package provider when needed (#50759)
* Update the NuGet package provider when needed

* Update NuGet provider conditionally
5 years ago
Andrew Gaffney 9c35f18dd6 Custom jinja Undefined class for handling nested undefined attributes (#51768)
This commit creates a custom Jinja2 Undefined class that returns
Undefined for any further accesses, rather than raising an exception
5 years ago
rajaspachipulusu17 0825cbad40 Pluribus Networks prefix list network module with Unit test cases (#52064) 5 years ago
Chris Archibald ce092ed939 New Modules: na_ontap_unix_group (#51390)
* changes to clusteR

* Revert "changes to clusteR"

This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.

* add new module ontap_unix_groups
5 years ago
Bojan Vitnik 64a6dcdd1d New module: xenserver_guest_facts - returns facts of XenServer VMs (#49426)
* Initial commit for xenserver_guest_facts module
* New module: xenserver_guest_facts. Returns facts of XenServer VMs. Module is fully documented.
* Added unit tests for the module
* Moved FakeXenAPI import to a dedicated fixture, other fixes
* Removed unused imports, minor fixes to unit test code
5 years ago
Abhijeet Kasurde fab815fc3b
VMware: Handle duplicate VM names in vmware_vm_facts (#45412)
This fix changes facts returned from vmware_vm_facts to list of dict from
dict of dict.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Abhijeet Kasurde 5c992fcc3f
ansible-vault: handle utf-8 filename in vault (#50341)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
rajaspachipulusu17 48edffac60 Pluribus Networks vrouter ospf6 module with UT (#51793)
* Pluribus networks vrouter ospf6 module with UT

* Changes in check cli method
5 years ago
Hannes Ljungberg 70d8f02db7 docker_swarm_service: Extend env and add env_files support (#51762)
* Extend env and add env_files support

* Python 2.6 compat

* Handle lists passed as string

* Add changelog fragment

* Use correct link formatting

Co-Authored-By: hannseman <hannes@5monkeys.se>

* Fix typo

Co-Authored-By: hannseman <hannes@5monkeys.se>

* Handle empty env and env_files values
5 years ago
Felix Fontein 09f78d2f6c ufw: allow to insert rules relative to first/last IPv4/IPv6 rules (#49796)
* Insert should have type int.

* Add insert_relative_to option.

* Add changelog.

* Add tests.

* Improve comment.
5 years ago
rajaspachipulusu17 2e3964b474 Pluribus Networks vrouter interface ip module with UT (#51792)
* Pluribus networks vrouter interface ip module with UT

* Indetentation fix

* Changes in check cli method
5 years ago
rajaspachipulusu17 76534b45b0 Pluribus networks vflow table profile module with UT (#51722) 5 years ago
Jordan Borean 179cbb9891
win_dsc - return warning from DSC invocation (#51927) 5 years ago
rajaspachipulusu17 338ad565a7 Pluribus Networks vrouter bgp network module with UT (#51791) 5 years ago
Ari Stark 2f85d62989 Add state option to git_config module (#50578)
* Add state option to git_config module

State present/absent option works like --set/--unset option for 'git config'.

* Change git_config to avoid useless parameter passed to git command

When unsetting value, command was : git config --unset foo ''.
Now command is : git config --unset foo.

* Add some integration tests to git_config module

* Add missing aliases file

* Change set up method

Using git command seems to cause troubles on some OS : changing config
by changing '.gitconfig' file.

* Remove some distros from tests pool

Git is not installed or is out of date on these distros.

* Fix aliases to skip tests on centos6

* Refactor tests of the git_config module

* Add use case when state=absent and value is defined
5 years ago
onigra 063cd5ea44 Add force parameter to gem module (#51366) 5 years ago
Dag Wieers 031a1a5cc2 vsphere_file: New module to manage files on datastores (#48180) 5 years ago
Matt Martz c55317a2bd
Update connection plugins to use correct, non-deprecated, methods (#52038)
* Update connection plugins to use correct, non-deprecated, methods

* Update tests to reflect calling become plugins
5 years ago
Matt Clay 6cba471958 Remove unnecessary validate-modules ignore entry. 5 years ago
Matt Martz 445ff39f94
Become plugins (#50991)
* [WIP] become plugins

Move from hardcoded method to plugins for ease of use, expansion and overrides
  - load into connection as it is going to be the main consumer
  - play_context will also use to keep backwards compat API
  - ensure shell is used to construct commands when needed
  - migrate settings remove from base config in favor of plugin specific configs
  - cleanup ansible-doc
  - add become plugin docs
  - remove deprecated sudo/su code and keywords
  - adjust become options for cli
  - set plugin options from context
  - ensure config defs are avaialbe before instance
  - refactored getting the shell plugin, fixed tests
     - changed into regex as they were string matching, which does not work with random string generation
     - explicitly set flags for play context tests
 - moved plugin loading up front
 - now loads for basedir also
 - allow pyc/o for non m modules
 - fixes to tests and some plugins
 - migrate to play objects fro play_context
 - simiplify gathering
 -  added utf8 headers
 - moved option setting
 - add fail msg to dzdo
 - use tuple for multiple options on fail/missing
 - fix relative plugin paths
 - shift from play context to play
 - all tasks already inherit this from play directly
 - remove obsolete 'set play'
 - correct environment handling
 - add wrap_exe option to pfexec
 - fix runas to noop
 - fixed setting play context
 - added password configs
 - removed required false
 - remove from doc building till they are ready

future development:
  - deal with 'enable' and 'runas' which are not 'command wrappers' but 'state flags' and currently hardcoded in diff subsystems

* cleanup

  remove callers to removed func
  removed --sudo cli doc refs
  remove runas become_exe
  ensure keyerorr on plugin
  also fix backwards compat, missing method is attributeerror, not ansible error
  get remote_user consistently
  ignore missing system_tmpdirs on plugin load
  correct config precedence
  add deprecation
  fix networking imports
  backwards compat for plugins using BECOME_METHODS

* Port become_plugins to context.CLIARGS

This is a work in progress:
* Stop passing options around everywhere as we can use context.CLIARGS
  instead

* Refactor make_become_commands as asked for by alikins

* Typo in comment fix

* Stop loading values from the cli in more than one place

Both play and play_context were saving default values from the cli
arguments directly.  This changes things so that the default values are
loaded into the play and then play_context takes them from there.

* Rename BECOME_PLUGIN_PATH to DEFAULT_BECOME_PLUGIN_PATH

As alikins said, all other plugin paths are named
DEFAULT_plugintype_PLUGIN_PATH.  If we're going to rename these, that
should be done all at one time rather than piecemeal.

* One to throw away

This is a set of hacks to get setting FieldAttribute defaults to command
line args to work.  It's not fully done yet.

After talking it over with sivel and jimi-c this should be done by
fixing FieldAttributeBase and _get_parent_attribute() calls to do the
right thing when there is a non-None default.

What we want to be able to do ideally is something like this:

class Base(FieldAttributeBase):
    _check_mode = FieldAttribute([..] default=lambda: context.CLIARGS['check'])

class Play(Base):
    # lambda so that we have a chance to parse the command line args
    # before we get here.  In the future we might be able to restructure
    # this so that the cli parsing code runs before these classes are
    # defined.

class Task(Base):
    pass

And still have a playbook like this function:

---
- hosts:
  tasks:
  - command: whoami
    check_mode: True

(The check_mode test that is added as a separate commit in this PR will
let you test variations on this case).

There's a few separate reasons that the code doesn't let us do this or
a non-ugly workaround for this as written right now.  The fix that
jimi-c, sivel, and I talked about may let us do this or it may still
require a workaround (but less ugly) (having one class that has the
FieldAttributes with default values and one class that inherits from
that but just overrides the FieldAttributes which now have defaults)

* Revert "One to throw away"

This reverts commit 23aa883cbed11429ef1be2a2d0ed18f83a3b8064.

* Set FieldAttr defaults directly from CLIARGS

* Remove dead code

* Move timeout directly to PlayContext, it's never needed on Play

* just for backwards compat, add a static version of BECOME_METHODS to constants

* Make the become attr on the connection public, since it's used outside of the connection

* Logic fix

* Nuke connection testing if it supports specific become methods

* Remove unused vars

* Address rebase issues

* Fix path encoding issue

* Remove unused import

* Various cleanups

* Restore network_cli check in _low_level_execute_command

* type improvements for cliargs_deferred_get and swap shallowcopy to default to False

* minor cleanups

* Allow the su plugin to work, since it doesn't define a prompt the same way

* Fix up ksu become plugin

* Only set prompt if build_become_command was called

* Add helper to assist connection plugins in knowing they need to wait for a prompt

* Fix tests and code expectations

* Doc updates

* Various additional minor cleanups

* Make doas functional

* Don't change connection signature, load become plugin from TaskExecutor

* Remove unused imports

* Add comment about setting the become plugin on the playcontext

* Fix up tests for recent changes

* Support 'Password:' natively for the doas plugin

* Make default prompts raw

* wording cleanups. ci_complete

* Remove unrelated changes

* Address spelling mistake

* Restore removed test, and udpate to use new functionality

* Add changelog fragment

* Don't hard fail in set_attributes_from_cli on missing CLI keys

* Remove unrelated change to loader

* Remove internal deprecated FieldAttributes now

* Emit deprecation warnings now
5 years ago
Rémy Léone accbcdeccb Add a Scaleway load-balancer module (#51741) 5 years ago
Mariusz Mazur 34671a64b3 k8s_auth: new k8s module for handling auth (#50807)
* k8s*: add a reference to k8s_auth in all the modules' descriptions

* k8s_auth: new k8s module for handling auth

* k8s_auth: ignore E203

Can't use module_utils.urls, since that lacks user CA support, which is
a critical feature of what this module does.
5 years ago
Jérôme BAROTIN b99de25f32 Enable changed var with ufw check mode (#49948)
* Enable 'changed' var with ufw check mode

* Fix from comment of the PR + Unit Test

* Fix on ufw module after the second review

- delete rules change works in check mode
- simplify execute def & use it on every call process
- improved regexp
- rename vars defaults to current_default_values

* Add ignore error to execute() and use it in get_current_rules()

* Update after third code review (introduce change in changed status)

* Adjust tests and fix some problems (#1)

* 'active' also appears in 'inactive'.

* 'reject' is also a valid option here.

* For example for reloaded, changed will be set back to False here.

* Improve and adjust tests.

* Fix after merging integration test

* handle "disabled" on default routed

* Add /var/lib/ufw/.. rules files

* add unit test

* Fix pep8 formatting error

* Separate ipv6 and ipv4 rules process from checkmode

* fix non-ascii error on ci

* Some change after review

* Add unit test with sub network mask

* rename is_match function by is_starting

* add changelog fragment
5 years ago
Felix Fontein 9b1cbcf3a4 openssl_csr: ignore empty strings in altnames (#51473)
* Ignore empty strings in altnames.

* Add changelog.

* Add idempotence check without SAN.

* Fix bug in cryptography backend.
5 years ago
Guillaume Martinez 7b84c0ee80 gitlab_hook: renaming module name (#51979)
* gitlab_hook: renaming module name

* gitlab_hook: rename module in documentation

* gitlab_hook: remove plural in docs and code

* gitlab_hook: fix unit test functions
5 years ago
Hannes Ljungberg 153e996760 docker_swarm_service: Remove defaults (#51216)
* Drop descriptions of docker-py constraints <=3.0.0

* Properly indent documentation

* Clearer examples

* Spelling

* Fix example

* Revert "Drop descriptions of docker-py constraints <=3.0.0"

This reverts commit 8106215af62ae5880c3b748cec562a85f2247bdc.

# Conflicts:
#	lib/ansible/modules/cloud/docker/docker_swarm_service.py

* Add min versions for placement preferences

* Add endpoint_mode and publish to option_minimal_versions

* Restrict update max_failure_ratio and monitor versions

* Remove defaults and only pass required arguments

* Fix indentation

* Fix args documentation

* Fix replicas documentation

Co-Authored-By: hannseman <hannes@5monkeys.se>

* Add type to all documented options

* Add suboptions for mounts, secrets and configs

* Add suboptions to argument spec

* Remove redundant validation and casting

* Don’t default Spec.EndpointSpec.Mode to vip

* Use single quotes as string literal

* Catch ImportError explicitly

* Move init to top of class

* Align closing brackets

* Spelling

* Import LooseVersion

* Documentation fixes

* Documentation fix

* Documentation fixes

* Remove required: false and default=None

* Defaults for update_delay and update_parallelism

* Set correct key for default

* Handle empty idempotency

* Clearer image documentation

Co-Authored-By: hannseman <hannes@5monkeys.se>

* Clearer constraint documentation

Co-Authored-By: hannseman <hannes@5monkeys.se>

* Better documentation of corresponding service opts
5 years ago
Adam Miller 2721ed260e Properly handle unauthenticated yum proxy config (#51915)
Fixes #51548

Signed-off-by: Adam Miller <admiller@redhat.com>
5 years ago