Commit graph

7945 commits

Author SHA1 Message Date
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>
2019-08-09 13:51:14 -07:00
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>
2019-08-07 13:50:31 -07:00
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>
2019-08-07 12:13:11 -07:00
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)
2019-08-07 12:10:49 -07:00
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)
2019-08-07 11:59:25 -07:00
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)
2019-08-07 09:05:29 -07:00
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)
2019-08-07 07:41:06 -07:00
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>
2019-08-02 13:58:26 -07:00
Brian Coca
67fe363297 Fix strat inv (#58982)
* Fix strategy functions that update inventory

* added tests


(cherry picked from commit a7b14ec1be)
2019-08-02 09:40:28 -07:00
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>
2019-07-31 10:36:34 -07:00
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>
2019-07-31 10:30:46 -07:00
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>
2019-07-30 21:17:22 -07:00
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>
2019-07-30 17:30:41 -07:00
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
2019-07-30 17:21:44 -07:00
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)
2019-07-30 13:14:21 -07:00
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>
2019-07-30 12:17:20 -07:00
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>
2019-07-30 12:07:14 -07:00
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)
2019-07-29 14:48:31 -07:00
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)
2019-07-29 12:08:15 -07:00
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>
2019-07-26 15:18:31 -07:00
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>
2019-07-24 09:15:08 -07:00
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>
2019-07-22 18:59:41 -07:00
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>
2019-07-22 18:43:53 -07:00
Martin Krizek
89d5830da0 2.8: Revert "Speed up VariableManager by preserving Templar state. (#45572)" (#59280) (#59373)
* Revert "Speed up VariableManager by preserving Templar state. (#45572)" (#59280)

This reverts commit 6069d09b9d.

Fixes #57351

(cherry picked from commit b7868529ee)

* Add changelog for #59280 (#59380)


(cherry picked from commit d6b1376006)
2019-07-22 17:07:46 -07:00
Tyler Ramer
6e9c928817 [2.8] Address regression causing bootproto=dhcp for manual IP addresses
Commit b7724fdf85
appears to have caused a regression, where `ip4`, `gw4`, `ip6`, `gw6`
were converted to `ipv4.address`, `ipv4.gateway` etc.

This causes bootproto (or `ipv4.method`) to remain `dhcp`, as noted in https://github.com/ansible/ansible/issues/36615

This commit only reverts the key-value pairs to the original names,
which is in line with both expectation (manual ip addr == no dhcp) and
the language used in the playbook, which is, for example, "ip4" not
"ipv4.address"

Co-authored-by: Stuart Pollock <spollock@pivotal.io>
Co-authored-by: Tyler Ramer <tramer@pivotal.io>
(cherry picked from commit 8d0f2e5725)
2019-07-22 17:03:59 -07:00
Sam Doran
e0dbe1bf26 [stable-2.8] Omit -A and -G options in local mode since luseradd does not support these (#55401) (#58480)
* [stable-2.8] Omit -A and -G options in local mode since luseradd does not support these (#55401)

Add integration tests
(cherry picked from commit 20ad120829)

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

* User - make groups and append mutually exclusive with local (#59309)

* Update intigration tests

(cherry picked from commit 8edad83ae0)
2019-07-22 16:48:28 -07:00
Abhijeet Kasurde
302de41a31 [2.8] VMware: Accept 0 as valid value for memory reservation
vmware_guest accepts 0MB as valid value for memory reservation in
virtual machine hardware configuration. This fixes the regression
introduced via 193f69064f.

Fixes: #59190

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 1f49abb51c)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-22 16:37:02 -07:00
Jordan Borean
e5f68cad5a Fix win_reg_stat for HKU hives (#59359)
(cherry picked from commit 2f2b106423)
2019-07-22 16:35:06 -07:00
Sloane Hertel
6c14bdeb7e disable s3_lifecycle tests (#59311)
(cherry picked from commit 1d3f2c7764)
2019-07-22 16:24:57 -07:00
Sam Doran
2f5c3b3cb4 [stable-2.8] Handle situation where ansible_architecure may not be defined when gathering facts (#55466)
(cherry picked from commit f231f21669)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2019-07-22 16:22:04 -07:00
Sam Doran
4f939d4b2b [stable-2.8] Move integration tests to using RHEL 8.0 GA (#57772).
(cherry picked from commit b9dafdbade)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2019-07-22 15:20:32 -07:00
Wojciech Sciesinski
b373d45839 Correct a documentation of the jenkins_plugin module (#59331)
It's a backport of #59139
2019-07-22 16:11:53 -05:00
Sam Doran
a5178d8a34 Add pslint ignore rules 2019-07-22 13:59:02 -07:00
Sam Doran
9c391ea78e [stable-2.8] Update default test container to use Python 3.8.0b2 (#58877).
(cherry picked from commit 5ccd674dba)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2019-07-22 13:59:02 -07:00
Sam Doran
f837444a77 [stable-2.8] Add test for meta: end_play (#59118)
- Set ansible_python_interpreter for hosts using local connection
(cherry picked from commit d17e7a91b1)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2019-07-17 15:32:26 -07:00
Martin Krizek
0d86a4dbaa group: detect duplicate GIDs when local=yes (#58469)
(cherry picked from commit 4898b0a4a2)
2019-07-17 14:30:55 -07:00
Pilou
afb91e5140 [2.8] tower_role: ensure alias of "validate_certs" parameter is handled
* tower_role: ensure alias of validate_certs is handled

* tower modules: remove tower_verify_ssl alias too

Error was:

    Failed to update role: The Tower server claims it was sent a bad request.
    GET https://tower/api/v2/projects/22/object_roles/
    Params: [('tower_verify_ssl', False), ('role_field', 'admin_role')]
    Data: None
    Response: {"detail": "Role has no field named 'tower_verify_ssl'"}

Full traceback:

    File "/tmp/ansible_tower_role_payload_7_2p0X/__main__.py", line 145, in main
      result = role.grant(**params)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/resources/role.py", line 365, in grant
      return self.role_write(fail_on_found=fail_on_found, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/resources/role.py", line 242, in role_write
      fail_on_multiple_results=True, **data)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/models/base.py", line 301, in read
      r = client.get(url, params=params)
    File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 546, in get
      return self.request('GET', url, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/api.py", line 299, in request
      kwargs.get('data', None), r.content.decode('utf8'))

(cherry picked from commit 77e01e6abc)
2019-07-17 12:44:31 -07:00
Sloane Hertel
d170588ab6 [2.8] Define region for aws_secret (#58722)
* AWS: Fix KeyError in aws_secret lookup (#54792)

(cherry picked from commit 33d0d36eaa)

* changelog
2019-07-17 12:11:24 -07:00
pratikgadiya12
0f292cd886 nmcli: Argument vlanid (int) is changed internally to string (#58963)
* Argument vlanid (int) is changed internally to string
* Modified test case to check vlan id

Fixes: #58949
(cherry picked from commit e8f4ebb22c)
2019-07-16 17:57:45 -07:00
Martin Krizek
d3afa17930 Use templated loop_var/index_var when looping include_* (#58866)
Fixes #58820

(cherry picked from commit 7346b699ee)
2019-07-16 15:11:57 -07:00
Sam Doran
04762f1c26 [stable-2.8] Improve setup_docker tests to work with RHEL 8 GA (#58649)
- use include_vars to set appropriate packages and pip packages per distribution and version
- install an older version of Docker CE on RHEL 8 since a dependency is unavailable
- disable warnings on tasks that are ok
- skip tests for CentOS/RHEL 6
(cherry picked from commit d50c8c2b83)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2019-07-16 14:18:54 -07:00
Sam Doran
6e0f2a37aa [stable-2.8] Improve dnf test formatting and fix RHEL 8 module name (#58648)
- use single include_vars task rather than multiple set_fact tasks
- use multi-line YAML to break up long conditionals
- use version() test rather than direct comparisions
- use different appstream package on RHEL since '@swig:3.0/default' is not working in the GA
(cherry picked from commit 16d6fcf514)

Co-authored-by: Sam Doran <sdoran@redhat.com>
2019-07-16 14:06:10 -07:00
lijok
7e8b81ae18 [2.8] VMware: looking up maxMksConnections in incorrect location
maxMksConnections is contained in vim.vm.ConfigInfo not vim.vm.VirtualHardware

Fixes: #58060

Signed-off-by: lijok <28689084+lijok@users.noreply.github.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 63bdd0d6cd)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-16 14:01:56 -07:00
Jordan Borean
e8450891ba Load Ansible module_utils for ps_argspec validator (#58571)
* Load Ansible module_utils for ps_argspec validator

* fix validation for modules without Requires statement

* Moved future comment to proper location

(cherry picked from commit c3978fed4b)
2019-07-16 12:10:09 -07:00
Jordan Borean
014b7ecc07 win_domain_user: do not hide error on failures (#58357)
* win_domain_user: do not hide error on failures

* Was a bit too overzealous in the removal

* Remove uneeded sanity ignore rule

(cherry picked from commit c260721ce5)
2019-07-16 12:05:20 -07:00
Felix Fontein
dd758f582a openssl_privatekey: forgot to add secp256r1 (#58605)
* Forgot to add secp256r1. This one is the interoperable one.

* Add changelog.

(cherry picked from commit 5d5a7d6ebe)
2019-07-16 12:04:37 -07:00
Abhijeet Kasurde
0306b9a907 [2.8] VMware: Set vapp settings while creating VM
vApp Settings can be set while creating VM.

Fixes: #50617

(cherry picked from commit 760dc19284)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-16 11:56:14 -07:00
Martin Krizek
28077887c2 2.8: yum: take care of stale/invalid yum.pid (#58457) (#58489)
* yum: take care of stale/invalid yum.pid (#58457)

* yum: take care of stale/invalid yum.pid

* Add changelog

(cherry picked from commit 5064e67d37)

* yum: check whether the lock file disappeared (#58581)


(cherry picked from commit b0f38931b0)
2019-07-15 13:58:53 -07:00
anshulbehl
840d869c22 Backport/2.8/58936 (#58939)
* Changing LBName used by same task inside azure_rm_loadbalancer (#58936)

fixes #58933

(cherry picked from commit 00d7aed56b)

* Backporting #58933 to stable-2.8
2019-07-10 19:34:21 -07:00
Sam Doran
6e7fcf38a8 [stable-2.8] Get minor version number for CentOS and Debian (#57814) (#58538)
* [stable-2.8] Get minor version number for CentOS and Debian (#57814)

* Get the most detailed version number from distro.version() for CentOS and Debian
* Update tests and fixtures
* Update fixture generation script to gather distro info and work with Python 3
* Update LinuxMint fixtures
* Cleanup fixture formatting
* Improvements based on feedback from abadger:
    - use unicode since that is what distro returns
    - use frozenset with a tuple
    - include link Debian to bug
(cherry picked from commit ab6a9ef130)

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

* Add a changelog for the version number in facts change
2019-06-30 16:59:38 -07:00