Commit Graph

5125 Commits (c54dc50bd7de1175efea2794f034685fa4082100)

Author SHA1 Message Date
Rick Elrod 609667c7d4
[tests] --no-use-pep517 in kubevirt_conformance (#72015)
Change:
- This enables the inventory_kubevirt_conformance test to pass again on
  freebsd.
- This was due to a google-auth version bump. The dep chain looks like
  this: openshift -> kubernetes -> google-auth -> aiohttp -> multidict

Test Plan:
- ansible-test integration inventory_kubevirt_conformance --remote
  freebsd/12.0

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Jordan Borean 7e8ecb2e58
psrp - fix hang when copying an empty file (#71649) (#71650)
(cherry picked from commit b615789fcc)
4 years ago
Rick Elrod 9d54f13ec1 Prevent templating unused variables for {%include%} (#68749)
Fixes #68699

(cherry picked from commit ff1ba39c8a)
4 years ago
Martin Krizek a63baa3290
Provide more information in AnsibleUndefinedVariable (#71666) (#71877)
Fixes #55152

(cherry picked from commit 00b22ab55e)
4 years ago
Rick Elrod a2548ccb6c [tests] Make setup_docker clean up better
Change:
- pip packages should get removed after, not try to add them again
- Try removing containerd.io package too
- Backport of #71949

Test Plan:
- CI
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod ace7f247f2 [docker_login] Fix changed status for newer docker
Change:
- Newer docker versions report the same message whether or not a logout
  actually happened.
- Determine change status from looking at the config instead if we can.
- This also allows us to restore check_mode in logout and re-enable that
  test.

Test Plan:
- CI, re-enabled tests

Tickets:
- Refs 6248f2fb6f

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 39fae9320c [incidental_setup_docker] changes to upstream repo (#71897)
Change:
- The docker-ce.repo file for centos does not work on RHEL since it uses
  $releasever and on RHEL that is, e.g., "7Server".
- Instead, set up the repo manually.
- Additionally, the docker centos8 repo no longer has old versions, so
  we use the (only) version in the repo instead.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
(cherry picked from commit 31ddca4c0d)
4 years ago
Matt Clay 61d383ef23 [stable-2.9] Fix attribute testing in file integration test. (#71843)
The file test will no longer attempt to test attributes if `lsattr -vd` does not work on the system under test.
(cherry picked from commit 17765cd4e8)

Co-authored-by: Matt Clay <mclay@redhat.com>
4 years ago
Sam Doran 582cf06501
[stable-2.9] openssl_privatekey test - Add pause for macOS (#71819)
The stat time granularity on macOS is one second. We recently upgrade
to faster macOS hosts, so some tests that run closely together to
see if something changed will have the same timestamp intermittently.
4 years ago
Sam Doran 3e26c56edd
[stable-2.9] incidental_setup_openssl - Pin version of Python packages (#71777)
A recent update to cffi that was yanked is still being installed on our
Mac OS X 10.11 test image since the version of pip there is very old and
does not ignore yanked packages.

Pin the version of pyOpenSSL and its dependencies to fix this and avoid
future spontaneous failures.
(cherry picked from commit 65cdb86c8a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Matt Clay 417e408f59
[stable-2.9] Backport ansible-test CI provider support. (#71614)
* Add encoding.py from devel to support backports.

* Add io.py from devel to support backports.

* Update ansible-test support for CI providers. (#69522)

Refactored CI provider code to simplify multiple provider support and addition of new providers.

(cherry picked from commit d8e0aadc0d)

* Add Shippable request signing to ansible-test. (#69526)

(cherry picked from commit e7c2eb519b)

* ansible-test local change detection: use --base-branch if specified (#69508)

(cherry picked from commit 43acd61901)

* Add Azure Pipelines support to ansible-test.

(cherry picked from commit 8ffaed00f8)

* Update ansible-test remote endpoint handling. (#71413)

* Request ansible-core-ci resources by provider.
* Remove obsolete us-east-2 CI endpoint.
* Add new --remote-endpoint option.
* Add warning for --remote-aws-region option.
* Update service endpoints.
* Allow non-standard remote stages.
* Add changelog fragment.

(cherry picked from commit d099591964)

* Fix ansible-test coverage traceback. (#71446)

* Add integration test for ansible-test coverage.

* Fix ansible-test coverage traceback.

* Fix coverage reporting on Python 2.6.

(cherry picked from commit f5b6df14ab)

* Use new endpoint for Parallels based instances.

(cherry picked from commit 98febab975)

* Add pause to avoid same mtime in test.

(cherry picked from commit 3d769f3a76)

Co-authored-by: Felix Fontein <felix@fontein.de>
4 years ago
Rick Elrod 15a77b4575
[tests] fix fallout from dnf gpg fix (#71551)
Change:
- Missed needed gpg ignores

Test Plan:
- CI
- ci_complete

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Sam Doran dfaadf6f33
Fix inventory_kubevirt_conformance test (#71546) 4 years ago
Rick Elrod 1d043e082b
[dnf] ensure packages are gpg-verified (#71540)
Change:
- By default the dnf API does not gpg-verify packages. This is a feature
  that is executed in its CLI code. It never made it into Ansible's
  usage of the API, so packages were previously not verified.
- This fixes CVE-2020-14365.

Test Plan:
- New integration tests

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Jordan Borean fe72da80a4
powershell - fix quoting values (#71411) (#71448)
* powershell - fix quoting values

* Add ignore for smart quote skip

(cherry picked from commit 72a7cb4a2c)
4 years ago
GomathiselviS cb79d9c80d
Update network integration auth timeout (#71057) (#71239)
* Update network integration auth timeout

* added changelog

Co-authored-by: Ganesh Nalawade <ganesh634@gmail.com>
4 years ago
David Shrewsbury f563365f8e
Fix play stats when rescue block is a child block (#70922) (#71335)
* check run state of current block only

* Add changelog and test

* Add test for issue 29047

(cherry picked from commit f2f6c34632)
4 years ago
Rhys b6c7598a20
[2.9] Fix issue with MongoDB 4.0.20 (#71393)
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
4 years ago
Dusan Matejka aa698ba9b6
Zabbix: Handle KeyError in zabbix_host module (#65392) (#71288)
Fixes: #65304
(cherry picked from commit 7b2cfdacd0)

Co-authored-by: sky-joker <sky.jokerxx@gmail.com>
4 years ago
Ganesh Nalawade 67fab726b9
Fix commit timeout failure issue for netconf modules (#71291)
Fixes https://github.com/ansible-collections/cisco.iosxr/issues/74

*  ncclient API expects commit timeout value in either unicode
   or bytes format, hence convert the timeout value explicitly
   to string type.
4 years ago
Lorenzo Castelli 4a5aac0ac1
systemd - supports new systemctl output message for chroot (#71197) (#71329)
The message generated by systemctl has been updated in 9321e23c40, which requires a corresponding change in the systemd module.

In addition, this fixes the module when the SYSTEMD_OFFLINE environment variable is set.

(cherry picked from commit a1a50bb3cd)
4 years ago
Martin Krizek 15f3426971
_check_failed_state: always use the current/nested state (#71347) (#71456)
Fixes #71306

(cherry picked from commit 9792d631b1)
4 years ago
Rick Elrod 6b4977e3f4
Backport cron module regression fix (#71244)
Change:
- Backport of #71207

Test Plan:
- CI

Tickets:
- Fixes #71213
- Fixes #71217
- Fixes #71216
- Fixes #71226
- Refs #71207

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 7d61e47a0e
[stable-2.9] tests: Use `hg serve` instead of bitbucket for hg (#71398)
* tests: Use `hg serve` instead of bitbucket for hg

Change:
- Uses `hg serve` instead of a bitbucket repo for hg tests
- bitbucket no longer serves hg

Test Plan:
- CI, fixed integration tests

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Rick Elrod 7779137b71
[stable-2.9] disable mongodb_* tests, fix setup_mongodb (#71388)
* Disable mongodb_replicaset tests for now

Change:
- 4.0.20 breaks tests, disable for now

Test Plan:
- CI

Tickets:
- https://github.com/ansible-collections/community.mongodb/issues/136

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

* setup_mongodb: Nix RH package installation/removal

Change:
- Our RHEL and CentOS images make these unnecessary and they were
  broken.

Test Plan:
- CI

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

* Disable mongodb_shard tests for now

Change:
- 4.0.20 breaks tests, disable for now

Test Plan:
- CI

Tickets:
- https://github.com/ansible-collections/community.mongodb/issues/136

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Sam Doran ea8c219402
[stable-2.9] Revert "Change default file permissions so they are not world readable (#70221) (#70825)" (#71232)
This reverts commit 0199b1cf05.
4 years ago
Jordan Borean a57e6172f7
Ensure -k is set to delegated hosts without a pass (#71136) - 2.9 (#71167)
* Ensure -k is set to delegated hosts without a pass (#71136)

* Ensure -k is set to delegated hosts without a pass

* Fix up some broken tests

* Update task_executor.py

one possible fix, the other is updating winrm to normalize on 'password' like the other connection plugins

* Add alias for winrm and fix incorrect assumption

* Make sure aliases are used for keyword options

* Conditionally run test if sshpass is present, fix sanity

Co-authored-by: Brian Coca <bcoca@users.noreply.github.com>
(cherry picked from commit 3f22f79e73)

* Backport subset of https://github.com/ansible/ansible/pull/69670
4 years ago
Rick Elrod 9cc782eebc
[tests] pin docker to <4.3.0 (#71192)
Change:
- New python docker lib wants a newer docker than we have in CI.

Test Plan:
- CI

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Brian Coca 4a6a9acea8
dont clobber facts in loop (#71032) (#71096)
* dont clobber facts in loop

	fixes #71031

(cherry picked from commit f9af27c631)
4 years ago
Sloane Hertel 44cca5426f
[2.9] template connection variables accessed directly before using (#70657) (#70689)
* template connection variables accessed directly before using (#70657)

* template variables accessed directly when using them instead of FieldAttributes

(cherry picked from commit 8c213c9334)

* changelog
4 years ago
Abhijeet Kasurde aa58d8c9ed
[2.9] hashi_vault: Handle equal sign in secret name value (#70169)
Fixes: ansible/ansible#55658

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Martin Krizek bdcde11f9f
2.9: Detect failure in always block after rescue (#70094) (#70203)
* Detect failure in always block after rescue (#70094)

* Detect failure in always block after rescue

Fixes #70000

ci_complete

* Add more tests

(cherry picked from commit 0ed5b77377)

* add changelog

Co-authored-by: Matt Davis <mrd@redhat.com>
4 years ago
Rick Elrod 9ba99ead4f
Update integration tests to support rpmfluff-0.6 (#71155) (#71160)
Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Andrew Klychkov c632d74487
mysql_user: fix overriding user passowrd to the same (#70833) 4 years ago
Brian Coca 1b41129402
Allow hostvars delegation (#70331) (#70811)
* Allow hostvars delegation (#70331)

* ensure hostvars are available on delegation
* also inventory_hostname must point to current host and not delegated one
* fix get_connection since it was still mixing original host vars and delegated ones
* also return connection vars for delegation and non delegation alike
* add test to ensure we have expected usage when directly assigning for non delegated host

(cherry picked from commit 84adaba6f5)

* avoid returning more data

* remove unused return vars
4 years ago
Sam Doran 523d0f5665
[stable-2.9] cron - Allow non-ascii (UTF-8) chars in cron file paths and jobs (#70426) (#71134)
* Encode/Decode files in UTF-8
* Use helper function in ansible
* Add an integration test
* Use emoji in test data.
* add changelog
* Also support non-ascii chars in filepath and add tests about this.
* Also use non-ascii chars in replaced text and ensure not to break cron syntax.
* rename self.existing to self.n_existing
* rename crontab.existing to crontab.n_existing.
(cherry picked from commit 5ce47646ad)

Co-authored-by: psi / Ryo Hirafuji <ryo.hirafuji@link-u.co.jp>

* try removing name references for state=absent

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

Co-authored-by: psi / Ryo Hirafuji <ryo.hirafuji@link-u.co.jp>
Co-authored-by: Rick Elrod <rick@elrod.me>
4 years ago
Sam Doran 0199b1cf05
[stable-2.9] Change default file permissions so they are not world readable (#70221) (#70825)
* [stable-2.9] Change default file permissions so they are not world readable (#70221)

* Change default file permissions so they are not world readable

CVE-2020-1736

Set the default permissions for files we create with atomic_move() to 0o0660. Track
which files we create that did not exist and warn if the module supports 'mode'
and it was not specified and the module did not call set_mode_if_different(). This allows the user to take action and specify a mode rather than using the defaults.

A code audit is needed to find all instances of modules that call atomic_move()
but do not call set_mode_if_different(). The findings need to be documented in
a changelog since we are not warning. Warning in those instances would be frustrating
to the user since they have no way to change the module code.

- use a set for storing list of created files
- just check the argument spac and params rather than using another property
- improve the warning message to include the default permissions.
(cherry picked from commit 5260527c4a)

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

* Fix jboss test

* Fix lamdba_policy test

* Fix aws_lamdba test

* Fix warning for new default permissions when mode is not specified (#70976)

Follow up to #70221
Related to #67794
CVE-2020-1736

When set_mode_if_different() is called with mode of 'None', ensure we issue
a warning about the change in default permissions.

Add integration tests to ensure the warning works properly.

* Fix tests
- actually use custom module 🤦‍♂️
- verify file permission on created files
- use remote_tmp_dir so we're ready for split controller
- improve test module so we can skip the call to set_fs_attributes_if_different()
- fix tests for CentOS 6

(cherry-picked from commit dc79528cc6)

* Use new category in changelog fragments
4 years ago
Sloane Hertel 6cae9a4b16
copy - redact 'content' from invocation in check mode (#71033) (#71068)
* sanitize copy module invocation secrets in check mode

(cherry picked from commit 991714b9d1)
4 years ago
Sam Doran fba387fd64
[stable-2.9] Drop "rhui-" prefix from RHEL repositories in AMI (#71130) (#71132)
The repository names seem to have changed and no longer have the "rhui-" prefix.
(cherry picked from commit 6ac4439a6a)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Baptiste Mille-Mathias 84afa8e90c
Fix missing quoting for remote_tmp in second mkdir of shell module. Issue #69577 (#69578) (#70758)
* Fix missing quoting for remote_tmp in second mkdir of shell module. Issue #69577

* adding changelog

* fixing typo in changelog entry

* adding test case

Adding test case written by bmillemayhias.

* using $HOME instead of ~

* fixing commit measage

* Update 69578-shell-remote_tmp-quoting.yaml

Co-authored-by: Brian Kohles <me@briankohles.com>
(cherry picked from commit 77d0effcc5)

Co-authored-by: Brian Kohles <briankohles@users.noreply.github.com>
4 years ago
Baptiste Mille-Mathias e55565e951
Create home and parent directories only when requested (#70789)
The home user and the parents directories should only be created when
create_home == True

(cherry picked from commit f3dd8d3052)
4 years ago
David Shrewsbury 76815d3afc
Sanitize URI module keys with no_log values (#70762) (#70821)
* Add sanitize_keys() to module_utils.

* More robust tests

* Revert 69653 change

* Allow list or dict

* fix pep8

* Sanitize lists within dict values

* words

* First pass at uri module

* Fix insane sanity tests

* fix integration tests

* Add changelog

* Remove unit test introduced in 69653

* Add ignore_keys param

* Sanitize all-the-things

* Ignore '_ansible*' keys

* cleanup

* Use module.no_log_values

* Avoid deep recursion issues by using deferred removal structure.

* Nit cleanups

* Add doc blurb

* spelling

* ci_complete

(cherry picked from commit bf98f031f3)
4 years ago
Jordan Borean 74d5391f73
ansible-galaxy - fix fallback for AH searches (#70957) (#70983)
(cherry picked from commit b1cb2553af)
4 years ago
Nilashish Chakraborty 87364a3286
nxos_user: Do not fail when a custom role is used (#71054)
(https://github.com/ansible-collections/cisco.nxos/pull/130)

Reviewed-by: https://github.com/apps/ansible-zuul
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
4 years ago
Sam Doran 0399960e34
[stable-2.9] unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666) (#71002)
* [stable-2.9] unarchive - Check 'fut_gid' against 'run_gid' in addition to supplemental groups (#65666)

Add integration tests for unarchiving as unprivileged user
Break tasks into separate files for easier reading and maintenance

Create a user by specifying a default group of 'staff' for macOS.

The user module does not actually remove the user directory on macOS,
so explicitly remove it.

Put the removal tasks in an always block to ensure they always run

Co-authored-by: Philip Douglass <philip.douglass@amadeus.com>
Co-authored-by: Sam Doran <sdoran@redhat.com>.
(cherry picked from commit ac5f3f8bef)

Co-authored-by: Philip Douglass <philip@philipdouglass.com>

* [stable-2.9] Fix unstable unarchive test (#71004)

* Add mode to copy tasks
* Fix unreliable test by ignoring errors

(cherry picked from commit f99f96ceb6)

Co-authored-by: Philip Douglass <philip@philipdouglass.com>
4 years ago
Martin Krizek 4f732c9ce9
Emit proper error for `x in y` when y is undefined (#70990) (#71012)
Fixes #70984

(cherry picked from commit bf7276a4e8)
4 years ago
Sam Doran 0ecb2abf43
[stable-2.9] linux facts - return proper broadcast address (#64528) (#71065)
* linux facts - return proper broadcast address

Check that the value being returned is actually a broadcast address

* Add tests

* Cleanup tests
(cherry picked from commit e6bf202738)

Co-authored-by: Sam Doran <sdoran@redhat.com>
4 years ago
Jordan Borean 4d675b6d87
win_reg_stat fix up broken test (#70830) 4 years ago
Matt Martz f556b6cdd8
[stable-2.9] Allow single vault encrypted values to be used directly as module parameters. Fixes #68275 (#70607) (#70642)
* rebase conflicts

* [stable-2.9] Allow single vault encrypted values to be used directly as module parameters. Fixes #68275 (#70607).
(cherry picked from commit a77dbf0866)

Co-authored-by: Matt Martz <matt@sivel.net>
4 years ago
Brian Coca 00eb2edc09
Make filter type errors 'loop friendly' (#70417) (#70575)
- ensure we preserve the typeerror part of the exception so loop defereed error handling
 can postpone those caused by undefined variables until the when check is done.
 - fix tests to comply with the 'new normal'

 - human_to_bytes and others can issue TypeError not only on 'non string'
 but also bad string that is not convertable.

Co-authored-by: Sloane Hertel <shertel@redhat.com>

Co-authored-by: Sloane Hertel <shertel@redhat.com>
(cherry picked from commit cf89ca8a03)
4 years ago