Commit Graph

4398 Commits (70b577ab097ea4ebffe69fa3bdb13867e20085c7)

Author SHA1 Message Date
Matt Clay 6f5c94ffea [stable-2.8] 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.
(cherry picked from commit 965854fbd2)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Matt Clay 6af5aad3cf [stable-2.8] Add test constraint for setuptools. (#66426)
* Add test constraint for setuptools.

* Update pip test to work on centos6 container.
(cherry picked from commit 51e5b714e0)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Adam Miller 3edff5d42a Backport/2.8/63713 yum single yum base instantiation 53286 non existent repos (#65575)
* yum - only instantiate YumBase once (#63713)

* yum - only instantiate YumBase once

Previously, this code was re-instantiating the `YumBase` object
many times which is unnecessary and slow. However, we must do it
twice in the `state: absent` case because the `yumSack` and
`rpmSack` data of the previously instantiated object becomes
invalid and is no longer useful post transaction when we verify
that the package removal did in fact take place. Also, this patch
removes the repetitive re-processing of enable/disable of repos in
various places.

Here's a display of the speed increase against a RHEL7 host:

```yaml
- hosts: rhel7
  remote_user: root
  tasks:
  - name: Install generic packages
    yum:
      state: present
      name:
        - iptraf-ng
        - screen
        - erlang
  - name: Remove generic packages
    yum:
      state: absent
      name:
        - iptraf-ng
        - screen
        - erlang
```

Before this patch:
```
real    0m52.728s
user    0m5.645s
sys     0m0.482s
```

After this patch:
```
real    0m17.139s
user    0m3.238s
sys     0m0.277s
```

Fixes #63588
Fixes #63551

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

* add changelog

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

* YUM - handle enable of non-existent repo (#53286)
6 years ago
Kiyo Nagamine 41bddb61b8 Ensure `allow_duplicates: true` enables to run single role multiple times (#64902) (#65063)
* Ensure `allow_duplicates: true` enables to run single role multiple times(#64902)

* Changed return value in `_load_roles` . Fixes #64902

* Add changelog fragment

* Add an integration test for the issue

* Fix changelog generation error and integration test.

* Fix yaml syntax error in changelog fragment

* Fix typo in a changelog fragment of #64902

(cherry picked from commit daecbb9bf0)
(cherry picked from commit 33094e6c8e)
6 years ago
Felix Fontein 519846a1be 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.

(cherry picked from commit 17ef253ad1)
6 years ago
Sam Doran 15a53276aa [stable-2.8] user - honor update_password parameter on BusyBox hosts (#65977)
The check for this parameter was missing from BusyBox.modify_user(), resulting in unexpected password changes to existing user accounts.
(cherry picked from commit 18130e1419)

Co-authored-by: Sam Doran <sdoran@redhat.com>
6 years ago
Hannes Ljungberg 7a55bc1902 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>
(cherry picked from commit f31b8e08b2)
6 years ago
Matt Clay b3a0ccc485 [stable-2.8] Simplify docker_setup on Fedora.
This avoids installing dnf-plugins-core, which breaks the yum and dnf modules
when uninstalling packages using a wildcard after they have already been removed.

This should resolve issues with the yum integration tests failing after docker tests run.
(cherry picked from commit a5c36eedd8)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Matt Clay 77ce11b21d [stable-2.8] Disable failing azure_rm_storageaccount test.
(cherry picked from commit 342b9953bc)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Justin Ossevoort d9368e195d [stable-2.8] Fix 'Assert CNAME failure' assertion (#65875)
(cherry picked from commit 14ebceec25)

Co-authored-by: Justin Ossevoort <github@internetionals.nl>
6 years ago
Lukas Kämmerling b1121828c0 [stable-2.8] Fix and reenable hcloud tests.
(cherry picked from commit 5ad61ed7c1)

Co-authored-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
6 years ago
Matt Clay 14a243c486 [stable-2.8] Disable failing hcloud tests..
(cherry picked from commit 85722c360f)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Felix Fontein 96bdcbe90c openssh_keypair: fix idempotence issue (#65017) (#65127)
* Fix idempotence issue.

* Add changelog.

(cherry picked from commit b36f572256)
6 years ago
Felix Fontein 595bdfa8bb [2.8] openssl_csr and openssl_certificate: fix support for Ed25519 and Ed448 private keys (#64126)
* openssl_csr and openssl_certificate: fix support for Ed25519 and Ed448 private keys (#63984)

* Move X25519, X448, Ed25519 and Ed448 feature tests to module_utils.

* Correctly sign with Ed25519 and Ed448 keys.

* Fix public key comparison. Ed25519 and Ed448 do not have public_numbers().

* Add tests.

* Add changelog.

* Give better errors for cryptography 2.6.x and 2.7.x.

* Test for new errors.

* Forgot one.

* Used wrong private key.

* Use private key password for CA key. Add more stuff to its certificate.

(cherry picked from commit fed267df03)

* Pass select_crypto_backend also to test implementation. This exists in devel but not yet in stable-2.8.
6 years ago
Felix Fontein d3e13aae09 Fixes #56832: Remove warning when falling back to apt-get if aptitude is missing. (#61782) (#64651)
(cherry picked from commit a6ec6c3175)
6 years ago
Felix Fontein 4f9a301594 docker_swarm_service: Allow source to be omitted for tmpfs mounts (#64637) (#64641)
* Allow source to be omitted for tmpfs mounts.

* Add changelog.

(cherry picked from commit 574bd32db2)
6 years ago
Sam Doran 0c89a97107 [stable-2.8] copy - check for changes beyond first level of subdirectories (#58323) (#64112)
Add integration test for copy: deep recursive with remote_src=True
(cherry picked from commit b7e38dfa52)

Co-authored-by: Alexander Korsunsky <A.Korsunsky@gmail.com>
6 years ago
Robert Osowiecki ba29567210 lineinfile - don't run os.makedirs on empty dir path (#63921) (#64090)
* Fix #63919: don't run os.makedirs on empty dir path

* integration test for lineinfile create: yes without path

(cherry picked from commit 3c978a3225)
6 years ago
Sam Doran f861c284d0 [stable-2.8] lineinfile - use correct index value when inserting at the end (#63696) (#63795)
(cherry picked from commit 92cd13a2cf)

Co-authored-by: Sam Doran <sdoran@redhat.com>
6 years ago
Sam Doran cbe69adf37 [stable-2.8] lineinfile - properly insert line when line exists and backrefs are enabled (#63763) (#63791)
Use a separate variable for the boolean test rather than having the same variable sometimes be a boolean and sometimes be a regular expression match object

Add integration tests to cover this scenario
(cherry picked from commit 29d4d318a5)

Co-authored-by: Sam Doran <sdoran@redhat.com>
6 years ago
kamathe 95417c2260 ansible-vault: convert vault_password_files to list to prevent traceback (#57186) (#63622)
* Convert vault_password_files to a list

* Add changelog and tests
6 years ago
Jordan Borean a6687bef32 Fix issue when setting an empty pass to no_log param (#62804) - 2.8 (#62813)
* Fix issue when setting an empty pass to no_log param (#62804)

* Fix issue when setting an empty pass to no_log param

* Fix typo

(cherry picked from commit 322e225830)

* Fix up actual get for older versions
6 years ago
Sam Doran 3dfb8e81bb [stable-2.8] Properly mask no_log values is sub parameters during failure (#63405)
* Get no_log parameters from subspec

* Add changelog and unit tests

* Handle list of dicts in suboptions

Add fancy error message (this will probably haunt me)

* Update unit tests to test for list of dicts in suboptions

* Add integration tests

* Validate parameters in dict and list

In case it comes in as a string

* Make changes based on feedback, fix tests

* Simplify validators since we only need to validate dicts

Add test for suboptions passed in as strings to ensure they get validated properly and turned into a dictionary.

ci_complete

* Add a few more integration tests
(cherry picked from commit e9d29b1fe4)

Co-authored-by: Sam Doran <sdoran@redhat.com>
6 years ago
James Cassell b7fe3407c3 clean "changed" only after it has been processed (#59958)
* clean "changed" after it has been processed

without this change, a loop of `debug` tasks with `changed_when`
causes the "changed" status to get lost before output

* runme.sh tests for debug loop status

(cherry picked from commit bfd32c9b00)
6 years ago
Andrey Klychkov 3d8df9de72 lineinfile - fix bug with insertbefore/insertafter and firstmatch (#63194)
(cherry picked from commit 3b18337cac)
6 years ago
Matt Martz 2cbd8775ca [stable-2.8] Wrap CLI passwords as AnsibleUnsafeText (#63352)
* isa string should rewrap as unsafe in get_validated_value

* _is_unsafe shouldn't be concerned with underlying types

* Start with passwords as text, instead of bytes

* Remove unused imports

* Add changelog fragment

* Update changelog with CVE
(cherry picked from commit baeff74)

Co-authored-by: Matt Martz <matt@sivel.net>
6 years ago
Adam Miller 3c58d5f793 adapt to firewalld 0.7.0 for RHEL 8.1 Beta, Fedora 31+
Fixes #63254

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Matt Clay e6a49f2e96 [stable-2.8] Add RHEL 8.1b to the Shippable test matrix.
(cherry picked from commit 811127d64d)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Jill R 2ccfc29b7e [2.8] Fix STS assume role error message when role does not exist (#63305)
* Fix STS assume role error message when role does not exist (#63249)

AWS appears to have changed this error message again.
Fixes https://app.shippable.com/github/ansible/ansible/runs/145643/115/tests

* [2.8] Fix STS assume role error message when role does not exist

* fix changelog sanity
6 years ago
Sam Doran ca830ef42d [stable-2.8] cronvar - use correct binary name (#63279)
(cherry picked from commit 9d014778ad)
6 years ago
Pilou b64c3c42bd [stable-2.8] cron: add integration tests (#59830)
(cherry picked from commit 3c8abc0b82)
6 years ago
Felix Fontein 4b2992c203 docker_container: improve image finding / change detection (#62971)
* Improve image finding / change detection.

* Checked wrong object.

* Improve behavior. (Let docker daemon sort this out.)

* Add changelog.

* Add simple test.

* Fix image name.

* Use new docker_image params.

* Rewrite.

(cherry picked from commit 41eafc2051)
6 years ago
Adam Miller d25b46b3dc dnf - properly handle idempotent removal of wildcard globs (#63034)
Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Felix Fontein ddd9f6081e [2.8] docker_container: fix idempotency for network IP addresses (#62959)
* docker_container: fix idempotency for network IP addresses (#62928)

* Specifying IP addresses needs API version 1.22 or newer.

* Simplify code.

* Use IPAMConfig.IPv*Address instead of IPAddress and GlobalIPv6Address.

* Add changelog.

* Fix syntax errors.

* Add integration test.

* Don't rely on netaddr.

* Normalize IPv6 addresses before comparison.

* Install netaddr, and use it.

(cherry picked from commit 62c0cae29a)

* Remove IPv6 tests, use intermediate state of tests from PR which don't need ipaddr filter.
6 years ago
Matt Clay dce682fc3e [stable-2.8] Install zip for unarchive test when using dnf.
(cherry picked from commit 86ae3cfa12)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Matt Clay d8bd6ea72f [stable-2.8] test: disable hcloud_floating_ip_info
Temporarily disable `hcloud_floating_ip_info`, this until #62414 is
resolved..
(cherry picked from commit edf15b346f)

Co-authored-by: Gonéri Le Bouder <goneri@lebouder.net>
6 years ago
Felix Fontein 0f7ed58718 Re-enable some docker_swarm tests. (#61875)
(cherry picked from commit 098a13dff4)
6 years ago
Matt Martz 98fc6a627c [stable-2.8] Don't treat no checksum as a checksum match (#62146)
Fixes #61978
* moar tests for get_url fetch behavior with existing file
* add changelog fragment
(cherry picked from commit 7d51cac)

Co-authored-by: Matt Martz <matt@sivel.net>
6 years ago
Andrey Klychkov 2d967c3537 Backport of 62135: fix typos in modules (#62170) 6 years ago
Andrey Klychkov 97eba0fc60 Backport of 62125: Fix typos in database modules and their integration tests (#62173) 6 years ago
Andrey Klychkov 255754a4d1 Backport of 62194: fix typos in cloud modules (#62277) 6 years ago
Jordan Borean 770e10ca60 win_template - use shared doc fragment for shared options (#59701) (#59828)
* win_template - use shared doc fragment for shared options (#59701)

* win_template - use shared doc fragment for shared options

* Change smart quote to em dash and fix whitespace issue

(cherry picked from commit 652bfc7e19)

* template - move backup to its own doc (#59893)

* template - move backup to its own doc

* Use the backup doc fragment for template

(cherry picked from commit 737a500a30)
6 years ago
Sam Doran b9769abde7 [stable-2.8] test: disable the docker swarm tests (#61816) (#61862)
`docker_swarm` tests tend to hang during the creation of the Swarn
cluster.

See: https://github.com/ansible/ansible/issues/61815
(cherry picked from commit 7132466327)

Co-authored-by: Gonéri Le Bouder <goneri@lebouder.net>
6 years ago
Strahinja Kustudic e7fcb37e6c Fix extended loop_control with includes (#61231)
* Fix extended loop_control with includes

* Use assert for testing extended loop_control

* fix typo

(cherry picked from commit a213b9160c)
6 years ago
kucharskim c087030e5c [stable-2.8] Allow 13 asterisk characters in password field without warning (#54893)
On OpenBSD, 13 asterisk characters as a password hash, marks the
account as disabled. Otherwise daily(8) script which executes
security(8) will email operator about not properly locked accounts.

Before the diff, we see following warning:

> [WARNING]: The input password appears not to have been hashed. The 'password' argument must be encrypted for this module to work properly.

After the diff, warning is gone..
(cherry picked from commit 1dea661ce8)

Co-authored-by: kucharskim <mikolaj@kucharski.name>
6 years ago
Jordan Borean 7c752a43b3 Set win_pagefile as unstable as thats what it is (#61732)
(cherry picked from commit 00add5b668)
6 years ago
Kevin Breit 6310e96034 [stable-2.8] - meraki_syslog - Properly handle net_id (#61744)
* meraki_syslog - Module properly handles net_id parameter (#57286)

(cherry picked from commit a50b3d7695)

* Add changelog fragment and clean up commented tests
6 years ago
Andrey Klychkov e1922be671 postgresql: Run all tests under postgres_* (#61676)
* Make sure postgresql tests are run for all postgres_* modules (#61647)

(cherry picked from commit 4d057e0331)

* Make sure postgresql tests are run for all postgres_* modules (#61647), remove non-existent
6 years ago
Paul Belanger d71d111c3a Fix nxos_install_os test cases typo (#58825)
This should be ansible_connection, not connection_type. We can also
update local testing logic.

Remove nxos_install_os/tasks/network_local.yaml as it is nolonger used.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
(cherry picked from commit 9e1b19e364)
6 years ago
rob8714 9fe0971004 Backport/2.8/57418 (#60683)
* Backport to stable-2.8: Fix #56640: Map k8s ansible keys to api keys (#57418)

* Fix #56643: Map ansible keys to api keys

* Remove errant print line

* Fix pep8 issue

* Fix doc line

* Added test for validate_certs -> verify_ssl translation for k8s module

(cherry picked from commit 6e94b472e8)

* Removed proxy from AUTH_ARG_MAP and added fragment for backport

* Rename backport-57418.yaml to 60683-backport-57418.yaml

* Update 60683-backport-57418.yaml
6 years ago