Commit Graph

8028 Commits (70b577ab097ea4ebffe69fa3bdb13867e20085c7)

Author SHA1 Message Date
Sam Doran 5e411807e7 [stable-2.8] ansible-test - add constraint for virtualenv (#67289)
* ansible-test - add constraint for virtualenv

* Limit virtualenv only on macOS.

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

Co-authored-by: Sam Doran <sdoran@redhat.com>
6 years ago
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 2d2c841ded [stable-2.8] Ignore warnings in ansible-test environment check.
(cherry picked from commit 3db1ac4f56)

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
Matt Clay bbbde15562 [stable-2.8] Add ansible-test constraint to avoid coverage 5.0+
(cherry picked from commit 9ea5b539b6)

Co-authored-by: Matt Clay <matt@mystile.com>
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
Bojan Vitnik 1855494378 XenServer: Update docs with recent changes in XenAPI python lib and branding (#63728) (#63816)
- xenserver module_util: XenAPI lib import error message handling is now
   ported to missing_required_lib(). Updated unit tests.
 - xenserver_guest, xenserver_guest_info, xenserver_guest_powerstate modules:
   docs are updated to reflect recent changes in availability of XenAPI lib
   on PyPI.
 - xenserver_guest, xenserver_guest_info, xenserver_guest_powerstate modules:
   docs are updated to reflect recent Citrix rebranding of XenServer. Broken
   URLs to external resources are fixed.
 - xenserver_guest, xenserver_guest_info, xenserver_guest_powerstate modules:
   more tested platforms are mentioned in docs.

(cherry picked from commit 7afba9420a)
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
Matt Clay 34c76bf2a1 [stable-2.8] Switch from RHEL 8.0 & 8.1b to 8.1 in CI.
(cherry picked from commit 75646037dc)

Co-authored-by: Matt Clay <matt@mystile.com>
6 years ago
Felix Fontein 5eac93e7fd [2.8] Fix return value documentation (2/2) (#63534)
* Fix return value documentation (2/2) (#63478)
* Avoid validation errors for missing 'contains:'.
* Convert JSON text to JSON dict.
* example -> sample.
* Fix YAML.

(cherry picked from commit 4bc298af83)

* Update validate-modules/ignore.txt.
6 years ago
Felix Fontein 293ae8030b [2.8] Fix return value documentation (1/2) (#63517)
* Fix return value documentation (1/2) (#63477)
* Avoid validation errors for missing 'contains:'.

(cherry picked from commit 6bea1597cc)

* Add validate-modules/ignore.txt entries.
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 5b0a67062a [stable-2.8] Work around ssh-keygen issue in ansible-test. (#63211)
Newer versions of ssh-keygen create PEM keys that are not recognized by Paramiko.

Now ansible-test compensates for this by updating they keys it generates so Paramiko will recognize them..
(cherry picked from commit 022335669c)

Co-authored-by: Matt Clay <matt@mystile.com>
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 e80a771f84 Limit Shippable matrix check to ansible repo.
(cherry picked from commit ada02f1966)
6 years ago
Matt Clay 68de8e1986 Replace old shippable.py with new check_matrix.py. (#60022)
This new script does not depend on ansible-test and provides much more robust job matrix testing.

It is also run on every job in the matrix now, to detect issues with jobs being re-run after matrix changes are made.

(cherry picked from commit d3da8e4a5b)
6 years ago
Matt Clay f43110b0ed [stable-2.8] Mark ansible-test cloud credentials as sensitive..
(cherry picked from commit 9f7b124a6f)

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
Sam Doran 08bff987d9 [stable-2.8] Split unit tests into two groups (#61528) (#62070)
* [stable-2.8] Fix ansible-test coverage path handling. (#61528)

* Fix ansible-test coverage path handling.
* Split CI unit tests into two groups..
(cherry picked from commit e4e5005640)

Co-authored-by: Matt Clay <matt@mystile.com>

* Increase unit test timeout to account for long image download times (#61717)

(cherry picked from commit c9e7a2122d)
6 years ago