Commit Graph

7972 Commits (eb1995d41d8cb5967b86efa57faad91c4fdb6f5c)

Author SHA1 Message Date
Gonéri Le Bouder 659147b2e2 VMware: not ssl.SSLContext if validate_certs false (#57185)
Python < 2.7.9 does not have the ssl.SSLContext attribute.
ssl.SSLContext is only required when we want to validate the SSL
connection. If `validate_certs` is false, we don't initialize the
`ssl_context` variable.

Add unit-test coverage and a little refactoring:

- avoid the use of `mocker`, when we can push `monkeypatch` which is
  `pytest`'s default.
- use `mock.Mocker()` when possible

closes: #57072
(cherry picked from commit 3ea8e0a144)
5 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>
5 years ago
Sam Doran 446df8d2cb [stable-2.8] Use new version of default test image that contains Python 3.8.0b3 (#60139)
(cherry picked from commit a20848bf66)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 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)
5 years ago
Wojciech Wypior 99f9eab19d fixes assert statements in tests (#59998)
(cherry picked from commit d00aaf66d7)
5 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>
5 years ago
Jordan Borean 7c752a43b3 Set win_pagefile as unstable as thats what it is (#61732)
(cherry picked from commit 00add5b668)
5 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
5 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
5 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)
5 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
5 years ago
Mitsuru Nakakawaji db9cb0682d fix: docker_swarm_service does not publish both tcp and udp ports (#60616)
* fix: docker_swarm_service does not publish both tcp and udp ports for same published port

* fix the linting problems and add the changelog fragment.

* add test

* modify test to ensure result rather than return value

(cherry picked from commit 064cd63f3d)
5 years ago
Felix Fontein 06623fb79a openssl_certificate: fix idempotency (#60745)
* Fix openssl_certificate idempotency.

* Add changelog.

* Add integration test.

(cherry picked from commit 0d88ec241f)
5 years ago
Sam Doran 0bc1285987 [stable-2.8] fixes issue with recieve parameter idempotency (#59999) (#60541)
* [stable-2.8] fixes issue with recieve parameter idempotency (#59999)

fixes assert statements in unit tests
(cherry picked from commit c9a9621a02)

Co-authored-by: Wojciech Wypior <w.wypior@f5.com>

* Add changelog
5 years ago
Gonéri Le Bouder e352e7223e Update Fedora 29 test image
(cherry picked from commit 3d78dad84b)
5 years ago
Swartz, Nathan 3cbe15aae9 Add thin-volumes to the netapp_e_lun_mapping update_mapping_info method. 5 years ago
Sam Doran 49935b1e95 [stable-2.8] Fix sanity tests based on newer version of shellcheck (#60423) (#60442)
* [stable-2.8] Fix sanity tests based on newer version of shellcheck (#60423)

- change egrep to grep -E
- store exit codes and check them directly
- ignore SC1091.
(cherry picked from commit c485a1b91e)

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

* Fix sanity test
5 years ago
Jordan Borean d112106985 Move windows test to another group (#60391)
(cherry picked from commit 35b87b8633)
5 years ago
Maxim Babushkin 282ab4cb72 openssh_keypair - Add public key and key comment validation (#57993)
- Split the key validation to separate private and public.
- In case public key does not exist, recreate it.
- Validate comment of the key.
- In case comment changed, update the private and public keys.

(cherry picked from commit 27e414200f)
5 years ago
Sam Doran b51fdab9ea [stable-2.8] Fix unit tests to work with pytest >= 5.0 (#60246) (#60332)
pytest made a change in the way the message from ExceptionInfo objects was returned.

https://docs.pytest.org/en/latest/changelog.html#pytest-5-0-0-2019-06-28.
(cherry picked from commit 2d266fbc87)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sam Doran a6eec912c7 [stable-2.8] Pin openshift <=0.9.0 to prevent test failures (#60245)
(cherry picked from commit 9cb47832d1)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sam Doran fa0cd3782f [stable-2.8] Move assertion in unit test inside loop (#60232)
(cherry picked from commit aa717661af)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Yaakov Selkowitz 5d3f0fe02c facts: fix double-counting of CPUs on POWER systems (#58360)
On POWER systems, /proc/cpuinfo provides a 'processor' entry as a
counter, and a 'cpu' entry with a description (similar to 'model name'
on x86). Support for POWER in get_cpu_facts was added via the 'cpu'
entry in commit 8746e692c1.  Subsequent
support for ARM64 in commit ce4ada93f9
used the 'processor' entry, resulting in double-counting of cores on
POWER systems.

When unit tests were later written for this code in
commit 55306906cf, the erroneous values
were just accepted in the test instead of being diagnosed.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
(cherry picked from commit 93d9d64038)
5 years ago
Jordan Borean a0afc2d656 Move win target back a group (#60257)
(cherry picked from commit 534a40c5cd)
5 years ago
Jordan Borean bc06946581 Added group 7 to Windows groups - ci_complete (#60240)
(cherry picked from commit 81cb6f366a)
5 years ago
Jordan Borean c2abfd8c4d Remove Python 2.6 from Windows tests (#60235)
(cherry picked from commit 3a3727d200)
5 years ago
Jill R 08e23a2a93 Don't truncate cidr_ipv6 addresses in ec2_group.py (#59106)
* Better cidr_ipv6 validation in ec2_group.py

* Improve warning/error handling, add changelog

* Update unit test for ipv6 validation

* Fix logic that was causing non /128 cidrs with host bits to not be handled

(cherry picked from commit 4308b87d72)
5 years ago
Matt Martz f44eb33000 [stable-2.8] Move plugin loader playbook dir additions back to Playbook instead of PlaybookCLI (#59557)
* Move plugin loader playbook dir additions back to Playbook instead of PlaybookCLI. Fixes #59548

* Restore cli additions
(cherry picked from commit 923e218)

Co-authored-by: Matt Martz <matt@sivel.net>
5 years ago
Lukas Kämmerling 4f763037b0 [stable-2.8] Fix hcloud tests
(cherry picked from commit 6c1a255d98)

Co-authored-by: Lukas Kämmerling <lukas.kaemmerling@hetzner-cloud.de>
5 years ago
Sam Doran adc494a9e1 [stable-2.8] Change dummy package name in yum/dnf tests to not collide with an actual package (#60225)
When targeting 'foo*' in tests, it pulled in packages other than the dummy packages in our testing repo that have many dependencies, some of which were causing tests to fail.

Also change 'bar' package name to avoid the same issue in the future.
(cherry picked from commit 47796af64f)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Felix Fontein feb39dc35a docker_container: fix port bindings with IPv6 addresses (#59715)
* Pass IPv6 addresses for port bindings without square brackets.

* Add changelog.

* Add test.

(cherry picked from commit a7573102bc)
5 years ago
Ruediger Pluem 22ab4683df Only error out if the gid exists with a different group name (#59769)
Only error out if the gid exists with a different group name as
otherwise it will error out if the group with this gid already
exists, like on a rerun of the playbook. This fixes a regression
introduced by 4898b0a4a298448677c2aee2a03157ba5b662759.(cherry picked from commit f94772f807)
5 years ago
Jordan Borean 04ca93a5c0 Rebalance Windows CI groups based on recent delays to 2016 (#59838)
* Change to test out server 2016 CI issues

* ci_complete

(cherry picked from commit 349b2bdf43)
5 years ago
flowerysong 38a7dfca26 aws_s3: Improve ETag handling (#46332)
* cosmetic: Remove useless call to ec2_argument_spec()

* aws_s3: Improve ETag handling

* Extract ETag calculation into a utility function for reuse by
  aws_s3_sync.
* Reduce code duplication in put/get by restructuring the logic
* Only calculate ETag when overwrite == different
* Fail gracefully when overwrite == different and MD5 isn't available
  (e.g. due to FIPS-140-2).

* aws_s3: clean up integration tests

Clean up tests, add tests for overwrite settings in both directions.

(cherry picked from commit c513c1e2d3)
5 years ago
Sam Doran b2c43bd2b7 [stable-2.8] Wait for Ansible Tower instance to be ready
(cherry picked from commit ea209e1c2f)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Brian Coca 67fe363297 Fix strat inv (#58982)
* Fix strategy functions that update inventory

* added tests


(cherry picked from commit a7b14ec1be)
5 years ago
Sam Doran fd7b4238e2 [stable-2.8] Update constraints for coverage on Python 3.8 (#59733)
This fixes the unit tests hanging when run with Python 3.8 with coverage enabled
(cherry picked from commit ed4a729fd6)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Maciej Delmanowski 703618336f [stable-2.8] Don't warn if local user is found in user database (#56838)
If the 'local' parameter of the 'user' Ansible module is enabled, and
the user has been found in the local user database, don't emit
a warning, because this is an expected outcome.

Add changelog and integration tests

Co-authored-by: drybed <drybjed@gmail.com>
(cherry picked from commit 75be309242)

Co-authored-by: Maciej Delmanowski <drybjed@drybjed.net>
5 years ago
Sam Doran d6e7011d14 [stable-2.8] Order data in xml integration test (#59742)
A recent update to lxml for Python >= 3.6 now preserves key order. Change the test input so the input is sorted, making tests pass on previous versions of lxml as well as the latest version.
(cherry picked from commit 19299f3310)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Sam Doran ce59df01e3 [stable-2.8] Fix podman_image integration tests (#59805)
Pin podman package at a specific version
(cherry picked from commit 691976c3d0)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Pilou 11e087ff7a consul_session: improve documentation and add integration tests (#56392) (#59357)
* consul_session: Python 2.6 is always required on managed node
* consul_session: document all types
* consul_session: add doc for 'id' parameter
* consul_session: improve parameter descriptions
    - use formatting functions in descriptions
    - 'name' parameter is required when state=node
* consul_session: use required_if
* consul_session: add integration tests
* consul_session: use 'retry' with network dependent tasks
* Use ansible-ci-files bucket for consul binaries

Co-Authored-By: Matt Clay <matt@mystile.com>
(cherry picked from commit 5f8080aaa0)

* add a changelog fragment
5 years ago
Strahinja Kustudic 6b4f153459 sysctl - Reload also when current system values differ (#56153)
Previously if `sysctl_set=no` (which is the default) this module only
checked for changes in the sysctl.conf file to decide whether it should
reload it or not. This means that if the values in the conf file are the
same as they are set with the module, but the current values on the
system are different, that this module wouldn't apply the changes on the
system and thus the value set with the module wouldn't be applied on the
OS. This isn't obvious and it doesn't make sense that the module works
like that by default, especially because there is a separate option
`reload`. Now sysctl will also check if the current value differs on the
system and if it does, it will reload the file again.

(cherry picked from commit 5fc769f6b1)
5 years ago
Sumit Jaiswal 35ba55599a PR to implement ansible_net_model for iosxr facts module (#58488)
* resolves 57767

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* added test

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
(cherry picked from commit 539f37ede3)

Handle lowercase in version info (#59565)

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
(cherry picked from commit 3a103405b1)

Add changelog for iosxr_facts fix

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
5 years ago
Sam Doran 95fd0d58e6 [stable-2.8] Make docker swarm integration tests more reliable (#59473)
(cherry picked from commit 3ceeae0de9)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Martin Krizek ed027203c6 2.8: Clear 'connection related' plugin vars for next loop iteration (#59024) v2 (#59510)
* Clear 'connection related' plugin vars for next loop iteration (#59024)

Fixes #58876

(cherry picked from commit a752e2a467)

* Preserve original variables when using a loop (#59426)

Fixes #59414

(cherry picked from commit 1010363c0b)
5 years ago
Toshio Kuratomi e08427a138 Correct places where match was intended
pytest.raises has two parameters, message and match.  message is meant
to be the error message that pytest gives when the tested code does not
raise the expected exception.  match is the string that pytest expects
to be a match for the repr of the exception.  Unfortunately, it seems
that message is often mistakenly used where match is meant.  Fix those
cases.

message is also deprecated so removed our usage of it.  Perhaps we
should write a sanity test later that prevents the use of
pytest.raises(message) to avoid this mistake.

seealso: https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises

Also update the exception message tested for as we're now properly
detecting that the messages have changed.

(cherry picked from commit 87601969a3)

Fix root filter test

On python-2.6 the error message is different

(cherry picked from commit 67fb3a8215)

Fix the pytest match test for python-2.6

(cherry picked from commit 8a880d6032)
5 years ago
Toshio Kuratomi e2c8a64b45 [stable-2.8] Fix for skipping of gitlab_runner test.
Correct variable name for skipping of the gitlab test when gitlab python
client is not installed.
(cherry picked from commit 0c992d5ae4)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
5 years ago
Felix Fontein b64f3b3b98 [stable-2.8] Re-enable docker_container tests (#59425)
Mark dependent container's ipc_mode as shareable
(cherry picked from commit 266d6e77a9)

Co-authored-by: Felix Fontein <felix@fontein.de>
5 years ago
Sam Doran fc684b6204 [stable-2.8] Mark Docker tests unstable (#59408)
* Mark Docker tests unstable

- docker_swarm is unstable on RHEL 8
- docker_container is unstable on RHEL 7

* Disable docker_container test.
(cherry picked from commit 67c69f3)

Co-authored-by: Sam Doran <sdoran@redhat.com>
5 years ago
Noe Gonzalez 18fc915b15 [2.8] VMware: Fix vmware_guest cloning bug
* fix vmware_guest cloning bug
* added tests for resizing disks during clone

(cherry picked from commit 3a5d13b0d7)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago