Commit Graph

5050 Commits (e652706d63ffa0784f451ae4d12349b720de68a0)

Author SHA1 Message Date
Daniel Mellado e652706d63
Add missing options for GRE interface (#69426)
This commit adds some missing options related to gre interfaces on
junos_interfaces module.

Cherry-picked from https://github.com/ansible-collections/junipernetworks.junos/pull/37
Fixes: https://github.com/ansible-collections/junipernetworks.junos/issues/36

Signed-off-by: Daniel Mellado <dmellado@redhat.com>
5 years ago
Martin Krizek 54d96eae8c
Ensure --version works with non-ascii project path (#66624) (#69789)
Fixes #66617

(cherry picked from commit 3606dcfe65)
5 years ago
Abhijeet Kasurde 153de5ee49
[2.9] podman_image: use correct option for remove_signatures flag (#68979)
podman_image module uses 'podman push' command with wrong
flag '--remove_signatures' instead of '--remove-signatures'

This patch fixes the given typo.

Fixes: ansible/ansible#67965

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Felix Fontein cf244c094a
[2.9] Prevent Ansible 2.9 to choke on collections using deprecation by date or collection_name for deprecation calls (#69935)
* Prevent Ansible 2.9 to choke on collections using deprecation by date or collection_name for deprecation calls.

* Add changelog fragment.

* Fix YAML.

* Improve C# compatibility.

* Add tests for AnsibleModule.

* Fix var name.

* Fix type.

* Update C# code.

* Show deprecation warning if removed_at_date is used for Python modules.

* Update changelogs/fragments/69935-2.10-deprecation-support.yml

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>

* Prevent crash of validate-modules if 'removed_in' is not in 'deprecated'.

Co-authored-by: Alicia Cozine <879121+acozine@users.noreply.github.com>
5 years ago
Abhijeet Kasurde 3e36350309
[2.9] Handle disabled service units (#69804)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 723a904f4e)
5 years ago
Sam Doran 6abe3a889d
[stable-2.9] file - return 'state': 'absent' when a file does not exist (#66503) (#69657)
This was changed in ansible/ansible#51350.
(cherry picked from commit cd8920af99)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Brian Coca 9e00214fb4
fix delegation vars usage (debug still shows inventory_hostname (#69520)
* fix delegation vars usage (debug still shows inventory_hostname) (#69244)

* fix delegation vars usage and reporting

 - just pass delegated host vars + task vars to plugins
   and avoid poluting with original host vars
 - updated tests

(cherry picked from commit 2165f9ac40)

* fix delegated interpreter discovery (#69604)

* fix delegated interpeter
* allow returning fact if it is 'the right host'
* added note for future fix/efficiency
 as it stands we rerun discovery for the delegated host
unless its saving facts to itself
 * fixed test lacking delegate_to mock

(cherry picked from commit de3f7c7739)

* Fix `ansible -K` become_pass regression (#69629)

* Fix `ansible -K` become_pass regression

Change:
- This fixes a breaking change introduced in
  2165f9ac40

Test Plan:
- Local VM for now, with plans to add an integration test for -K going
  forward.

Tickets:
Refs #69244

(cherry picked from commit fe9696be52)

* fix discovery on loop with delegation (#70013)

* fix discovery on loop with delegation

fixes #69963

(cherry picked from commit 4c9d9dbb56)

Co-authored-by: Rick Elrod <rick@elrod.me>
5 years ago
Sam Doran 4c1777e26e
[stable-2.9] Properly handle unicode in safe_eval (#68576) (#69626)
* Properly handle unicode in safe_eval

Fixes #66943

* Update lib/ansible/template/safe_eval.py

Co-authored-by: Sam Doran <sdoran@redhat.com>.
(cherry picked from commit ecd986006e)

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
5 years ago
Sumit Jaiswal ef01267eb6
ios_l3 loopback backport (#69593) 5 years ago
Martin Krizek 4ed4d2d280
Validate args for includes in handlers too (#57537) (#69448)
(cherry picked from commit 9645304da3)
5 years ago
Chih-Hsuan Yen 6aca3a2c69
Fix/archive empty file (#64895) (#69420)
* Remove call to filecompare to fix issue with empty file exclusion from archive

* Add empty file

(cherry picked from commit 277dd54d45)

Co-authored-by: Nabil BENDAFI <nbendafi@yseop.com>
5 years ago
Felix Fontein 380be7581e
Address compat issue for collection loading on py26 (#68219) (#69402)
* Address compat issue for collection loading on py26

* Move import_module shim to utils for compat across the codebase

* Enable collection tests on py2.6

* Update changelog fragment

* Simplify code using sys.moduls

* Move compat to module_utils/compat/importlib

* Add back errantly deleted newline

* Remove hack comment

Co-Authored-By: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
(cherry picked from commit da3a90e88e)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Sam Doran f963aba45a
[stable-2.9] Pin Docker version at 19.03.1 (#69635) (#69645)
* [stable-2.9] Pin Docker version at 19.03.1
(cherry picked from commit fe941a4045)

Co-authored-by: Sam Doran <sdoran@redhat.com>

* [stable-2.9] Pin docker-ce-cli version in tests (#69620)

Installing docker-ce has a dependency of docker-ce-cli. If the version of docker-ci-cli is not specified, it installs the latest version.

(cherry picked from commit 889da811d7)
5 years ago
Mark Goddard 5a0d35646d Fix fileglob plugin with non-existent subdirectory
Since Ansible 2.9.8, if the fileglob plugin is passed a path containing
a subdirectory of a non-existent directory, it will fail. For example:

lookup('fileglob', '/'): ok
lookup('fileglob', '/foo'): (non-existent): ok
lookup('fileglob', '/foo/bar'): (non-existent): FAIL

The exact error depends on Python 2 or 3, but here is the error on
Python 2:

    AttributeError: 'NoneType' object has no attribute 'endswith'

And on Python 3:

    TypeError: expected str, bytes or os.PathLike object, not NoneType

This change fixes the issue by skipping paths that are falsey before
passing them to os.path.join().

Fixes: #69450
5 years ago
Matt Clay 28e9121d94 Disable failing azure_rm_dnszone test.
The module requires updates to work with the current Azure API.
5 years ago
Matt Clay 8b2957aac3 Revert "2.9: native types: literal_eval all the things (#68938) (#69044)"
This reverts commit 70b4ce5efd.
5 years ago
Jordan Borean 330112a45c Fix win_psmodule and win_psrepository tests 5 years ago
Ganesh Nalawade e40b96ed88
Refactor CLI prompt mode check for network plugins (#63945) (#69210)
* Refactor CLI prompt mode check for network plugins (#63945)

* Refactor CLI prompt mode check for network plugins

*  Move the CLI prompt mode check logic from action plugin
   to the controller side with the cliconf plugins.

*  This refactor also allows the network modules
   to initialise the persistent connection with remote device
   only when it is required.

* Fix review comments

(cherry picked from commit c27e47327f)

* Fix cli context check for network_cli connection (#64697)

* Fix cli context check for network_cli connection

Fixes #64575

*  Check cli context for network_cli connection
   at the start of new task run only.

* Pass task_uuid around to identify start of new task run

* Handle for local connection

(cherry picked from commit ee3f8d28a4)

* Add test for reboot & wait_for_connection on EOS & IOS (#63014)

* Add test for reboot & wait_for_connection

* Add test for ios

* Collection-proof block test

* Add junos test

* Don't try to evaluate cli context unless using the connection

* Prevent infinite recursion

* Update change log

(cherry picked from commit e19b94f43b)
(cherry picked from commit ee3f8d28a4)
(cherry picked from commit e19b94f43b)

devel:
https://github.com/ansible/ansible/pull/63945
https://github.com/ansible/ansible/pull/64697
https://github.com/ansible/ansible/pull/63014

Co-authored-by: Nathaniel Case <ncase@redhat.com>
5 years ago
Matt Martz 99e6f4ff54 [stable-2.9] Handle non-ascii paths during role installation. Fixes #69133 (#69213)
(cherry picked from commit bc41dd4)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Matt Martz 6c2b372d1b [stable-2.9] Address fixme and handle filter/test errors for collections better (#68047)
* Address fixme and handle fitler/test errors for collections better. Fixes #66721

* Re-arrange code
(cherry picked from commit ee6413a)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Jesse Pretorius (odyssey4me) 82378406ea [pip] Enable virtualenv_command to have arguments
Currently if virtualenv_command has arguments, then the
search for the binary in the path does not work so the
user has to specify the full path to it.

To allow arguments to be used without having to specify
the path to the binary, we split the module argument into
the command and anything after the first space.

This makes using this module argument more flexible and
user friendly.

Fixes: #52275
(cherry picked from commit da390b297e)
5 years ago
rwagnergit 081ce0e4e1 update ActionBase._low_level_execute_command to honor executable (#68315)
* update ActionBase._low_level_execute_command to honor executable

* adding changelog fragment

* renaming changelog fragment to .yml

* noop change to bump shippable

* adding raw_executable integration test

* copying aliases from raw

* removing blank lines

* skipping aix and freebsd

* noop to bump shippable

* moving tests to raw/

* removing become_method: sudo ; it doesn't work on AIX

* removing trailing blank line

* forcing become_method: su to try to get AIX to work

Co-authored-by: Rob Wagner <rob.wagner@sas.com>
(cherry picked from commit 977b58740b)
5 years ago
Andrew Klychkov 7cb8594e97 Bugfix of 67377: postgresql_set converts value to uppercase if "mb" or "gb" or "tb" is in the value string (#67418)
* Bugfix of 67377: postgresql_set converts value to uppercase if "mb" or "gb" or "tb" is in the value string

* fix CI

* add changelog

(cherry picked from commit 59bcc9f739)
5 years ago
Martin Krizek 70b4ce5efd
2.9: native types: literal_eval all the things (#68938) (#69044)
* native types: literal_eval all the things (#68938)

With https://github.com/pallets/jinja/pull/1190 merged our short-circuit
is no longer valid (has it ever been?) as now data like ' True ' may go
through our ansible_native_concat function as opposed to going through
intermediate call to Jinja2's native_concat before. Now we need to always
send data through literal_eval to ensure native types are returned.

(cherry picked from commit acdc9eb76d)

* Fix tests
5 years ago
Brian Coca b3a1288150 preserve json parsing error (#58461)
* preserve json parsing error
* added test

(cherry picked from commit bbdf77a59f)
5 years ago
Matt Martz e2f7676c5a [stable-2.9] Allow a collection role to call a standalone role by default (#69102)
* Allow a collection role to call a standalone role by default. Fixes #69101

* tweaked changelog text

* Guard against NoneType

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>.
(cherry picked from commit da98fc267a)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Brian Coca f8a5377cc6 Fix fileglob when using 'file*' vs 'stuff/file*' (#68945)
* Fix fileglob when using 'file*' vs 'stuff/file*'

 when not having dir in glob, files/ subdir was being ignored.

* tests for fileglob

(cherry picked from commit d3cab602a5)
5 years ago
Rick Elrod 4a20196492 Enable dnf integration tests on CentOS 8
Change:
We were only testing dnf on RHEL previously.
Test on CentOS 8 as well.

Test Plan:
Ran locally in docker.

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Rick Elrod 07084217dc [dnf] Make behavior/errors compatible for new DNF
Change:
Extend the logic for custom error handling in the dnf module, so that on
newer DNF (such as DNF that ships with modern Fedora 31 container
images, and ships with RHEL 8.2) we report errors consistently with
older DNF.

Test Plan:
Ran dnf integration tests against an old Fedora 31 container image and a
brand new Fedora 32 container image; tess passed on both.

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Rick Elrod e4a5b4b797 [stable-2.9] pip - Fix check_mode for prerelease packages (#68690)
* pip - Fix check_mode for prerelease packages

Fixes #68592.

Signed-off-by: Rick Elrod <rick@elrod.me>
Co-authored-by: Matt Martz <matt@sivel.net>
(cherry picked from commit 82c60db49b)

Co-authored-by: Rick Elrod <rick@elrod.me>
5 years ago
Brian Coca 290bfa820d fixed fetch traversal from slurp (#68720)
* fixed fetch traversal from slurp

  * ignore slurp result for dest
  * fixed naming when source is relative
  * fixed bug in local connection plugin
  * added tests with fake slurp
  * moved existing role tests into runme.sh
  * normalized on action excepts
  * moved dest transform down to when needed
  * added is_subpath check
  * fixed bug in local connection

fixes #67793

CVE-2019-3828

(cherry picked from commit ba87c225cd)
5 years ago
Brian Coca 0b4788a71f prevent ansible_facts injection (#68431)
- also only replace when needed
 - switched from replace to index
 - added test to verify bogus_facts are not accepted

CVE-2020-10684

(cherry picked from commit a9d2ceafe4)
5 years ago
Brian Coca 51d2514753 fix vault temp file handling (#68433)
* fix vault tmpe file handling

 * use local temp dir instead of system temp
 * ensure each worker clears dataloader temp files
 * added test for dangling temp files
 * added notes to data loader

CVE-2020-10685

(cherry picked from commit 6452a82452)
5 years ago
Sloane Hertel c6c4fbf4a1 subversion module - provide password securely when possible or warn (#67829)
* subversion module - provide password securely with svn command line option --password-from-stdin when possible, and provide a warning otherwise.
* Update lib/ansible/modules/source_control/subversion.py.
* Add a test.

Co-authored-by: Sam Doran <sdoran@redhat.com>
(cherry picked from commit d91658ec0c)
5 years ago
Jordan Borean b2551bb694
ansible-galaxy - Fix tar path traversal issue during install - CVE-2020-10691 - 2.9 (#68601)
* ansible-galaxy - Fix tar path traversal issue during install - CVE-2020-10691 (#68596)

(cherry picked from commit a20a527014)

* Remove extra tests missing from rebase
5 years ago
Florian Apolloner 3bebeb9cc3 Fixed mysql_user module idempotency for long privilege lists. (Fixes #68044) 5 years ago
nkshrishail ea4f6e1539 nxos_lacp: updated tests to handle platforms not supporting lacp system mac command (#64074)
* Updated nxos_lacp tests to handle platforms not supporting lacp system mac command

* nxos_lacp: addressing comments

* nxos_lacp: Updating image tag search to include more tags

(cherry picked from commit 00193f27eb)

Add changelog for nxos_lacp fix
5 years ago
Abhijeet Kasurde eec5cc4f73 [2.9] VMware: Use existing DVPG network in vmware_guest_network
* Handle all cases of networks

Fixes: #65968

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit afb71c14bd)
5 years ago
Sam Doran 0e51aadd8e
[stable-2.9] Add CentOS 8 to the test matrix (#68025)
* Add CentOS 8 to the test matrix (#63649)

(cherry picked from commit 2a7623dd5c)

* Skip PostgreSQL tests on CentOS 8

The tests in devel have diverged significantly from what is in
stable-2.9. It is easiest to skip these test for CentOS 8 in this branch
since they are still being run in devel.
5 years ago
Abhijeet Kasurde 378434a148 passwordstore: Honor equal sign in userpass
passwordstore lookup plugin now can handle equal sign in user input

Fixes: ansible/ansible#68265

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Sam Doran 1f304ef372 win_unzip - normalize and compare paths to prevent path traversal (#67799)
* Actually inspect the paths and prevent escape
* Add integration tests
* Generate zip files for use in integration test
* Adjust error message

(cherry picked from commit d30c57ab22)
5 years ago
flowerysong 938fb16069 adhoc: Load callbacks before sending v2_playbook_on_start (#67673)
(cherry picked from commit 370f788731)
5 years ago
Matt Clay bf3cd041e7 Disable failing azure_rm_cosmosdbaccount test. 5 years ago
Matt Clay 8a14392a29 [stable-2.9] Update tests to use RHEL 7.8. (#68787)
* Update tests to use RHEL 7.8.

Keeping support for RHEL 7.6 since collections are still using it.

* Fix tests for RHEL 7.7+ due to extras repo name change..
(cherry picked from commit 04edd77c42)

Co-authored-by: Matt Clay <mclay@redhat.com>
5 years ago
Rick Elrod 89937180c5 Fix win_psrepository tests
Backport of a5414cb0e4

Signed-off-by: Rick Elrod <rick@elrod.me>
5 years ago
Rick Elrod 7a861dd2f1
OpenSUSE15.1 container image + necessary test change (2.9 edition) (#68788)
* add changelog fragment

Signed-off-by: Rick Elrod <rick@elrod.me>

* Update changelogs/fragments/ansible-test-opensuse-15.1.yml

Co-Authored-By: Matt Clay <matt@mystile.com>

* Update docker.txt to use the OpenSUSE 15.1 container image

Signed-off-by: Rick Elrod <rick@elrod.me>

* handle installing mysql on suse

Signed-off-by: Rick Elrod <rick@elrod.me>

* attempt to get tests passing again

Signed-off-by: Rick Elrod <rick@elrod.me>

Co-authored-by: Matt Clay <matt@mystile.com>
5 years ago
Jordan Borean 6703ffd21d [stable-2.9] win_unzip - LiteralPath fix (#66972)
* win_unzip - LiteralPath fix

* Fix up Python sanity issues
(cherry picked from commit 2a9ec8975f)

Co-authored-by: Jordan Borean <jborean93@gmail.com>
5 years ago
Sam Doran 1f2758af20
ansible-galaxy - fix role list bug (#67391) (#67619)
Properly list roles even when the role name is the same or a substring of the
path to the role.

(cherry picked from commit c64202a495)
5 years ago
Abhijeet Kasurde f8aaa7dcd2
[2.9] VMware: vmware_export_ovf module fix Python3 compatibility issue (#67514)
(cherry picked from commit 023a9b3166)

Co-authored-by: Diane Wang <41371902+Tomorrow9@users.noreply.github.com>
5 years ago
Jordan Borean 151d83efc3
win_credential - fix wildcard name (#67549) (#67552)
(cherry picked from commit d7059881a2)
5 years ago