Commit graph

1998 commits

Author SHA1 Message Date
Todd Lewis
640bf31f87
user - allow 'groups', 'append' with 'local' (#62134) 2020-02-06 12:32:44 -05:00
Andrew Klychkov
637eed5a5c
postgresql modules: fix sanity issues (#67046)
* postgresql modules: fix sanity issues

* add changelog

* fix changelog
2020-02-06 16:05:42 +01:00
Matt Clay
5e68bb3d93
Add code coverage target analysis to ansible-test. (#67141)
* Refactor coverage file enumeration.
* Relocate sanitize_filename function.
* Support sets when writing JSON files.
* Generalize setting of info_stderr mode.
* Split out coverage path checking.
* Split out collection regex logic.
* Improve sanitize_filename type hints and docs.
* Clean up coverage erase command.
* Fix docs and type hints for initialize_coverage.
* Update type hints on CoverageConfig.
* Split out logic for finding modules.
* Split out arc enumeration.
* Split out powershell coverage enumeration.
* Raise verbosity level of empty coverage warnings.
* Add code coverage target analysis to ansible-test.
2020-02-05 22:16:15 -08:00
James Cassell
b868f1c933
fix systemd use in container builds (#66062)
* systemd: unify "systemctl show" failure cases

* systemd: is-enabled to detect configured state

* systemd: is-enabled to detect masked status
2020-02-05 15:14:57 -05:00
Lihu Ben-Ezri-Ravin
48505af9d2
Remove filtering from edgeos_config module (#63362)
The edgeos_config module had a list of commands to filter out to avoid
load failures. This list had a single regular expression which caught
commands that attempted to set pre-encrypted passwords. This behavior is
undesirable for a few reasons.

* It's poorly documented. The documentation makes cryptic mention of a
  return value that some commands might be filtered out, but offers no
  explanation as to what they are or why.

* It's hard-coded. There's no way for the user to change or disable this
  functionality, rendering the commands caught by that expression
  completely unusable with the edgeos_config module.

* The obvious workaround is unsafe. The filter catches passwords that
  are already encrypted, but is perfectly fine letting the user set
  plain-text passwords. EdgeOS will encrypt them upon commit, but this
  module encourages unsafe handling of secrets up to that point.

* It's a security vulnerability if the user doesn't know about this
  behavior. While the module will warn if commands are filtered, the
  user won't know what got filtered out until after the fact, and may
  easily miss that warning if they are not vigilant. For something as
  sensitive as setting a password, it's not hard to imagine naive use of
  this module resulting in incorrect credentials being deployed.

* It provides no discernible benefit. Using the module without filtering
  does not result in load failures. If those commands are indeed harmful
  for some reason on (old?) versions of EdgeOS, it should be incumbent
  upon the user to be scrupulous in what commands they issue, rather
  than the module maintaining a blacklist of possible ways the user
  might misuse their own system.
2020-02-05 14:57:55 -05:00
Jørgen Lien Sellæg
43f93d275c
openssl_certificate: Selecting which acme directory to use to get certificate (#67109)
* "openssl_certificate - Add option for changing which ACME directory to use with acme-tiny. Set the default ACME directory to Let's Encrypt instead of using acme-tiny's default. (acme-tiny also uses Let's Encrypt at the time being, so no action should neccessary.)"
  * "openssl_certificate - Change the required version of acme-tiny to >= 4.0.0"
2020-02-05 14:10:27 -05:00
Ruediger Pluem
80c4b86abe
group - correctly determine if a local group exists. (#59772)
Fixes #58619
Add integration test
2020-02-05 12:34:41 -05:00
Mark Chappell
50eb2f6957
sns_topic: Retry on Topic 'NotFound' Exceptions when attempting to list subscriptions (#67089)
* sns_topic: Retry on Topic 'NotFound' Exceptions when attempting to list subscriptions

* add changelog
2020-02-05 12:16:07 -05:00
Mads Jensen
3dd4b3c8a3
Replaces a open/close to validate access with os.access in azure storageblob. (#65608) 2020-02-05 08:20:39 -05:00
Markus Bergholz
822077fefd
Asg mixed instance types (#67045)
* merge from origin pr 55067

* handle update existing asg with mixed-instance-policy

* fix documentation and append output

* update output documentation

* update documentation version added

* add integration test for mixed instance policy using launch template

* add changelog fragment

* Update lib/ansible/modules/cloud/amazon/ec2_asg.py

Co-Authored-By: Mark Chappell <mchappel@redhat.com>

* Update lib/ansible/modules/cloud/amazon/ec2_asg.py

Co-Authored-By: Mark Chappell <mchappel@redhat.com>

* Update lib/ansible/modules/cloud/amazon/ec2_asg.py

Co-Authored-By: Jill R <4121322+jillr@users.noreply.github.com>

* add warning about botocore version and add expand example documentation

* Update changelogs/fragments/67045-ec2_asg_mixed_instance_policy.yml

Co-Authored-By: Mark Chappell <mchappel@redhat.com>

* Update lib/ansible/modules/cloud/amazon/ec2_asg.py

Co-Authored-By: Mark Chappell <mchappel@redhat.com>

* Update lib/ansible/modules/cloud/amazon/ec2_asg.py

Co-Authored-By: Mark Chappell <mchappel@redhat.com>

* remove useless line

Co-authored-by: Yi-Tse Hong <yitse.hong@soocii.me>
Co-authored-by: Mark Chappell <mchappel@redhat.com>
Co-authored-by: Jill R <4121322+jillr@users.noreply.github.com>
2020-02-05 09:04:15 +01:00
James Cassell
1bb94ec92f
service_mgr: detect systemd, even offline (#66071)
* service_mgr: detect systemd, even offline

* service_mgr=systemd iff /sbin/init is symlink
2020-02-04 17:32:36 -05:00
James Cassell
fd954a9c5c
wait_for_connection: also retry interpreter discovery (#67040)
self._discovered_interpreter_key is None unless a previous iteration
has attempted discovery.  In that case, force re-discovery, as the
previous attempt certainly failed.
2020-02-04 11:40:09 -08:00
Matt Clay
f4a80bb600
Code cleanup and refactoring in ansible-test. (#67063)
* Code cleanup in ansible-test.
* Split out encoding functions.
* Consoldate loading of JSON files.
* Split out disk IO functions.
* Simplify file access.
* Add functions for opening files.
* Replace open calls with appropriate functions.
* Expose more types from typing module.
* Support writing compact JSON.
* Add verbosity argument to display.warning.
* Add changelog entry.
* Update files overlooked during rebase.
* Use `io.open` instead of `open`.
* Fix file opening for imp.load_module.
* Remove use of `r+` mode to access files.
* Add missing import.
* Fix httptester on Python 2.x.
* Clarify changelog fragment.
* Consolidate imports. Remove extra newlines.
* Fix indirect imports.
2020-02-04 11:21:53 -08:00
tavery321
994a6b0c5a
fixes ANSIBLE_DUPLICATE_YAML_DICT_KEY=error crashes (#66786)
* Fix #65366
2020-02-04 13:53:13 -05:00
Erwin Oegema
3b32f95fb3
user - warn if "append" is set but not "groups" (#65795)
This fixes people unknowingly changing the primary group rather than adding a secondary group.

* Add integration test
2020-02-04 12:35:05 -05:00
Felix Fontein
fe454d27a1
Fix removed_in_version to support honor suboptions (#66918)
* Add unit tests.
* Fix reporting for removed_in_version.
* Add changelog.
2020-02-04 10:14:55 -05:00
Felix Wong
8b2ead5870
add jittered backoff for elb (#66673) 2020-02-04 08:57:26 +01:00
Brian Scholer
fc7980af9a
Fix UNC path support in the powershell shell plugin (#66604)
* Fix UNC path joining in the powershell shell plugin, add test

* Remove testy bits and a redundant line

* Fix style nits

* Update to use os.ntpath

* Add changelog for #66604
2020-02-04 16:34:11 +10:00
Felix Fontein
23b2bb4f4d
docker_container: change behavior for one-port container ranges to be same as docker CLI (#66382)
* Adjust docker_container behavior for one-port container ranges to be similar to docker CLI.

* Add changelog.

* Add documented examples for ports:.
2020-02-03 23:27:40 +01:00
Felix Fontein
5c1a3a3ac2
docker_container and docker_swarm_service: allow to actually disable healthcheck of image (#66599)
* Allow to actually disable healthcheck of image.

* Add changelog.
2020-02-03 13:13:17 -05:00
Felix Fontein
a0e5e2e4c5
openssl_publickey: forgot to pass backend (#67036)
* Forgot to pass backend.

* Add changelog.

* Pass on backend from get_fingerprint.

* Handle cryptography backend in get_fingerprint.
2020-02-03 06:18:19 +01:00
Simon Dodsley
b1a8bded3f
Remove deprecated parameter for 2.10 in purefb_fs (#67026) 2020-02-02 15:30:01 +01:00
Felix Fontein
8f10db8552
Do fail instead of regenerate for password protected and invalid keys. (#65638) 2020-02-02 07:54:28 -05:00
Felix Fontein
d6fb9da8ed
openssl_* modules: allow direct input and output for some files (#65400)
* Allow to return generated object.

* Use slurp module instead of file lookup + b64encode.

* Rename return_xxx_content -> return_content.
2020-02-02 12:42:52 +01:00
Klaus Frank
14b1febf64
Fix pacman: "IndexError: list index out of range" #63077 (#65750)
* Fix #63077

If the package is already installed the stdout is not as expected by this function. Either remove `--needed` or just noop if we detect pacman returning. We cannot match the stdout string, as that is most likely localized.

```
[root@archBook user]# /usr/bin/pacman --upgrade --noconfirm --noprogressbar --needed  /srv/aur/src/i3cat-git/i3cat-git-r38.c6d29dd-1-x86_64.pkg.tar.xz
loading packages...
warning: i3cat-git-r38.c6d29dd-1 is up to date -- skipping
 there is nothing to do
```

* Add comment

Add comment

* Add changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-02-01 14:37:27 +01:00
Andrew Klychkov
3baea92ec9
Bugfix of 54239: mysql_variables not supporting variables name with dot (#66806)
* Bugfix of 54239: mysql_variables not supporting variables name with dot

* add changelog

* add CI tests
2020-02-01 12:39:52 +05:30
Mark Chappell
919a9e33e8
Minor AWS argument checks (required_if / mutually_exclusive) fixups (#66966)
* aws_netapp_cvs_snapshots - minor required_if fixup (state must be set if state=present)

* ec2 - fix typo in mutually_exclusive definition

* rds_instance: fix typo in mutually_exclusive restore_to_time should be restore_time - currently throws a boto error
2020-01-31 22:17:46 +01:00
Simon Dodsley
26175178ee
Fix user_agent string not getting set (#66914) 2020-01-31 15:50:53 -05:00
Sam Doran
9db0fb785d
Add collections path option to ansible-galaxy (#66969)
Some common code needed for 'collection list' and 'collection validate'
2020-01-31 14:27:54 -06:00
Andrew Klychkov
16ebeda86d
Bugfix of 66974: mysql_user doesnt support privileges with underscore (#66995)
* Bugfix of 66974: mysql_user doesnt support privileges with underscore

* add changelog

* add seealso
2020-01-31 20:44:03 +01:00
Stefan Horning
aad286b403
Make cloudfront_info work with Python3 … (#66695)
* Make cloudfront_info work with Python3 by using dict.update(dict) instead of dict += dict.

* Added changelog fragment for cloudfront_info fix
2020-01-31 14:37:36 -05:00
Andrew Klychkov
54520c4685
mysql_user: priv parameter can also be a dictionary (#66801)
* mysql_user: add priv_dict parameter

* add changelog

* priv can be string or dictionary

* fix example
2020-01-31 16:32:31 +01:00
Mark Chappell
813091cf94
Migrate ec2_vol_info to AnsibleAWSModule (#66979)
* Migrate ec2_vol_info to AnsibleAWSModule

* Enable ec2_vol_info tests

* Add changelog

* Update lib/ansible/modules/cloud/amazon/ec2_vol_info.py

Co-Authored-By: Sloane Hertel <shertel@redhat.com>
2020-01-31 09:55:10 -05:00
Jordan Borean
2a9ec8975f
win_unzip - LiteralPath fix (#66972)
* win_unzip - LiteralPath fix

* Fix up Python sanity issues
2020-01-31 12:59:46 +10:00
Matt Clay
d584584474 Reorganize ansible-test coverage code.
This change moves all code for the `ansible-test coverage` command into the `coverage` directory.

Each subcommand is split into a separate file.

Only minor spelling changes were made aside from code relocation.
2020-01-30 14:41:21 -08:00
Mark Chappell
5d4d9d40af
ansible-test - Add 'get' to the list of bad choices for state (#66921)
* ansible-test - Add 'get' to the list of bad choices for state

* Changelog fragment
2020-01-30 22:38:47 +01:00
Sam Doran
5112feeace
Make get_bin_path() always raise an exception (#56813)
This makes it behave in a more idiomatic way

* Fix bug in Darwin facts for free memory
    If the vm_stat command is not found, fact gathering would fail with an unhelpful 
    error message. Handle this gracefully and return a default value for free memory.

* Add unit tests
2020-01-30 12:54:25 -05:00
Abhijeet Kasurde
2728c2476e
docs: Fixed "Edit on GitHub" link for plugin, cli (#66745)
Fixed sphinx theme to navigate "Edit on Github" link to locate correct
plugin, cli source in GitHub repo.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-30 10:55:46 -05:00
Nathaniel Case
bf65e7a3f6
nxos_facts: Don't fail if faninfo isn't reported (#66866) 2020-01-30 10:23:21 -05:00
Dusan Matejka
e3190adcbb
zabbix_host - added support for usermacros and tags (#66777) 2020-01-30 08:32:47 -05:00
Felix Fontein
5fdc9a61f0
docker_container: pass volumes only for anonymous volumes (#66600)
* Simplify code.

* Only pass anonymous volumes.

* Add changelog and update porting guide.

* Add integration tests.
2020-01-30 14:08:25 +01:00
Dusan Matejka
57805b7def
zabbix_proxy interface option documentation and argspec fixes (#66837)
* zabbix_proxy interface option documentation and argspec fixes

* Update changelogs/fragments/66837-zabbix-proxy-interface.yml

Co-Authored-By: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-01-30 14:06:44 +01:00
Matt Clay
49d8d5ae33 Fix ansible-test tar format handling. 2020-01-29 20:31:54 -08:00
Yanis Guenane
4fd2dce7f3
Testing: Add support for AIX platform (#65802) 2020-01-29 15:56:51 -08:00
rule88
6a1f82f174
url lookup - add options to match those in urls.py (#64892)
Add 'force_basic_auth' option
By default "force_basic_auth" option is set to False, with this adjustment it is up to the user if it wants to enforce basic authentication.
2020-01-29 16:45:25 -05:00
Mark Chappell
1156962cde
Forbid state=(list|info) in modules via ansible-test sanity check
PR #66898

This change introduces a new sanity check with code
`parameter-state-invalid-choice` in the `ansible-test sanity`
validator. It enforces modules not to support `list` or `info`
as their `state`.

Co-Authored-By: Sviatoslav Sydorenko <webknjaz@redhat.com>
Co-Authored-By: Felix Fontein <felix@fontein.de>
2020-01-29 21:06:36 +01:00
Jiri Hnidek
6f1bb37feb
When no pool quantity is set, then do not set quantity to 1 (#66807)
* Fixes #66478
* When no quantity is set, then candlepin server usually uses
  default value 1. When more quantities are required, then
  candlepin server can automatically choose correct minimal
  value.
2020-01-29 12:10:47 -05:00
Sam Doran
9276dd2007
file - change warning to error (#66671)
When 'src' is specified without 'state', raise an exception
2020-01-29 10:51:34 -05:00
Andrew Klychkov
308723c3ca
postgresql_idx: revert PR for 64138 (#66889) 2020-01-29 14:12:34 +00:00
Matt Clay
3c3cf50e7a Fix ansible-test coverage of ansible-connection. 2020-01-28 23:47:07 -08:00
Matt Clay
21069c84d9 Fix ansible-test color ls logic. 2020-01-28 17:48:54 -08:00
Matt Clay
428aaf7e65 Keep SSH authorized keys in ansible-test setup. 2020-01-28 17:48:54 -08:00
Matt Clay
efd2dd8929 Add more ansible-test args to delegation config. 2020-01-28 17:48:54 -08:00
Matt Clay
ee50792416 Add a --no-pip-check option to ansible-test. 2020-01-28 17:48:54 -08:00
Mark Chappell
35652ca788 Add tests to make sure that the documented 'elements' matches that defined in argument_spec (#66385)
* Add tests to make sure that the documented 'elements' matches that defined in argument_spec

* Mass-add test/sanity/ignore.txt
2020-01-28 12:33:03 -05:00
Sam Doran
3461c682c3
Add mechanism for storing warnings and deprecations outside of AnsibleModule (#58993)
* Move warn() and deprecate() methods out of basic.py
* Use _global_warnings and _global_deprications and create accessor functions
    - This lays the foundation for future functions being moved outside of AnsibleModule
       that need an interface to warnings and deprecations without modifying them.
* Add unit tests for new warn and deprecate functions
2020-01-28 12:12:14 -05:00
Sam Doran
cc2376b782 include_vars - fix stack trace when run ad-hoc with dirs parameter (#66581)
Add integration test

There are a number of other parameters that result in stack traces as well when this module is used ad-hoc. I'm not sure if we're interested in fixing them all since this module isn't meant to be run ad-hoc.
2020-01-28 11:50:34 -05:00
Martin Krizek
365f2aaed1 get_url: remove deprecated headers string format (#66649)
Fixes #61891
2020-01-28 10:39:40 -05:00
Mark Chappell
5ff899662d Add sanity test to require elements entry when argument type=list (#66386)
* Require elements entry for lists

* Bulk add initial test/sanity/ignore.txt
2020-01-28 10:23:22 -05:00
René Moser
78e666dd39
vultr: improve handling of dicontinued plans (#66792)
* vultr: improve handling of dicontinued plans

* add changelog
2020-01-28 10:46:17 +01:00
digi
5409904c35 vmware_cluster_facts: adds list of host in cluster (#61006) 2020-01-28 11:43:46 +05:30
sky-joker
65aedc5d4a VMware: Change node_wwn and port_wwn for FC HBA to hexadecimal value
Fixes: #63045
2020-01-28 09:46:29 +05:30
Matt Clay
965854fbd2
Add constraints for Jinja2 on Python 2.6. (#66826)
* Add constraint for Jinja2 on Python 2.6.

* Fix constraint in inventory_aws_conformance test.

* Add constrraints for template_jinja2_latest test.
2020-01-27 14:01:34 -08:00
Martin Krizek
4ca0c7f116 Fix case sensitivity for lookup() (#66521)
This brings consistency to lookup(), with_ and ansible-doc.

Fixes #66464

* Add a porting guide entry
2020-01-27 15:09:45 -05:00
Gonéri Le Bouder
3ce6440515 vmware_export_ovf: increase default timeout
I consistently reach a timeout with the current (10s) timeout. This
commit increases the default value to 30s, this should simplify the life
of our users.
Also, the documentation was incorrect. The value is in second, not minute.
2020-01-27 13:57:01 -05:00
Felix Fontein
8cff585891
Schema validation for argument_spec (#65747)
* Start of schema for argument_spec

* Add changelog.

* Remove superfluous import.

* Update ignore.txt

Co-authored-by: Matt Martz <matt@sivel.net>
2020-01-27 17:26:46 +01:00
Markus Fischbacher
055cf91d02 zabbix_template - enable new update rule to delete missing linked templates (#66747)
* enable new update rule to delete missing linked templates

New update rule is available from 4.0.16 and 4.4.4 up. Add check for version and enable new update rule.

fixes #66720

* adding fragment file

* Update zabbix_template.py

* Update zabbix_template.py
2020-01-27 09:20:45 -05:00
Andrew Klychkov
70017e2679 postgresql_db: add dump_extra_args parameter (#66717)
* postgresql_db: add dump_extra_args parameter

* add changelog

* fix doc

* fix example
2020-01-24 13:32:54 -05:00
Roman Haefeli
4d1e21bf18 mysql_user: make sure current_pass_hash is a string before using it in comparison (#64059)
* make sure current_pass_hash is a string before using it in comparison

* add changelogs/fragments file

* fix changelogs/fragments file: it is actually a bugfix, not a minor change
2020-01-24 13:32:15 -05:00
Sam Doran
8e195adda5
display - remove extra new line after warning message (#65199)
Add unit tests for display
2020-01-24 12:10:04 -05:00
dexpl
1152774f92 git - add an 'archive_prefix' option (#66067)
Add integration tests for new option
2020-01-24 09:42:47 -05:00
Pilou
bbbdc1c25c throttle: fix linear based strategies (#65422)
* throttle tests: fix detection of parallel execution

The test wasn't able to detect if too many workers were running.

On my laptop:
- without this change, the 'throttle' target takes ~20 seconds
- with this change, the 'throttle' target takes ~70 seconds
- 1 second isn't long enough to encounter the issue

* Fix throttle test when strategy is 'free' based

'free' strategy allows multiple tasks to be executed in parallel: use
one 'throttledir' per task.

Use 'linear' strategy with a dedicated play for cleanup/setup tasks

* throttle: reset worker idx before queuing a new task

* TestStrategyBase: define task.throttle

otherwise '1' will be used instead of the default value due to the
following expression being equal to '1':

    int(templar.template(task_mock.throttle))

Co-authored-by: James Cammarata <jimi@sngx.net>
2020-01-24 08:18:08 -06:00
Matt Clay
8b63da7b43 Fix ansible-test egg-info directory detection. 2020-01-23 13:21:15 -08:00
René Moser
9e8fb5b7f5 galaxy: fix AttributeError on empty requirements.yml (#66726)
* galaxy: fix AttributeError on empty requirements.yml

* add changelog
2020-01-24 06:06:44 +10:00
Xyon
5c721e8a47 Add new configuration parameter to make Windows async startup timeout configurable (#66670)
* Add new configuration parameter to make this timeout configurable

* Rename keys to be more correct and reformat exception message for whitespace handling

* Rename config away from default prefix. Add vars element and associated changes to support.

* Update 65001-allow_configuring_async_startup_timeout.yml

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-01-24 06:04:52 +10:00
Sato Kenta
a4b59d0213 pamd: Fix AttributeError when removing the first or last rule (#66398) 2020-01-23 14:08:42 -05:00
Andrew Klychkov
72fbed2c61 postgresql_user: add comment parameter (#66711)
* postgresql_user: add comment parameter

* add changelog

* fix CI
2020-01-23 14:34:50 +00:00
Markus Fischbacher
e646bd08e1 zabbix_template - fixing errors linked templates and dump/imports (#66463)
* Fixing errors on empty linked templates

fixes #66417

Line 409 fixes KeyError if existing template has no linked templates - as Zabbix API isn't returning an empty array either.
Line 417 is needed to mark as changed if new/modified template has no linked but existing one has.
Line 442 is needed to actually update even if link_templates was None.

* decode parsed xml root

fixes #66466

Line 533: without .decode() the ET.tostring on python3 returns byte-like object

* Create 66463-zabbix_template-fix-error-linktemplate-and-importdump.yml

* Update changelogs/fragments/66463-zabbix_template-fix-error-linktemplate-and-importdump.yml

Co-Authored-By: Dusan Matejka <D3DeFi@users.noreply.github.com>

* Update changelogs/fragments/66463-zabbix_template-fix-error-linktemplate-and-importdump.yml

Co-Authored-By: Dusan Matejka <D3DeFi@users.noreply.github.com>

Co-authored-by: Dusan Matejka <D3DeFi@users.noreply.github.com>
2020-01-23 08:22:19 -05:00
Andrew Klychkov
fabb2eb555 mysql_db: add skip_lock_tables option (#66688)
* mysql_db: add skip_lock_tables option

* add changelog fragment
2020-01-22 20:19:49 +01:00
Sam Doran
a412e4d9fd Add validate_collection_path function (#66441)
* Add validate_collection_path function

Utility function for ensuring a collection target ends with 'ansible_collection'

* Fix bad syntax

* Correct docstring
2020-01-22 10:46:41 -05:00
Martin Krizek
ec371eb227 Set HostVars._variable_manager's attrs (#65508)
When HostVars are part of the data that goes through (de)serialization
when being passed from a worker process to the main process, its
variable manager reference loses some of its attributes due to the
implementation of __getstate__ and __setstate__ (perf utilization).
Since HostVars already has those attributes, use __setstate__ to assign
them.

Fixes #65365
2020-01-22 05:57:09 -05:00
Matt Clay
ebf21bb48d Fix ansible-test inventory delegation. 2020-01-21 22:37:14 -08:00
Matt Clay
934d6b235b Add --venv-system-site-packages to ansible-test. 2020-01-21 17:32:29 -08:00
Felix Fontein
c58d8ed1f5 Improve deprecate sanity check; remove deprecated features which should have been removed for 2.9 (#65745)
* Update deprecation check.

* Remove support for check_invalid_arguments.
2020-01-21 16:58:26 -05:00
Sam Doran
2b7393141f
reboot - add boot_time_command parameter (#62680)
Allow the built in commands for checking boot time to be overridden. This is mainly for containers and other odd systems where it would add too much complexity to the plugin code to try and discern the correct command to use.
2020-01-21 13:42:32 -05:00
Sam Doran
617fbad743
synchronize - fix password authentication (#66542)
On Python 2, leave all fds open since there is no mechanism to close specific fds with subprocess.Popen() on Python 2

Add unit tests.

Co-authored-by: Matt Martz <matt@sivel.net>
2020-01-21 10:43:56 -05:00
Abhijeet Kasurde
14ae3ba8c0
Fixed argument spec for multiple modules - Part II (#65497)
This change contains fixes for argument spec and respective datatypes.
Created separate PR since these changes might alter the behavior of these modules.
Will need shipit from individual module owner(s).

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-21 11:37:38 +05:30
Adam Miller
22fe22f796 yum - fix bug where enablerepo is not honored when disablerepo all (#66557)
Fixes #66549

The inefficiency improvement
https://github.com/ansible/ansible/pull/63713 introduced a bug where
`enablerepo` was not being honored if combined with
`disablerepo="*"`. This fixes that issue.

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-01-20 14:26:36 -05:00
sky-joker
1befb52321 VMware: add properties option to vmware_datastore_info module (#62940)
* add_properties_option_to_vmware_datastore_info
* fix document indent error
* add changelog file for vmware_datastore_info
2020-01-20 13:47:13 +05:30
Adam Miller
077a8b4898 podman - fix rootless container copy no pause (#66583)
Fixes #66263

Signed-off-by: Adam Miller <admiller@redhat.com>
2020-01-17 16:41:10 -05:00
Mohammadreza Abdoli
7ae5331218 update ismount() to match upstream from cPython (#64586) 2020-01-17 16:32:14 -05:00
Mario Lenz
864a3fd59d VMware: Add advanced settings to vmware_cluster_drs (#66233)
* VMware: Add advanced settings to vmware_cluster_drs

* Add DRS advcanced settings example
2020-01-17 16:23:19 -05:00
Sam Doran
9b7198d25e
file - change _diff_peek type in argument_spec (#60428)
* Add integration tests
* Handle error in _get_diff_data()
* Change to warning rather than error
* Also change failure to warning in assemble action plugin
2020-01-17 16:02:28 -05:00
Sam Doran
9a51dff0b1
Rename private function (#66577)
Make find_existing_collections() a public function since it is being used across mulitple files now to support listing and verifying collections
2020-01-17 15:27:15 -05:00
Florian Apolloner
a7e4479d01 Fix DNF idempotency. (#66209) 2020-01-17 11:22:06 -05:00
Abhijeet Kasurde
84b68aa05f gitlab_project_variable: Remove sensitive information (#66556)
Redact GitLab Project variables which might include sensetive information
such as password, api_keys and other project related details.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-17 01:42:15 -05:00
Sam Doran
1f340721a7 ansible-galaxy - add "--token" command line argument (#66376) 2020-01-16 12:51:21 -08:00
Andreas Calminder
3b764c6dcb Add diff and check_mode support to os_server (#62206)
* don't mix " and '

* rename functions that perform changes

* add diff, reorganize _present/_absent functions

* update tests to match function reorg

* add result to _exit_hostvars and removal of possibly sensitive information

* shallow copy dict for proper diff, add check_mode

* set check_mode to False for unit tests

* move _parse_meta back to it's original place

* use get_openstack_vars for diff when not in check_mode

* add changelog fragment
2020-01-16 10:39:54 +01:00
Jordan Borean
e459eac565
Use UTF-8 without a BOM for win coverage (#66510) 2020-01-16 09:52:05 +10:00
Patrick Easters
d5c5cb5a17 podman_image: Use provided credentials when pulling image (#66372)
* Use credentials when pulling from a remote registry
2020-01-15 12:47:12 -05:00
Sloane Hertel
1cb634a3ab Add a metadata property for CollectionRequirement (#66370)
* Add a metadata property for CollectionRequirement so the _metadata attribute doesn't need to be accessed directly

* changelog
2020-01-15 12:40:26 -05:00
Abhijeet Kasurde
afb71c14bd
VMware: Use existing DVPG network in vmware_guest_network (#65994)
* Handle all cases of networks

Fixes: #65968

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-15 21:56:19 +05:30
Abhijeet Kasurde
257ac9d175
Fortios: Correct underscore_to_hyphen API (#66119)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-15 10:35:57 +05:30
Ric de France
62991a8bdd terraform: Remove line that is suppressing output being shown (#66322)
* remove the line that is suppressing the output being shown when running
terraform from ansible
* Address #56934 and #57044
* added changelog for bug fix for missing terraform output

Co-authored-by: Adam <adam.lemanski@gmail.com>
2020-01-15 09:42:58 +05:30
Sloane Hertel
1b3ca349eb
RoleRequirement - Include stderr in the error message (#66006)
* RoleRequirement - Include stderr in the error message if there's a non-0 return code

* Don't try to concatenate str and bytes

Co-Authored-By: Sam Doran <sdoran@redhat.com>
2020-01-14 09:46:23 -05:00
Jordan Borean
6f04f87a13
Deprecate Windows 2008, and 2008 R2 (#66257)
* Deprecate Windows 2008, and 2008 R2

* Remove shippable nodes

* Update windows_faq.rst

Be less specific about 2008/R2 timeframes

* Update setup.ps1

tweak warning text

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-01-14 11:22:39 +10:00
Piotr Stawarski
9a1329153e ec2_vol module filtering bug (#65960)
* Update ec2_vol.py

When `name` is specified, it ignores `zone` filter. That is you could not have same tag:Name in different zones.

* Add changelog fragment
2020-01-14 11:09:06 +10:00
Matt Clay
3db1ac4f56 Ignore warnings in ansible-test environment check. 2020-01-13 16:16:55 -08:00
Matt Clay
51e5b714e0
Add test constraint for setuptools. (#66426)
* Add test constraint for setuptools.

* Update pip test to work on centos6 container.
2020-01-13 13:09:33 -08:00
Nathaniel Case
3a2257c45c
net_facts modules: Don't warn about defaults changing if they're not being used (#66270) 2020-01-13 11:36:01 -05:00
Ganesh Nalawade
654b9e2754
Add collection support with local for supported network platforms (#66302)
* Add collection support with local for supported network platforms

*  The legacy behavior of network action plugins using persistent
   the framework is to override the connection=local with the actual connection type (network_cli/netconf/httpapi) based
   on the value of transport option in provider.
*  After the actual connection plugin is identified try to load it from
   `ansible.netcommon` collection, if it fails load it from ansible
   core. This is done to work with Ansible 2.10 and also maintain backward compatibility for
   Ansible 2.9 version to ensure it works with network collections.
*  To support this need to pass collection_list value to connection
   plugins. As in case of connection=local it loads `persistent`
   connection within action plugin which in turn invokes `network_cli`
   or `netconf` connection. Similarly `network_cli` connection plugin invokes
   `terminal` and `cliconf plugins and `netconf` connection plugin invokes `netconf`
   `plugins` based on value on `ansible_network_os`.
*  Add deprecation warning for connection=local support and
   provider support for applicable platforms

* Fix CI failures
2020-01-13 09:49:55 +05:30
Felix Fontein
c380b18dcf
openssl_* modules: allow direct input for some files (#66384)
* Allow to not read content from file.

* Allow to feed content directly into _info modules.

* Allow to feed non-primary content into openssl_certificate, openssl_csr and openssl_publickey.

* Rename changelog.
2020-01-12 19:12:33 +01:00
Andrew Klychkov
515c4a7e2c Bugfix of 65367: postgresql_query doesn't support non-ASCII characters in SQL files with Python3 (#66331)
* Bugfix of 65367: postgresql_query doesn't support non-ASCII characters in SQL files with Python3

* add changelog

* fix

* change changelog fragment, add example
2020-01-11 15:19:55 +01:00
Nathaniel Case
0a3a81bd12
Persistent connections: These timeouts seem unused (#66267)
* These timeouts seem unused

* Add changelog
2020-01-10 23:09:21 -05:00
Bill Dodd
5f966ef664 Update deprecation version and porting guide for resource_id option (#66060)
* update deprecation version and porting guide for resource_id option

* add changelog fragment
2020-01-10 16:37:53 -06:00
Ganesh Nalawade
0d85ab1fe3 Add collection support for network platform agnostic modules (#66342)
*  Refactor net_base action plugin to invoke platform
   action plugin with implementation module name updated
   in the new task copy.
2020-01-10 12:42:53 -05:00
Jordan Borean
c92b538cc5
WebRequest - remove generically named aliases from util (#66325)
* WebRequest - remove generically named aliases from util

* Fix location of deprecated aliases key
2020-01-10 13:01:26 +10:00
Paul Belanger
7a7f70612a
Revert "Fix net_put module text file issue (#66065)" (#66328)
This PR didn't properly run testing for network jobs. As a result it has
broken jobs for ios and junos.

This reverts commit fa66813696.
2020-01-09 21:51:59 -05:00
Matt Clay
3c0a836004 Add changelog entry for PR #66321 2020-01-09 15:26:14 -08:00
Jordan Borean
595ab62ab8
Ansible.Basic - Added deprecated_aliases (#66323) 2020-01-10 09:13:13 +10:00
kaorihinata
3ca4580cb4 Allow no_log=False to silence the no_log warnings for module parameters (#64733)
As AnsibleModule._log_invocation is currently implemented, any parameter
with a name that matches PASSWORD_MATCH triggers the no_log warning as a
precaution against parameters that may contain sensitive data, but have not
been marked as sensitive by the module author.

This patch would allow module authors to explicitly mark the aforementioned
parameters as not sensitive thereby bypassing an erroneous warning message,
while still catching parameters which have not been marked at all by the
author.

Adds tests for various no_log states including True, False, and None (as
extracted by AnsibleModule._log_invocation) when applied to an argument with
a name that matches PASSWORD_MATCH.

Fixes: #49465 #64656
2020-01-09 16:47:57 -05:00
Jordan Borean
d3427bb860
Make sure warnings are printed during fact gathering (#66258) 2020-01-10 06:16:20 +10:00
Jordan Borean
aba8f12495 ansible-galaxy ignore empty server_list (#65986)
* ansible-galaxy ignore empty server_list
2020-01-09 14:24:36 -05:00
Ganesh Nalawade
fa66813696
Fix net_put module text file issue (#66065)
*  Modify the parent class for net_put and net_get
   module to refer from `ActionModule` class in
   network.py action plugin which contains the
   common code for network plugins.
*  Replace `_handle_template` with `_handle_src_option`
   function name which is defined in common class.
2020-01-09 18:42:00 +05:30
James Cassell
963b8249ec setup: more reliably detect container environment (#66183)
* virtual facts: /proc/<pid>/environ is NULL-separated
* non-empty "container" env is a guest container
* This is consistent with `systemd-detect-virt --container`
* fact utils: line_sep option: specify delim for split
* allow using the same function to split null-delimited objects
2020-01-09 11:51:45 +05:30
Markus Fischbacher
b05529c5a3 adding proxy_address field for active proxies (#66247)
Since 4.0.0 there is a field proxy_address for limiting proxy requests.

Official Docs: "Proxy address	If specified then active proxy requests are only accepted from this list of comma-delimited IP addresses, optionally in CIDR notation, or DNS names of active Zabbix proxy.
This field is only available if an active proxy is selected in the Proxy mode field. Macros are not supported.
This option is supported since Zabbix 4.0.0."
updated documentation/help
fixed test issues
fixed version_added not a string
fix suggestions by D3DeFi


added changelog fragment
applied D3DeFi suggestions

way cleaner and better readable
2020-01-08 19:25:10 -05:00
Marc Hörsken
53e405dd42 Fix 'CyberarkPassword' object has no attribute 'delimiter' (#66268)
This is a very small follow up to PR #59500
2020-01-08 15:36:41 -05:00
kaorihinata
40394ed671 Update user module to support no_log=False. (#66219)
Updates the user module to support pull request #64733. Neither the
update_password or password_lock field contains sensitive information, so
mark them as such.
2020-01-07 11:26:55 -05:00
Abhijeet Kasurde
469f104ec2 loop: simplify dict2items example in docs (#66235)
* Added a simple example to explain "dict2items" filters for better understading.

Fixes: #65505

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-07 10:32:46 -05:00
Matt Martz
f8654de851
Ensure that data within a tuple is marked as unsafe (#65918)
* Use is_sequence, and Mapping throughout, add support for tuples. Fixes #65722

* Address tests

* Remove unused import

* Add changelog

* Add docstring for clarity

* Argh, linting fix

* Not chasing this rabbit

* wrap_var doesn't return a ref to the original item

* no ref tests

* Remove unused import
2020-01-07 08:41:37 -06:00
njferrant
bac2e02900 vmware_guest: exclude dvswitch_name from guest os customization (#65997)
- exclude dvswitch_name from guest os customization
- add changelog fragment for ansible PR#65997
2020-01-06 16:41:02 -05:00
Marcel
02c126f5ee docker_container - #65993 - update restart policy (restart policy & restart retries) wit… (#66192)
* #65993 - update restart policy (restart policy & restart retries) without restarting the container

* - proper indentation on the continuation-line
- set restart_policy to the correct value independent from the api version

* - move restart_policy definitions into the if block
- add a new variable for the restart_policy configuration value

* add changelog fragment

* typo; minus -> underscore

* rename changelog fragment to contain the correct module name

* rename restart_policy_config_value to just restart_policy and refer to the correct dict values
2020-01-06 20:49:48 +01:00
Mads Jensen
ec34235e2e Use a context handler for file handling in paramiko_ssh.Connection. (#65624) 2020-01-06 13:09:57 -05:00
Anthony Bourguignon
d3e9ef3c35 add a path_join filter which joins path components (#62713) 2020-01-06 11:56:40 -05:00
Rémi REY
7888eafb82 Fix callback set_options issue with collections (#66128)
Fixes: #66127
2020-01-06 11:32:36 -05:00
Thomas Hucke
d56d0f97e3 Add support for OSCM-distribution in hostname module (#66190)
Fixes: #66189

Added subclass to detect the new distribution OSMC
2020-01-05 12:37:39 +05:30
Felix Fontein
b0b00b555f
docker_container: configure removal wait timeout (#66144)
* Add support for timeout while waiting for state.

* Allow to limit removal wait time.

* Add changelog.

* Forgot version_added.

* Add some check mode tests.

* Use removal_wait_timeout in tests.
2020-01-04 17:56:59 +01:00
Abhijeet Kasurde
9a13d56b26
Misc typo fixes (#66120)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-04 21:13:30 +05:30
Emerson "Duke" Almeida
865e767d39 PostgreSQL : Create unique index (#66157)
* Postgresql : Create unique index

TODO:

* fix syntax error

* add version added

* adding specs and improve doc

* add changelog

* Update lib/ansible/modules/database/postgresql/postgresql_idx.py

* Update lib/ansible/modules/database/postgresql/postgresql_idx.py

* remove check about concurrent

* Apply suggestions from code review
2020-01-04 10:38:17 +00:00
Andrew Klychkov
4ecc9da244 mysql_db: add master_data parameter (#66048)
* mysql_db: add master_data parameter

* add changelog

* fix CI
2020-01-04 10:37:40 +00:00
Andrew Klychkov
b48366c2fe postgresql modules: use query parameters with cursor objects (#65862)
* postgresql modules: use query parameters with cursor objects

* add changelog fragment

* fix typo in changelog fragment
2020-01-04 05:18:45 -05:00
Hannes Ljungberg
f31b8e08b2 docker_swarm_service: Fix parsing of Healthcheck.StartPeriod (#66151)
* Parse Healthcheck.StartPeriod properly

* Add changelog fragment

* Use proper markup in changelog

Co-Authored-By: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-01-02 09:23:36 -05:00
Felix Fontein
4df5bdb11e
docker_container: wait for removal if removal is in process (#65854)
* Allow to inspect containers directly.

* Wait for containers to be removed before recreating them.

* Also wait for containers to be removed before creating them.

* Add changelog.
2019-12-29 23:16:32 +01:00
Felix Fontein
17ef253ad1
docker_network: fix multiple subnet (of same IP version) idempotence (#65839)
* Fix multiple subnet (of same IP version) idempotence for docker_network.

* Add changelog.

* Unit tests no longer make sense, since the part of the code they test has been removed.

* Re-add CIDR validation. Move it to better position (module setup instead of idempotence check).

* Update changelog.

* Only run new tests on VM test images.

* Actually do what is documented. Especially since an empty object is a valid value for aux_addresses.
2019-12-29 23:16:17 +01:00
Andreas Olsson
b733178bac nsupdate: Use provided TSIG key for all queries (#63174)
In addition to signing update queries also use the TSIG key to sign
lookup queries. By doing that we allow a hidden master to not only to
be looked down network wise, but also TSIG wise.

A bonus benefit of threating update queries and lookup queries more
the same is that will allow for all queries to be refactored into a
shared helper method. Currently we have a bit too much duplicated code
within the module.
2019-12-27 16:02:24 +01:00
pypypyo14
c35a7b88d4 Homebrew: some functions ignored check_mode option (#65387)
update_homebrew and upgrade_all now support check_mode

Fixes: #65352
2019-12-27 10:45:34 +05:30
Abhay Kadam
2fa8f9cfd8 Fix env lookup plugin error on utf8 values (#65541)
This commit fixes issue #65297.

The env lookup plugin used to fail when environment variable value
contained any UTF-8 characters (e.g., δ, ζ).
2019-12-25 17:24:38 +05:30
Abhijeet Kasurde
683c467609
Check if task file is specified for import_tasks (#57572)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-12-24 10:26:32 +05:30
Abhijeet Kasurde
34acabd70a
VMware: Handle NoneType in vmware_vmkernel_info (#65834)
Check for virtualNicManager in Esxi host system before accessing properties in vmware_vmkernel_info.

Fixes: #62772

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-12-24 09:38:38 +05:30
Lénaïc Huard
10b6038e21 Fix pacman stdout parsing in the Ansible module (#65238)
pacman output is localized and the Ansible module is parsing its output.
So, we need to force the locale.
Add changelog fragment

Fixes #65237
2019-12-23 14:23:46 +05:30