Commit graph

6217 commits

Author SHA1 Message Date
Kevin Breit
0f4c6793f9 meraki_admin - Add documentation for tags and network access (#51415)
* Add documentation for tags and network access
* Documentation changes from dag and sam
* Change examples to include proper YAML and not dict
* Update lib/ansible/modules/network/meraki/meraki_admin.py

Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
(cherry picked from commit bcbcd209f4)
2019-03-25 13:57:13 -07:00
René Moser
ae5e6b5aef [2.7] include_tasks: fix traceback if no file specified (#54044) (#54164)
* include_tasks: fix traceback if no file specified (#54044)



(cherry picked from commit c5609c51bf)

* fix typo
2019-03-22 11:35:16 -07:00
Matt Clay
e55cd56bd9 [stable-2.7] Disable failing azure_rm_managed_disk test.
(cherry picked from commit 1a286a95e5)

Co-authored-by: Matt Clay <matt@mystile.com>
2019-03-21 07:10:47 -07:00
Matt Clay
dedd76899a [stable-2.7] Pin the ansible-runner version in tests.
The tests need to be updated to support newer ansible-runner releases.
(cherry picked from commit 777b726e4f)

Co-authored-by: Matt Clay <matt@mystile.com>
2019-03-20 15:31:55 -07:00
Matt Clay
a4dc6b78eb [stable-2.7] Add constraint for deepdiff.
(cherry picked from commit 9a135fbcef)

Co-authored-by: Matt Clay <matt@mystile.com>
2019-03-19 15:18:52 -07:00
Lars Kellogg-Stedman
e8dcf0f088 fix constructed functionality in openstack inventory plugin
This is a backport of #48833 for stable-2.7.

The compose, groups, and keyed_groups functionality of the openstack
inventory plugin was broken:

- the plugin was not passing the correct variables to the
  Constructable methods for compose and groups
- the plugin was simply never calling the appropriate method for
  implementing keyed_groups

This commit fixes both issues.

(cherry picked from commit 5a9c7676620d4971eb6ce8d4014e3636b21e3f03)
2019-03-19 15:16:50 -07:00
Toshio Kuratomi
8856a01eab Revert "Add constraint for deepdiff."
This reverts commit 05772233ad.

I mistakenly merged this before it hit devel.  The devel change was
modified to change this in a different place.  Reverting so that we can
make that fix properly.
2019-03-19 14:25:30 -07:00
Matt Clay
05772233ad Add constraint for deepdiff.
This is a backport of #54036.

(cherry picked from commit 12612a4e748e0b1f1bfe28d67fc8eb772350dd5f)
2019-03-19 11:59:14 -07:00
Jordan Borean
a11a56f27d win_psexec - support paths with a space (#54009)
(cherry picked from commit 7ab77f6c8a)
2019-03-19 11:09:55 -07:00
Jordan Borean
22c540a7c5 Use shared remote_tmp_dir to simplfy tests (#53721)
(cherry picked from commit b044bb431e)
2019-03-19 11:09:55 -07:00
Jordan Borean
16be92f480 win_copy - fix glob like paths (#54006)
(cherry picked from commit 2f1bc34589)
2019-03-19 11:09:55 -07:00
Jordan Borean
0668265bdb win_certificate_store - fix glob like paths (#54007)
(cherry picked from commit eb18df1a0f)
2019-03-19 11:09:55 -07:00
Jordan Borean
ee3a7033fd win_find - fix glob like paths (#54005)
(cherry picked from commit 8a4079ddbf)
2019-03-19 11:09:55 -07:00
Jordan Borean
c8914a1678 windows - Fix module utils with glob paths (#53835)
* windows - Fix module utils with glob paths

* fix link util tests when using DOS 8.3 paths

(cherry picked from commit 980ca564ce)
2019-03-18 14:32:53 -07:00
Jordan Borean
19385f1ee1 win_slurp - fix glob like paths (#53831)
(cherry picked from commit d00418c924)
2019-03-18 14:32:53 -07:00
Jordan Borean
edfc44ec51 win_owner - fix glob like paths (#53830)
* win_owner - fix glob like paths

* Fix issues on older PS versions

(cherry picked from commit d063cefb64)
2019-03-18 14:32:53 -07:00
Jordan Borean
f9e6a89993 win_acl_inheritance - fix glob like paths (#53829)
(cherry picked from commit 3cfa71bff0)
2019-03-18 14:32:53 -07:00
Jordan Borean
73bf34ed41 win_acl - fix glob file paths (#53828)
(cherry picked from commit aba6f5f50d)
2019-03-18 14:32:53 -07:00
Jordan Borean
b0c6499b60 win_tempfile - return absolute path on created temp file (#53827)
* win_tempfile - return absolute path on created temp file

* Fix tests for CI

(cherry picked from commit 4f9de45785)

8
2019-03-18 14:32:53 -07:00
Felix Fontein
1cd21e2f50 Only use ports in the range 9001-9060.
(cherry picked from commit 77f7e5a986)
2019-03-18 14:32:18 -07:00
Sam Doran
833b29b39c [stable-2.7] Correctly count processors on ARM systems. (#52884) (#53798)
* [stable-2.7] Correctly count processors on ARM systems. (#52884)

- Add unit tests for Linux CPU info
- Add cpuinfo output from several systems for unit tests

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 55306906cf)

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

* Add changelog
2019-03-18 14:29:37 -07:00
Toshio Kuratomi
aa859597b1 Make the timeout decorator raise an exception out of the function's scope (#49921)
* Revert "allow caller to deal with timeout (#49449)"

This reverts commit 63279823a7.

Flawed on many levels

* Adds poor API to a public function
* Papers over the fact that the public function is doing something bad
  by catching exceptions it cannot handle in the first place
* Papers over the real cause of the issue which is a bug in the timeout
  decorator
* Doesn't reraise properly
* Catches the wrong exception

Fixes #49824
Fixes #49817

* Make the timeout decorator properly raise an exception outside of the function's scope

signal handlers which raise exceptions will never work well because the
exception can be raised anywhere in the called code.  This leads to
exception race conditions where the exceptions could end up being
hanlded by unintended pieces of the called code.

The timeout decorator was using just that idiom.  It was especially bad
because the decorator syntactically occurs outside of the called code
but because of the signal handler, the exception was being raised inside
of the called code.

This change uses a thread instead of a signal to manage the timeout in
parallel to the execution of the decorated function.  Since raising of
the exception happens inside of the decorator, now, instead of inside of
a signal handler, the timeout exception is raised from outside of the
called code as expected which makes reasoning about where exceptions are
to be expected intuitive again.

Fixes #43884

* Add a common case test.

Adding an integration test driven from our unittests.  Most of the time
we'll timeout in run_command which is running things in a subprocess.
Create a test for that specific case in case anything funky comes up
between threading and execve.

* Don't use OSError-based TimeoutError as a base class

Unlike most standard exceptions, OSError has a specific parameter list
with specific meanings.  Instead follow the example of other stdlib
functions, concurrent.futures and multiprocessing and define a separate
TimeoutException.

* Add comment and docstring to point out that this is not hte Python3 TimeoutError

(cherry picked from commit bd072fe83a)
2019-03-18 12:55:37 -07:00
Jordan Borean
799b51ba0b Handle binary files when scanning metadata in python 3 (#53773) (#53784)
(cherry picked from commit c2466c545b)
2019-03-18 12:54:30 -07:00
Jordan Borean
4840952f3d win_reboot - Fix rc validation when using psrp and add extra docs - 2.7 (#53718)
* win_reboot - Fix rc validation when using psrp and add extra docs (#53711)

* win_reboot - Fix rc validation when using psrp and add extra docs

* Revert boot time command and fix docs

(cherry picked from commit 3d23e47c53)

* win_reboot - fix broken tests after recent commit (#53722)


(cherry picked from commit d9795bad98)
2019-03-18 12:53:28 -07:00
Jordan Borean
f7a1911758 win_psexec: make the tests more stable (#53716) (#53720)
(cherry picked from commit 33939f7fe8)
2019-03-18 12:41:10 -07:00
Jordan Borean
e0db8e6efb win_chocolatey_source - don't rely on cmd to get source info (#53837)
(cherry picked from commit e0c0e9a10b)
2019-03-15 10:10:31 -07:00
Jordan Borean
0a03d0ee0e win_chocolatey - Fix incompatibilities with latest Chocolatey release (#53841)
(cherry picked from commit cac3c6efcf)
2019-03-15 10:10:31 -07:00
Sam Doran
091c7c46d3 [stable-2.7] Ensure Clear Linux parsing is actually parsing a Clear Linux host and all others fall back to NA (#53298) (#53541)
* [stable-2.7] Ensure Clear Linux parsing is actually parsing a Clear Linux host and all others fall back to NA (#53298)

Fixes a bug where parse_distribution_file_ClearLinux() was called on CoreOS (and probably many other distros) and it returned True since it successfully parses the distribution file. Since this file exists on many Linux distributions and they are a very similar format, add an additional check to make sure it is Clear Linux.

Change the order in which distribution files are processed so NA is last. This prevents a match on CoreOS hosts since they also have /etc/os-release and the called matching function for NA is very general and will match CoreOS.

* Add changelog

* Add unit tests

Only add tests for Clear Linux parsing since that was the cause of this issue.
(cherry picked from commit 1d91e03119)

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

* Use different import for 2.7
2019-03-11 15:16:43 -07:00
Felix Fontein
ca63a2a968 docker_container: show warnings, fix/improve tests (#53440)
* Output warnings from docker daemon on container create and update.

* Accept warning for blkio_weight instead of idempotency.

* Value quoting.

* Avoid loop variable conflict.

* Add changelog.

* Make one test case faster.

* Add 'Docker warning: ' prefix.

* Add a generalized warning reporting function.

(cherry picked from commit 3117900b1e)
2019-03-11 13:27:31 -07:00
Matt Martz
07e4ae0806 [stable-2.7] Allow dict2items to work with hostvars (#53538).
(cherry picked from commit 414440e323)

Co-authored-by: Matt Martz <matt@sivel.net>
2019-03-11 13:14:01 -07:00
Jakob Ackermann
3944f51677 [docker_image] fix the changed state for tagging and pushing (#53451)
* [docker_image] fix the changed state for tagging and pushing

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* [docker_image] add tests for (force) tagging and force pushing

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* [docker_image] add a news fragment for the fixed force tag/push behavior

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
(cherry picked from commit 13ab9a61a8)
2019-03-11 12:53:26 -07:00
Jordan Borean
b658139d63 test: fix get_url issues in CI for Ubuntu 14.04
(cherry picked from commit 0f2041abbd)
2019-03-11 12:50:35 -07:00
S
edd7e53b8b Fixed win_file crash with hidden files (#52584)
* Fixed crash with hidden files

added "-force" parameter on "Get-Item" cmdlet. this is needed to get file info if the file is "hidden" 
without this option modules like win_file, win_template, win_copy crashes on hidden files. this is because with "test-path" it sees that the file exists, but "get-item" can't get the file info. 
for more information on "-force option": https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-item

* Add changelog and integration tests

* fix tests for older Windows versions

(cherry picked from commit 3bc474bf99)
2019-03-11 11:53:23 -07:00
Felix Fontein
c4748fd011 openssl_csr: improve subject validation (#53198)
* Improve subject field validation.

* Add country name idempotency test.

* Add failed country name test.

* Add changelog.

(cherry picked from commit b2e992cecd)
2019-03-11 11:52:43 -07:00
Felix Fontein
9135dbd820 Trying to work around spurious test failures. (#53472)
(cherry picked from commit e4f2e15b96)
2019-03-11 11:51:49 -07:00
Sloane Hertel
96aa6babc1 Mark ec2_vpc_vgw as disabled to avoid hitting the resource limit (#53082)
* Mark ec2_vpc_vgw as disabled to avoid hitting the resource limit (#53082)

(cherry picked from commit c4d0c58c5a)
2019-03-08 22:39:38 -08:00
Felix Fontein
3eccd83891 openssl_csr: improve invalid SAN error messages (#53201)
* Improve invalid SAN error messages.

* Add changelog.

(cherry picked from commit 628326b879)
2019-03-06 14:47:40 -08:00
Felix Fontein
3d351c5367 2.7 way to make sure no SANs are there. 2019-03-06 14:46:52 -08:00
Felix Fontein
94b5a03b0e openssl_certificate: make sure extensions are present when they are queried by assertonly (#53207)
* Make sure extensions are present when they are queried by assertonly provider.

* Add changelog.

(cherry picked from commit 6249bb8ea4)
2019-03-06 14:46:52 -08:00
Jordan Borean
8bb830c1b4 win_chocolatey_source - fix state=disabled with no source (#53097)
(cherry picked from commit be7768efc7)
2019-03-06 14:28:41 -08:00
Felix Fontein
ed12e93f73 [stable-2.7] Python 2: accept both long and int for type=int (module options) (#53289)
* Added unit test.
(cherry picked from commit 07fcb60d55)

Co-authored-by: Felix Fontein <felix@fontein.de>
2019-03-06 14:21:51 -08:00
Felix Fontein
5aabb5ea02 docker_swarm: support older docker-py versions (#53129)
* Decreasing docker_swarm requirements.

* Fixing docker-py / docker API version requirements, and some comments.

* Add changelog.

* Only send parameters specified by user to docker daemon.

* Extend labels test: not specifying == keep labels.

* Bump minimally required docker-py version for docker_node and docker_node_facts to 2.4.0.

* Prevent crashing when publish or healthcheck is not provided.

* Similarly to docker_swarm tests, only execute docker_node tests on real VMs and restart docker daemon when tests are done.

(cherry picked from commit 8e26c2dfbe)
2019-03-04 07:37:39 -08:00
Felix Fontein
597db1dc28 [2.7] openssl_certificate, fixed has_expired to check the cert expiration date (#53203)
* Type error in openssl_certificate (#47508)

* Fixed #47505: Type error in openssl_certificate
* Use to_bytes instead of str.encode in SelfSignedCertificate. Updates #47508
* Use to_bytes instead of str.encode in OwnCACertificate
* Added integration tests for openssl_certificate: selfsigned_not_before/after and ownca_not_before/after

(cherry picked from commit 5b1c68579d)

* openssl_certificate, fixed has_expired to check the cert expiration date (#53168)

(cherry picked from commit d5d92e4a70)

* Use fixed timestamp in past instead of relative time (relative times are a feature of devel).

* Add changelog for #47508.
2019-03-04 07:34:14 -08:00
Tony Finch
9c7d36ccb5 get_url: return no change in check mode when checksum matches
Signed-off-by: Tony Finch <dot@dotat.at>
2019-03-01 15:29:46 -08:00
Felix Fontein
8b9c96aad5 Diff feature is only available in devel. 2019-03-01 15:25:24 -08:00
Felix Fontein
25ca40de88 docker_swarm: more integration tests (#53035)
* Add more tests.

* Added tests for CA options.

* Don't run in docker-in-docker situations where docker daemon becoming instable is really dangerous. Also, restart docker daemon after tests.

* Only run CA tests when openssl_certificate can be run (which is not the case for RHEL7, see #34054).

* Add comment on why docker-based CI runs are skipped.

(cherry picked from commit 04bfec9dfe)
2019-03-01 15:25:24 -08:00
Felix Fontein
c4144398bb Fix force when state==present. (#53003)
(cherry picked from commit 76e0e0080b)
2019-03-01 15:25:24 -08:00
Felix Fontein
7c500a4002 docker_swarm: extend tests (part I) (#53005)
* Restructure tests.

* Allow tests to work when ansible_default_ipv4.address is undefined.

(cherry picked from commit e017d94766)
2019-03-01 15:25:24 -08:00
Felix Fontein
aed59e5695 docker_swarm: make labels work with older docker daemon versions (#52895)
* Make labels work with older docker daemon versions.

* Fix idempotence detection.

* Add changelog.

(cherry picked from commit a1ec307d43)
2019-03-01 15:25:24 -08:00
Felix Fontein
23d9efc1f3 docker_swarm: hopefully fix debug CI problems, and fix check mode (#52825)
* Let's see some debug output.

* Also check LocalNodeState.

* Improve tests.

* Actually implement check mode.

* Add changelog.

* Add pretty-printing and more output.

(cherry picked from commit 81d58cfef6)
2019-03-01 15:25:24 -08:00