Commit Graph

554 Commits (69dd03d4726f3e927f65707a055ef30e4f581bae)

Author SHA1 Message Date
Matt Martz 8a2d39bcb2
Guard creating HTTPSClientAuthHandler behind HTTPS checks (#50523)
* Guard creating HTTPSClientAuthHandler behind HTTPS checks. Fixes #50339

* linting fixup
6 years ago
Abhijeet Kasurde 17bb4f4932 default: callback plugin allow unreachable task to stderr (#50533)
Provide toggle flag to allow display of unreachable task to stderr
using default callback plugin.

Fixes: #48069

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Renato Orgito 6f9bca9de3 Add auth_timeout parameter when supported by paramiko (#50448)
* Add auth_timeout parameter when supported

Paramiko 2.2 introduces the auth_timeout parameter. This will set the
parameter to the same value of the timeout parameter to prevent
"Authentication timeout" errors.

* Conditionally add auth_timeout to ssh.connect

Renamed sock_kwarg to ssh_connect_kwargs and conditionally added the
auth_timeout parameter based on the installed paramiko version.

* Add changelog fragment
6 years ago
trogdor_the_burninator 1dac10e5c3 Add AIX support to reboot module (#50353)
* Add ability for reboot module to work for AIX

* changelog for AIX reboot support
6 years ago
Brian Coca 207848f354 avoid x2 setting of set_fact when 'cacheable' (#50564)
* avoid x2 setting of set_fact when 'cacheable'

  fixes #50556

* ammend docs to new behaviour

* added period
6 years ago
vpiserchia 774a667591 Add Devuan Support for ascii release - resolve 49615 (#49616)
* Add Devuan Support for ascii release - resolve 49615

* Devuan Ascii does not have the VERSION_ID in the /etc/os-release file, we need to set NA
6 years ago
Toshio Kuratomi 27f9c3fba0 Clarify the change made to reverse_inventory 6 years ago
Martin Krizek 6d604f9b01 Allow for vaulted templates in template lookup (#49819)
Fixes #34209
6 years ago
Martin Krizek 82c95e07b5
Fix searchpath in the template lookup (#50488) 6 years ago
Matt Martz 9abeecb6d4
Add new AnsibleTemplateError to more easily catch templating issues (#50563)
* Add new AnsibleTemplateError to more easily catch templating issues. Fixes #50154

* Add changelog fragment
6 years ago
Toshio Kuratomi 40e7c7a210
Add a porting guide entry for ansible_distribution facts (#50251)
* Add a porting guide entry for ansible_distribution facts

Switching away from platform.distro() will cause changes sometimes due
to the new code using new sources of information that may be out of sync
with the old ones.  Just have to make people aware of that and also what
we are doing to mitigate it when appropriate.

* wordsmithed, added links for new distro backend
6 years ago
Jordan Borean b967f4dcc1 dnf/yum - added install_weak_deps option (#50525)
* dnf/yum - added install_weak_deps option

* skip creating weak dep packages if rpm doesn't support it

* fix rpm check for older hosts
6 years ago
Toshio Kuratomi afdbb0d9d5 Save the command line arguments into a global context
* Once cli args are parsed, they're constant.  So, save the parsed args
  into the global context for everyone else to use them from now on.
* Port cli scripts to use the CLIARGS in the context
* Refactor call to parse cli args into the run() method
* Fix unittests for changes to the internals of CLI arg parsing
* Port callback plugins to use context.CLIARGS
  * Got rid of the private self._options attribute
  * Use context.CLIARGS in the individual callback plugins instead.
  * Also output positional arguments in default and unixy plugins
  * Code has been simplified since we're now dealing with a dict rather
    than Optparse.Value
6 years ago
Matt Martz 3b49bbcfde Give IncludedFile more context via ansible_search_path (#50045)
* Give IncludedFile more context via ansible_search_path to template lookups. Fixes #49969

* Update units
6 years ago
Jordan Borean 63e454a4b2 dnf - fix conf_file loading (#50515) 6 years ago
Abhijeet Kasurde a45063defe Update changed_when and failed_when examples (#50411)
Added examples in playbooks_error_handling doc for handlining
multiple conditions in changed_when and failed_when

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Felix Fontein 5c5cd2dc4d openssl_*: prevent error when path includes no path (#50322)
* Prevent error when path includes no path.

* Add changelog.
6 years ago
Felix Fontein a5bf71ac6a openssl_csr: idempotency doesn't work correctly for keyUsage (#50361)
* Fix key usage idempotency bug.

* Extend tests.

* Add changelog.
6 years ago
Felix Fontein 6b33c588d0 docker_swarm_service: Fix typo for option type (#50483)
* Fix typo for option type in docker_swarm_service.

* Add changelog.
6 years ago
Adam Miller b81a74f551 add changelog for #50242 (#50480)
Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Adam Miller ca084889c7 fix order of dnf api operations so transactions don't fail (#50038)
* fix order of dnf api operations so transactions don't fail

Previously dnf.base.fill_sack() was called before
dnf.base.update_cache() which apparently breaks dnf transaction
logic as per https://bugzilla.redhat.com/show_bug.cgi?id=1658694

Fixes #49060

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

* add changelog and test case

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Felix Fontein 26e3240315 docker_secret, docker_config: allow to base64-decode data (#49688)
* Adjust docker_config and docker_secret to be more similar.

* Add data_is_b64 parameter to docker_secret and docker_config.

* Add changelog.
6 years ago
René Moser e761ea3f9d
vultr_server: fix multiple ssh keys not handled (#50337)
* vultr_server: fix multiple ssh keys not handled

* add changelog fragment
6 years ago
Simon Dodsley 507f89e693 Pure Storage facts fix (#50349)
* Add module for Pure Storage FlashBlade to manage directory services

* Fix facts not correctly passing into ansible_facts dict
6 years ago
Adam Miller 33156712a9 Provide both service state and status when possible in service_facts (#49618)
* Combine systemd units/unit-files output for service_facts

Fixes #47118

Previously we were only taking the output of `systemd units` which
would leave out information about the service units that were
disabled, static, masked, etc. Now we're aggregating the results so
that anything not active/inactive/dead at least is pulled as fact
data with it's state provided.

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

* provide state and status information about services

Fixes #45730

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Abhijeet Kasurde fc6c500b5b
postgresql_user: set type of conn_limit (#50178)
conn_limit type is set to 'int'. This will allow module to compare conn_limit with record value without type casting.

Fixes: #38118

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Nathaniel Case f05979932b
Allow AnsibleVaultEncryptedUnicode to pass through exec_jsonrpc (#48306)
* Allow AnsibleVaultEncryptedUnicode to pass through exec_jsonrpc

* Add changelog
6 years ago
Abhijeet Kasurde 14eba662c8 Correct match test documentation (#50229)
Match test matches zero or more characters at the begining of the string.

Fixes: #32366

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Dag Wieers 0fe7d569c9 win_firewall_rule: Remove invalid 'bypass' action (#50207)
* win_firewall_rule: Remove invalid 'bypass' action

This fixes #50143

* Add changelog fragment
6 years ago
Dag Wieers 50ed152ab9 win_updates: Correctly report changes on success (#50188)
* win_updates: Correctly report changes on success

* Add changelog fragment
6 years ago
Jacob Floyd 069e0b8d57 Make modprobe module check for builtins as well (#37150)
Without this modprobe always reports changed when modprobe-ing a builtin module.

With this, if a kernel module is a builtin, the modprobe module will:
- succeed (without incorrectly reporting changed) if ``state`` is ``present``;
- fail if ``state`` is ``absent``

The failure will have whatever error message modprobe returns when
attempting to remove a builtin module. For example:
``modprobe: ERROR: Module nfs is builtin.``
6 years ago
Gavin Williams 01a1ce16ce Jenkins_plugin: Handle 'latest' version when installing plugin for first time (#49723)
* Handle 'latest' version when installing module for first time

Otherwise, a fresh install of a plugin with 'version: latest' gets installed without its dependencies, rendering the plugin effectively useless.

* Add changelog
6 years ago
Julien Girardin 3e303bea4c List correctly current PV in "lvg" module: fix lvg reduce (#49731)
* Refactor integration test for lvg module to introduce grow/reduce test

* List correctly current PV in lvg module: fix lvg reduce

Previous behaviour was to only take into account PV passed in 'pvs'
argument. This lead to reduce not working as expecting:

* with state=present and list of wanted pvs, lvg found only the pvs to
  add or already present and ignored the pv to remove (obviously absent
  from the list of given PV)

* with state=absent and a pv to remove, lvg found that the remaining pvs
  list is empty (ignoring possible other PV in the vg) and decides to
  remove the vg entirely (as supposely no PV are left anymore to store
  lvm metadata)

* Add changelog fragment
6 years ago
Abhijeet Kasurde b132593861 Move doc fragments to changelogs/fragments dir (#50179)
Move changelog fragment to changelogs/fragments dir
6 years ago
Miguel Duarte Barroso 4951e5a5b7 os_security_group_rule proper module exit (#50076)
When the security group the rule belongs to does not exist and
the state is absent, the module is not properly exited, leading
to a playbook execution failure.

Fixes issue #50057
6 years ago
Michael Rose bcae7f24cb influxdb_user: Fixed unhandled exception on invalid login credentials (#50134) 6 years ago
Andrea Tartaglia 65c7424a35 Added organization in the scm_credential get (#49884)
* Added organization in the scm_credential get

* Fallback looking for cred in project org

* Tests project with multi org credential

* Fixed CI issue

* Added changelog fragment
6 years ago
Jordan Borean 65ce1b727e
win_copy - fix remote dir copy when it contains an empty dir (#50126) 6 years ago
Martin Krizek 545edc9114 facts: detect FreeBSD KVM guests (#50030)
Fixes: #49158
6 years ago
Martin Krizek 29c3bb48e9 facts: correctly detect multiple ipv6 addresses per device (#50020)
Fixes #49473
6 years ago
Jordan Borean efda3eaf1c
win_lineinfile - fix malformed returned json (#50066) 6 years ago
Brian Coca 88c87a3583
added handlers_from (#49220)
* added handlers_from

fixes #46769
6 years ago
Jérémy Lecour 2fb9b46752 Lineinfile must not insert lines multiples times with insertbefore/insertafter (#49409)
* Change test suite to fit expected behaviour

This reverts some changes from ansible/ansible@723daf3
If a line is found in the file, exactly or via regexp matching, it must 
not be added again.
insertafter/insertbefore options are used only when a line is to be 
inserted, to specify where it must be added.

* Implement the change in behaviour mentioned in the previous commit

* Fix comment to reflect what the code does

* Set the correct return message.

In these cases, the lines are added, not replaced.

* Add a changelog
6 years ago
Matt Martz 7eb1ab45a7
Allow tags to be templated from a variable (#49833)
* Allow tags to be templated from a variable. Fixes #49825

* Restore _load_tags to ensure we do csv tag splitting

* Add tests for csv tags and templated tags

* evaluate_tags doesn't need to accept strings, because _load_tags handles this
6 years ago
Matt Martz a0d71e7735
Fix reverse_inventory order to work on python3 (#49895) 6 years ago
Aleksander Kovtunenko ba562043e1 changed if logic Type to boolean (#49628)
* changed Type to boolean

* fix after review

* created fragment
6 years ago
Toshio Kuratomi 61b1daa65f Port from plaform.dist to ansible.module_utils.distro.linux_distribution
ci_complete
6 years ago
Eric Miller 4d0f2e632c Docker inventory service/stack groups for docker swarm (#48021)
* Adding service and stack grouping to docker inventory

* Updating documentation

* Adding changelog fragment for docker.py inventory script
6 years ago
Adam Miller 16f48bb4be
add changelog for pr #49912 (#49962)
Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Dave Bendit d62d7176b0 [docker_container] Failing on non-string env values (#49843)
* [docker_container] Failing on non-string env values

Fixes #49802

* Clarify failure message

Co-Authored-By: DBendit <David@ibendit.com>

* Fixup from review
6 years ago
Dave Bendit c67f4290e6 [docker_volume] Checking option minimal versions (#49839)
Fixes #38833
6 years ago
Akshay Gaikwad 1e0363ec7d Support for cache_from parameter in docker_image module (#49787)
* Support for cache_from parameter in docker_image module

Fixes #21704

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Minimum docker version check for cache_from option

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* Add changelog fragment

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>

* cache_from fix when docker-py is older

Signed-off-by: Akshay Gaikwad <akgaikwad001@gmail.com>
6 years ago
Jordan Borean 4019d4f6d1
Windows Privileges - moved util code to it's own C# util (#48897)
* Windows Privileges - moved util code to it's own C# util

* Rename Enabler class to PrivilegeEnabler to remove ambiguity

* rename Utils to PrivilegeUtil

* fix missing util name changes
6 years ago
Jordan Borean 190d1ed7f1 win become: refactor and add support for passwordless become (#48082)
* win become: refactor and add support for passwordless become

* make tests more stable

* fix up dep message for Load-CommandUtils

* Add further check for System impersonation token

* re-add support for become with accounts that have no password

* doc fixes and slight code improvements

* fix doc sanity issue
6 years ago
Michael Rose b422c59ada Amends #47040 - influxdb_user - Prevents potential accidental password changes to blank (#49084)
* Amends #47040 - Prevents potential accidental password changes to blank

* Added changelog fragment
6 years ago
Pierre-Louis Bonicoli 7e278b23b4 inventory plugin order: update doc
add doc for #44428:
- add changelog fragment
- update porting guide
also:
- update auto inventory plugin doc
- mention toml plugin in examples
6 years ago
WhyIsThisOpen 7bdca72713 rhn_register fixes for username and password when unregistering
- Require username and password for unregistering and avoid "cannot marshal None unless allow_none is enabled" error when using an activation key and no channels specified.
- Update test fixtures and add changelog


Co-authored-by: WhyIsThisOpen <WhyIsThisOpen@users.noreply.github.com>
6 years ago
Dave Bendit 8fcf9e1a28 [docker_container] Fixes idempotency checks for network_mode (#49797)
Fixes #49794
6 years ago
Abhijeet Kasurde d36922064b Add support for hex color in slack module (#49804)
Fixes: #11935

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Andrea Scarpino 06099bd116 win_uri: fix body with one item in list (#49484) 6 years ago
Brian Coca daaca1abd5
fix vbox inventory to correclty unset pwfile (#49774) 6 years ago
Sam Doran 7c8af3d684 Reboot - Fix VMware ESXi not working by adding appropriate commands (#49637)
* Add commands for VMware ESXi

* Add changelog
6 years ago
Sam Doran c1589c33c4
Reboot - Fix command not found, add Apline support, fix Solaris command (#49272)
* Fix various bugs related in reboot

- Use format strings for consistency and improve debug log messages
- Use local variables instead of class attributes in order to be thread safe
- Run setup module to get distribution and version
- Run find module to get full path of shutdown command
- Use ansible_os_family and ansible_distribution to find commands and args
- Use same command for all Solaris/SunOS distributions
- Move delay calculations to properties
- Reliably check for module run failure
- Fix bug in run_test_command() that accidentally made the method work properly
- Use better exceptions rather than Exception
- Use dict literals rather than constructors
- Correct _check_delay() so it always returns a value, not None
- Don't store and return result in run_test_command() because it's not used anywhere
- add test for post reboot command that fails
- test negative values for delay parameters
6 years ago
Matt Martz c9040d7579
Don't just raise AnsibleError with the exception message (#49654)
* Don't just raise AnsibleError with the exception message. Fixes #49252

* Add changelog fragment
6 years ago
Brian Coca 8ce4720f44
pear: More info if failure occurs (#49735)
* added cli errors to error msg for pear
6 years ago
Steven Tobias 260512459d stop requiring description. this is not a mandated jira field for all screens (#46023) 6 years ago
Matt Davis 30c611a9cf
add changelog for 46608 6 years ago
Brian Coca b924476d63 updated clog with cve 6 years ago
Abhijeet Kasurde be21140384
VMware: update docs and return docs for vmware_host_service_facts (#49736)
Follow up of 45155

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Dag Wieers 7b01725bb5 mail: Fix new breakage on python 2.7 (#49197)
* mail: Fix new breakage on python 2.7

* Add changelog fragment

* Add basic SMTP testing

* Add SMTP integration tests using starttls and TLS
6 years ago
Brian Coca 758ac1846b
match interpreter on stdout also (#49446)
fixes #46980
6 years ago
Brian Coca e53a7856f6
simplify vm_guest detection code (#49378)
- remove a lot of repetition
  - change lists to tuples since they are faster to assign
6 years ago
Brian Coca 42a13d15f1
add path info to role list (#49346)
* add path info to role list

 - use same display format for both listing all and specific roles


Co-Authored-By: bcoca <bcoca@users.noreply.github.com>
6 years ago
Brian Coca 0c1f62065c
make adhoc include_role/task work again! (#49247)
* adhoc include_role/task work again!
  - fix task, pass if set
6 years ago
Brian Coca 70ba960f6d
More specificity in errors for cfg mgr (#48995)
* More specificity in errors for cfg mgr
6 years ago
Brian Coca 20270680fc
fixes to ansible-doc (#47682)
fixes to ansible-doc
 - change json to always be type dependent
 - change changelog generation to loop over the options
 - warn about ignoring module path
6 years ago
Brian Coca ba4c2ebeac
ensure ssh retry respects no log (#49569) 6 years ago
Dag Wieers 37820be05b
aci_rest: Fix ignoring custom port (#49715) 6 years ago
Dario Zanzico b183eb4464 docker_swarm_service: ensure idempotency when the user parameter is None (#49235)
* ensure idempotency for user set to None

* Update `user` documentation and add changelog fragment

* clarify changelog fragments and parameters documentation

* use restructuredtext syntax in changelog fragment
6 years ago
Abhijeet Kasurde c9325ca247
Override help string version (#49545)
This fix adds additional help message to version command options

Fixes: #20488

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Martz 9007dbec2f
Add info about loop based on jinja2 loop var (#42134)
* Add info about loop based on jinja2 loop var

* ansible_loop

* Update test count

* Add extended loop_control that defines whether ansible_loop should be added

* Extended needs to be defaulted

* Revert "Update test count"

This reverts commit f1e93ee469825f4cdcd90fb28667d29aa088275c.

* Add docs about loop_control.extended

* Add revindex and revindex0

* Document ansible_loop in special vars

* Add changelog fragment

* Add tests, change items to allitems so that dot notation works, fix logic error with previtem
6 years ago
Brian Coca 597c258e0e
explain 'bare variables' (#49577) 6 years ago
Matt Martz 3a4d476512
Add now() jinja2 global func for getting the date/time (#43792)
* Add now() jinja2 global func for getting the date/time

* Docs and changelog

* now isn't a lookup, it doesn't need disabled
6 years ago
Dave Bendit 73640a4190 [docker_network] Adding `scope` and `attachable` flags (#49562)
Incorporating the abandoned work from PRs #35288 and #45552. Also adding in
the version checking from `docker_container.py`, which should be abstracted
out to `docker_common.py`.
6 years ago
Matt Martz 69d230f4bf Make squash deprecation messages less misleading (#49551) 6 years ago
Thomas Picariello c8ecac8dc2 Fix google auth scoping for unscoped credentials (#46740)
* Fix google auth scoping for unscoped credentials

* Add changelog fragment
6 years ago
Adam Miller 6f90d62be3 fix py3 scope for unique filter errors, enable filters integration tests on rhel8 beta (#48961)
* fix py3 scope for unique filter errors, enable filters integration tests on rhel8 beta

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

* add changelog

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
uberjew666 b72187cd2c Fixed win_route module (#46395)
* Changed $IpAddress to $Gateway

* Tweaked win_route unit tests

Checks to see if new static route has the correct gateway

* Create win_route.yaml

* Fixed incorrect variable name
6 years ago
Toshio Kuratomi 33f0c1ce22 FactCache changes
* Fix FactCache to conform to the dict API
  * update needs to take a dict rather than a key and a value
  * __init__ needs to allow for setting the intial dictionary
* Remove unneeded _display and _cache attributes
* Move ansible.plugins.cache.FactCache to
  ansible.vars.fact_cache.FactCache because this isn't part of the cache
  plugin API.
* Add backwards compatibility when calling update on the new FactCache
* Remove code for calling old FactCache. There's no way to call the old
  FactCache so there's no need for backwards compatible code for calling
  code.  Backwards compatibility is handling things which are calling
  the new FactCache.
* Port our code to the new FactCache location.
6 years ago
Brian Coca 6096f57880 fix cache 'update' method to be 'mapping' compatible
- also simplify the update functions
 - fix methods and allwow backwards compat with plugins overriding 'update'
6 years ago
Matt Martz 77de219836
Support version 3 of the redis python library (#49445)
* Support version 3 of the redis python library. Fixes #49341

* Document 2.4.5 minimum redis-py version
6 years ago
Ryan Conway aacd22acc6 Fix an issue retrieving some types of 1Password items. (#47213)
* Some types of 1Password items have a 'password' field alongside the 'fields' attribute, not inside it, so we need to search there as well.

* Add changelog fragement for onepassword_facts PR #47213.
6 years ago
Josue David Hernandez 6d42c5020a Fix for changes in clearlinux (#49344)
* Fix for changes in clearlinux

clearlinux is now providing /etc/os-release file and ansible is identifying as NA
then this change allow ansible to find it

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>

* Add changelog fragment for clearlinux changes

Signed-off-by: Josue David Hernandez Gutierrez <josue.d.hernandez.gutierrez@intel.com>
6 years ago
chris93111 7c8b5a407d VMware: Add option to modify disk type while cloning template (#47859)
* Add parameters to module vmware_guest for conversion of disk to thin or thick when vm is cloned or deployed with template

* unit test for convert clone vm

Co-Authored-By: chris93111 <christopheferreira@ymail.com>
6 years ago
Toshio Kuratomi c817bef3ae Fix for callback plugins on Python3 when a module returns dictionary keys that aren't strings
This fixes one of the problems reported in https://github.com/ansible/ansible/issues/49343

Upstream Python3 bug for the json traceback:
https://bugs.python.org/issue25457

and PR that may fix it:
https://github.com/python/cpython/pull/8011
6 years ago
mattandes 15c5dbcc20 Fix win_nssm credentials quoting (#48761)
* Fix win_nssm credentials quoting

Fix credential quoting for win_nssm after changes to the way nssm command is invoked in Ansible 2.7.1.

* Updating nssm command to update credentials to use Argv-ToString to properly escape password variable.

* Adding changelog fragment for fix of #48728.
6 years ago
Toshio Kuratomi d06cd869b8 Revert "fix cache 'update' method to be 'mapping' compatible"
This reverts commit 68301f890a.
6 years ago
Sloane Hertel a3e8917b73 [s3_bucket] Handle error paginating object versions when bucket does not exist (#49396) 6 years ago
Toshio Kuratomi a8fbfe1844 Warn if empty string is present in synchronize's rsync_opts 6 years ago
Sam Doran 6200d32c0d Use IndexError in exception (#49488) 6 years ago