Commit graph

38432 commits

Author SHA1 Message Date
Jordan Borean
0429b10ddc Merge pull request #53845 from jborean93/win-paths-2.6
Windows - Fix issues with glob like path chars - 2.6
2019-03-18 14:35:28 -07:00
Toshio Kuratomi
00a02574c2 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 14:35:04 -07:00
Jordan Borean
19dfb2f396 Handle binary files when scanning metadata in python 3 (#53773)
(cherry picked from commit c2466c545b)
2019-03-18 14:34:27 -07:00
Jordan Borean
a36b86c0c0 win_psexec: make the tests more stable (#53716)
(cherry picked from commit 33939f7fe8)
2019-03-18 14:33:40 -07:00
Matt Clay
b4aa70e0a1 [stable-2.6] 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:11:02 -07:00
Jordan Borean
7ee89d4ac6 win_chocolatey Fix incompatibilities with latest Chocolcatey release 2019-03-15 10:10:41 -07:00
Toshio Kuratomi
995a7e6453 Update Ansible release version to v2.6.15.post0. 2019-03-14 21:39:41 -07:00
Toshio Kuratomi
dd6a174ff0 New release v2.6.15 2019-03-14 20:21:57 -07:00
Matt Clay
2cae458ba9 [stable-2.6] 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:30:30 -07:00
S
4c3a5629b3 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:50:10 -07:00
Jordan Borean
1e8b9daaa2 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:49:48 -07:00
Sloane Hertel
b7b780650d 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

(cherry picked from commit c4d0c58c5a)
2019-03-08 22:39:47 -08:00
Jordan Borean
2bf946d25e winrm - try and recover from a send input failure (#53187) (#53306)
(cherry picked from commit ae24bbff4a)
2019-03-06 14:49:49 -08:00
Jordan Borean
8b483b1640 OpenSUSE - Add OpenSUSE 15 test containers (#52793)
* OpenSUSE - Add OpenSUSE 15 test containers ci_complete

* Reset matrix back to normal

* Set container version instead of latest

* Remove old Docker completion file

(cherry picked from commit 3635c59b23)
2019-03-04 17:10:55 -08:00
Jordan Borean
1ab1c22659 Add changelog fragment 2019-03-04 07:13:35 -08:00
Robin Roth
150edc4605 Make zypper work with python3
(cherry picked from commit 24e94ec3c6)
2019-03-04 07:13:35 -08:00
Wojciech Sciesinski
8ac0f26b28 Don't run integration tests for OS'es older than Windows 2016 (#53057) 2019-03-01 15:14:37 -08:00
s-hertel
19590192f4 fix no_log indentation so AWS temporary credentials aren't displayed in tests
(cherry picked from commit 6cacbcba665af685608253d16275d3bcf33dfa79)
2019-03-01 15:13:46 -08:00
Dag Wieers
fd38985604 ACI: Fix examples in documentation (stable-2.6) 2019-02-26 10:05:17 -08:00
Jordan Borean
91dee57e5f Suse add py3 package vars (#52794)
(cherry picked from commit 80652ad054)
2019-02-22 11:05:44 -08:00
Jordan Borean
c078da9e09 test - add setup target that creates the nobody user (#52750)
* test - add setup target that creates the nobody user

* do not set explicit gid/uid for nobody user

* Do no create group and only touch basic attributes

(cherry picked from commit 17bfc60423)
2019-02-22 11:05:25 -08:00
Jordan Borean
b94a34d9fa test - add Python 3 package for OpenSUSE in setup_openssl (#52775)
(cherry picked from commit 63c22f6eb0)
2019-02-21 17:07:58 -08:00
Jordan Borean
68507a55b8 fix filesystem tests on OpenSUSE 15+ (#52716)
(cherry picked from commit 5e3e0eb946)
2019-02-21 17:07:47 -08:00
Jordan Borean
8964ef5cfc test suse: get tests working on newer OpenSUSE distributions (#52539)
(cherry picked from commit c312287731)
2019-02-21 17:07:25 -08:00
plumbeo
9fcfd0a221 backport/2.6/40092 (#51910)
* mysql_user: Match quotes, double quotes and backticks when checking current privileges

(cherry picked from commit 1ae0e2138332dad30f5bdd9a46d46b1abf9be868)

* Add changelog fragment for PR #40092

(cherry picked from commit 8974ce3c78557a4ea36b7c33b5dc9361bdea92a1)

* mysql_user: fix malformed regex used to check current privileges
2019-02-21 16:40:55 -08:00
Toshio Kuratomi
a8a07fc66d Update Ansible release version to v2.6.14.post0. 2019-02-21 12:48:13 -08:00
Toshio Kuratomi
446012263a New release v2.6.14 2019-02-21 09:18:18 -08:00
Jordan Borean
f66c006d8c git: kill gpg-agent in tests on newer OpenSUSE hosts (#52476)
(cherry picked from commit bb0a69e084)
2019-02-18 10:19:58 -08:00
Zim Kalinowski
92e62a1bf1 resolved merge conflicts 2019-02-18 10:17:50 -08:00
Zim Kalinowski
ef54e0410c fixed merge conflicts 2019-02-18 10:17:15 -08:00
Zim Kalinowski
22709af2e9 Fixing managed disk facts (#51781)
(cherry picked from commit 0c8c72a0bf)
2019-02-18 10:16:48 -08:00
Jordan Borean
77e2512744 alternatives - fix OpenSUSE dir on newer distros (#52458)
(cherry picked from commit 3ecd6e19f7)
2019-02-18 10:13:07 -08:00
Jordan Borean
7c33ce5542 zypper_repository: fix return check on newer OpenSUSE versions (#52457)
(cherry picked from commit d6453a79f5)
2019-02-18 10:11:34 -08:00
Jordan Borean
81b022b4ed zypper: fix tests to use new URL for OpenSUSE 15.0 (#52453)
(cherry picked from commit 4b296da6a2)
2019-02-18 10:10:49 -08:00
Zim Kalinowski
c9449694b8 Backport/2.6/45378 (#52448)
* backporting fix for sql tags

* removed unnecessary tests
2019-02-18 10:10:23 -08:00
Jordan Borean
07e0de6cf1 opensuse - install password-store from specific repo (#52439)
(cherry picked from commit 4a94bd8d9d)
2019-02-18 10:09:23 -08:00
Simon Westphahl
ab4cfa1b50 Backport: Raise AnsibleConnectionError on winrm connnection errors (#52226)
* Raise AnsibleConnectionError on winrm con errors

Currently all uncaught exceptions of the requests library that is used
in winrm will lead to an "Unexpected failure during module execution".

Instead of letting all exceptions bubble up we catch the connection
related errors (inkl. timeouts) and re-raise them as
AnsibleConnectionError so Ansible will mark the host as unreachable and
exit with the correct return code.

This is especially important for Zuul (https://zuul-ci.org) to
distinguish between failures and connection/host related errors.

* Update lib/ansible/plugins/connection/winrm.py

Co-Authored-By: westphahl <westphahl@gmail.com>

* Add changelog fragment
2019-02-14 12:46:43 -08:00
Wojciech Sciesinski
bec375d691 Install the NuGet package provider if needed (#52130)
* Install the NuGet package provider if needed

* Add the changelog fragment file
2019-02-14 12:46:05 -08:00
Matt Martz
4be3215d2f [stable-2.6] Disallow use of remote home directories containing .. in their path (CVE-2019-3828) (#52133)
* Disallow use of remote home directories containing .. in their path

* Add CVE to changelog
(cherry picked from commit b34d141)

Co-authored-by: Matt Martz <matt@sivel.net>
2019-02-13 09:24:28 -08:00
Jordan Borean
b5122be9e1 Add Windows Server 2019 to Shippable matrix (#51685)
* Test out Server 2019 - ci_complete

* run tests and continue on error - ci_complete

* Add the full matrix back in

(cherry picked from commit 0334c20630)
2019-02-13 08:12:43 -08:00
Jordan Borean
19d20304de win become - fix token elevation issues
This is an implementation of 8bffcf8e50
that was done in the PR https://github.com/ansible/ansible/pull/48082 to devel.
The changes have been manually brought across to the the stable-2.7 branch as it
cannot be cleanly cherry picked due to the substantial differences in become
between these versions.

Currently we impersonate the `SYSTEM` token in order to elevate our become
process with the highest privileges it has available but there are some edge
cases where the first `SYSTEM` token we come across doesn't have the
`SeTcbPrivilege` which is required for the above. This PR adds a further check
in the search for a `SYSTEM` token to make sure it has the `SeTcbPrivilege`
before continuing.

(cherry picked from commit cc5088c9e1)
2019-02-12 11:30:42 -08:00
Matt Davis
adbe9d5d9e fix string_format sanity check (#51780)
* newer version of Pylint moved the impl; use conditional import to find for new/old

(cherry picked from commit 6654c7aeea)
2019-02-11 12:27:02 -08:00
Wojciech Sciesinski
abe3437119 Correct integration tests for the win_disk_facts module (#51044)
* Correct integration tests for the win_disk_facts module

* Exclude W2K8, W2K8-R2 from tests run under CI
2019-02-11 12:26:32 -08:00
Toshio Kuratomi
2f41b12076 Update Ansible release version to v2.6.13.post0. 2019-02-07 17:16:22 -08:00
Toshio Kuratomi
97a37b9ebc New release v2.6.13 2019-02-07 14:08:03 -08:00
Matt Davis
de1c9ff56c [stable-2.6] fix azure_rm_deployment test
* recent changes to args for hosted template file broke the test; changed test to use a specific known-working commit instead of `master`.
* long-term may want to consider hosting the template in httptester or just embedding a local copy
(cherry picked from commit 46bf387)

Co-authored-by: Matt Davis <mrd@redhat.com>
2019-02-07 13:22:19 -08:00
Jordan Borean
4829854791 Get docker tests working on OpenSUSE (#51896)
(cherry picked from commit c92fcf0b57)
2019-02-07 13:12:18 -08:00
Jordan Borean
c96b9cda21 test win_setup - make py3 compatible (#51693)
(cherry picked from commit f78cdcd2c5)
2019-02-04 12:34:19 -08:00
Jordan Borean
2255325287 win_service - use custom binary for tests (#51689)
(cherry picked from commit 2e99dea867)
2019-02-04 12:32:21 -08:00
Jordan Borean
5d7064db66 fix for proper variable name 2019-02-04 12:31:44 -08:00