Commit graph

40474 commits

Author SHA1 Message Date
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
Felix Fontein
d8a75faa53 Reference RFC 8555 instead of latest draft. (#53674) (#53836)
(cherry picked from commit a043570579)
2019-03-18 14:31:13 -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
Matt Martz
166ef9f668 [stable-2.7] Fix checksum file parsing in get_url (#53685) (#53694)
* [stable-2.7] Fix checksum file parsing in get_url (#53685)

* Fix checksum file parsing. Fixes #48790

* guard invalid int conversion

Co-Authored-By: sivel <matt@sivel.net>

* Remove extra newline.
(cherry picked from commit 77217fdd24)

Co-authored-by: Matt Martz <matt@sivel.net>

* Remove use of undefined variable
2019-03-18 12:40:31 -07:00
Martin Krizek
81d893d6ee 2.7: yum: fix disable_excludes in repoquery fallback (#53697)
* yum: fix disable_excludes in repoquery fallback (#53552)

Fixes #53134

(cherry picked from commit 42731ec73f)

* Add changelog for #53552 (#53695)


(cherry picked from commit e0a7f01f0b)
2019-03-18 12:30:16 -07:00
Matt Martz
abf5f7583e [stable-2.7] Don't raise AnsibleConnectionFailure if the ssh process has already died. (#53534)
* Don't raise AnsibleConnectionFailure if the ssh_process has already died. Fixes #53487

* Better support for file not found messages

* Add changelog fragment
(cherry picked from commit e9f9bca)

Co-authored-by: Matt Martz <matt@sivel.net>
2019-03-18 10:56:04 -07:00
Matt Clay
1b14a2d946 [stable-2.7] Changelog lint and generation bug fixes. (#53792)
* Add missing dict entry for changelog generation.
* Enforce str and list types on sections.
* Check type of section list items.
* Support non-ascii characters in changelogs..
(cherry picked from commit 90a38670be)

Co-authored-by: Matt Clay <matt@mystile.com>
2019-03-15 10:10:58 -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
Toshio Kuratomi
ac93b3d5e7 Update Ansible release version to v2.7.9.post0. 2019-03-14 20:22:51 -07:00
Toshio Kuratomi
b4cba61b67 New release v2.7.9 2019-03-14 11:10:27 -07:00
Matt Clay
15c5d85251 [stable-2.7] Keep existing to_yaml behavior with pyyaml >= 5.1. (#53772)
In pyyaml versions before 5.1 the default_flow_style for yaml.dump
was None. Starting with 5.1 it is now False. This change explicitly
sets the value to None to maintain the original to_yaml behavior.

The change to pyyaml was made in the following commit:

507a464ce6
(cherry picked from commit 7f0e09aa31)

Co-authored-by: Matt Clay <matt@mystile.com>
2019-03-13 18:29:14 -07:00
Ryan Conway
bd15658f2c Backport/2.7/51953 (#53657)
* Backporting the logical changes from #51953 to restore functionality on the newer 1Password CLIs v0.5.5+.

* Adding changelog fragment for this backport PR.
2019-03-11 15:18:40 -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
Sloane Hertel
5769d46aa3 use composed vars in constructed groups (#53152)
* changelog

* combine provided variables and host vars inside of constructing groups to take into account composed variables

let composed variables "win"

* fix whitespace

* Allow user to control hash behavior

(cherry picked from commit 4172d68dc3)
2019-03-11 13:21:48 -07:00
Felix Fontein
2773e215f7 [2.7] docker_swarm: removing nodes requires docker >= 2.4.0 (#53592)
* Removing a swarm node does not work with docker-py < 2.4.0, since it calls client.inspect_node(). (#53565)

For the same reason, docker_node requires docker >= 2.4.0.

(cherry picked from commit c75da35595)

* Reconstructing a change from devel which is required to make usage detection work this way.
2019-03-11 13:20:30 -07:00
Jason Witkowski
b84d9a8365 apply node_id parameter to swarm node removal (#53503)
(cherry picked from commit be39e757e3)
2019-03-11 13:15:05 -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
Brian Coca
c93bfe9931 allow nontype configdata (#53365)
(cherry picked from commit 90bcff3d92)
2019-03-11 12:53:52 -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
Timo Runge
a32e8c42b9 Fix for "AttributeError: 'module' object has no attribute 'cursors'" (#49191) (#53445)
* Fix for "AttributeError: 'module' object has no attribute 'cursors'" (#49191) (#1)

* Fix for "AttributeError: 'module' object has no attribute 'cursors'" (#49191)

* Adding changelog fragment for issue #49191 and the following PR.

* Update lib/ansible/module_utils/mysql.py

Co-Authored-By: timorunge <timorunge@users.noreply.github.com>
(cherry picked from commit b45b599433)
2019-03-11 12:52:49 -07:00
Timo Runge
7e83675227 module_utils/mysql: Fixing unexpected keyword argument 'cursorclass' error after migratio… (#47809)
* Fixing unexpected keyword argument 'cursorclass' error after migration from MySQLdb to PyMySQL

* Adoptions for mysql.py as suggested by felixfontein.

* Adding changelog fragment.

(cherry picked from commit 47190088b4)
2019-03-11 12:52:49 -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
Jordan Borean
e0294275d7 win_domain: fix issue when running without credential delegation (#53480)
* win_domain: fix issue when running without credential delegation

* Add check for reboot is required to complete role e install

* Fix changelog sanity issue

* removed meta file accidentally committed

(cherry picked from commit 008db85d44)
2019-03-11 11:53:04 -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
Sandra McCann
82ccbd939c Clarify that do until loops are unsupported on include tasks (#49581) (#53628)
(cherry picked from commit 0d7e95b4db)
2019-03-11 13:50:36 -05:00
Felix Fontein
63b2794607 Warn user to send a password if the privatekey is password protected (#53360) (#53527)
* Warn user to send a password if the privatekey is password protected on openssl_cert and openssl_csr docs 

Co-Authored-By: johnwesley <johnwesley@users.noreply.github.com>
2019-03-11 13:50:13 -05: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
3380defd67 [2.7] docker_swarm_service: rename return variable to swarm_service (#53408)
* docker_swarm_service: rename return variable to swarm_service (#53229)

* Rename return variable to swarm_service.

* Add changelog.

* Add that old name will stay in Ansible 2.7.x.

(cherry picked from commit 61abbfc269)

* Keep old variable for backwards compatibility.
2019-03-06 14:48:32 -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
ba261abe29 re-add EAP to Stop for older branch 2019-03-06 14:28:41 -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
Jordan Borean
bfe072c9dc winrm - try and recover from a send input failure (#53187)
(cherry picked from commit ae24bbff4a)
2019-03-06 14:28:06 -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
Sandra McCann
2f0b727acf backport correct examples (#53411) 2019-03-06 14:36:04 -06:00
Felix Fontein
2f91d399ec [2.7] docker_swarm_service: don't crash when publish isn't specified (#53262)
* Don't crash when publish isn't specified.

* Add changelog.

* Add validation code.

* Use generic supertype of dict.
2019-03-04 12:02:39 -08:00