Commit Graph

2755 Commits (d2268dcb37120114adb06824f360647e605aa66c)

Author SHA1 Message Date
Matt Clay 70c011481a Rebalance shippable/posix/ CI groups.
(cherry picked from commit 33b34f5c82)
6 years ago
Sloane Hertel 46f189d937 Fix and re-enable sts_assume_role integration tests (#46026)
* Fix the STS assume role error message assertion when the role to assume does not exist.

(cherry picked from commit 18dc928e28)
6 years ago
Daniel Speichert 6e90277c69 [stable-2.6] Migrate from MySQLdb to PyMySQL (#40123)
* Migrate from MySQLdb to PyMySQL

* Deduplicate driver loading and failure message

* Explain requirements

* Apply requirements docs change to proxysql too

* Add changelog.
(cherry picked from commit d34cf93f1a)

Co-authored-by: Daniel Speichert <DSpeichert@users.noreply.github.com>
6 years ago
Matt Martz e7740b80fd [stable-2.6] [stable-2.7] Fix logic to not re-download existing files when force=no (#45495) (#45509)
* [stable-2.7] Fix logic to not re-download existing files when force=no (#45495)

* Fix logic to not re-download existing files when force=no. Fixes #45491

* Reduce logic complexity.
(cherry picked from commit 5785de582f)

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

* Backport of get_url fix cannot use result

result was only added in 2.8+.
(cherry picked from commit 99171a9c6f)

Co-authored-by: Matt Martz <matt@sivel.net>
6 years ago
Sloane Hertel 0be82f2b08 [2.6] ec2_group: fix regression for targets that are a list containing strings and lists (#45748)
* Fix targets that may be a list containing strings and lists which worked prior to 2.6.

(cherry picked from commit 450fb9f855)

* Add ec2_group integration tests for lists of nested targets

(cherry picked from commit 14e3399db1)

* changelog

(cherry picked from commit fb17db0876)
6 years ago
Matt Martz e0e266d070 [stable-2.6] Ensure loop with delegate_to can short circuit the same as without delegate_to. Fixes #45189 (#45231).
(cherry picked from commit 2ac647def8)

Co-authored-by: Matt Martz <matt@sivel.net>
6 years ago
Jordan Borean cd8208a4aa win_say - fix up syntax and test issues (#45450)
(cherry picked from commit c9c141fb6a)
6 years ago
Jordan Borean e750df9c8a fix Ansible.ModuleUtils.FileUtil to respect ErrorAction if running in a try/catch (#45451)
(cherry picked from commit d4ce1b9f31)
6 years ago
Jordan Borean 0b39c66db7 powershell: do not quote join_path result to reflect ShellBase join_path (#45944)
(cherry picked from commit 198423d6fb)
6 years ago
Jordan Borean 520a2bf89a reordered windows test groups for better efficiency (#45445)
(cherry picked from commit 25ae4f2b73)
6 years ago
Jordan Borean ffe364dd5d add skip/docker alias to skip tests when running on Docker (#45955)
* add skip/docker alias to skip tests when running on Docker

* changed warning message wording

(cherry picked from commit 27c10fa502)
6 years ago
Jordan Borean 312b821501 skip installing linux-image-extra in CI as it shouldn't be needed (#46101)
(cherry picked from commit 40379b76b1)
6 years ago
Matt Clay cadccbe323 Reduce cost of Azure DB tests.
(cherry picked from commit ed49f37957)
6 years ago
Matt Clay c8887aa47f Get packages for dnf and yum tests from S3.
(cherry picked from commit 22d5f5d97f)
6 years ago
Trishna Guha 7b840f3fe5 Pick 2.6 nxos bugfixes (#44105)
* Add md5sum check in nxos_file_copy module (#43423)

* Add md5sum check in nxos_file_copy module

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit fee4c24ad4)

* nxos_vlan refactor to support non structured output (#43805)

* nxos_vlan refactor to support non structured output

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* unittest fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* minor fixes

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* use check_rc

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove additional return statement

* address Nate's review

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 96346938ee)

* nxos_facts test lldp feature and fix nxapi check_rc (#44104)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 43ae240431)

* nxos bugfix 2.6 changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_interface port-channel idempotence fix for mode (#44248)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 6af6e806ed)

* changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* check_mode in nxos_static_route module (#44252)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 7e39c5bf07)

* changelog nxos_static_route

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_linkagg mode fix (#44294)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 6090802551)

* changelog nxos_linkagg

* nxos_system idempotence fix (#44752)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 8a79d944a3)

* nxos_system changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* use retry_json nxos_banner (#44376)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 9c4ed4dfc1)

* nxos_banner changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix Python 2.6 regex bug terminal plugin nxos, iosxr (#45135)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit ab3cd10dfe)

* terminal plugin changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Brian Coca b0678e71a8 fix no log templating (#44506)
* fix tempating issues with no_log and loops (#44468)

* fix tempating issues with no_log and loops

 - task is no log if any item is
 - added test cases

fixes #43294

(cherry picked from commit bda074d34e)

* use play context to avoid bug when jinja2+py3
6 years ago
Monty Taylor 499ddeadd5 Backport package manager detection fixes to stable 2.6 (#44415)
* Fix pkg_mgr_name fact finding for Fedora (#40922)

* Properly handle default package manager vs apt

For distros where apt might be installed but is not the default
package manager for the distro, properly identify the default distro
package manager during fact finding and re-use fact finding from
DistributionFactCollector and instead of reimplementing small
portions of it in PkgMgrFactCollector

Add unit test to always check the apt + Fedora combination to test
the new code.

Fixes #34014

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove q debugging output I accidentally left behind

Signed-off-by: Adam Miller <admiller@redhat.com>

* add os_family to the conditional so we're only hitting that code path when needed

Signed-off-by: Adam Miller <admiller@redhat.com>

* setup for a _check* pattern for general os_family group pkg_mgr checking

Signed-off-by: Adam Miller <admiller@redhat.com>

* use Mock.patch decorator for os.path.exists in TestPkgMgrFactsAptFedora

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix fedora version dnf fact, default pkg_mgr detection per distro family (#43261)

* fix fedora version dnf fact, default pkg_mgr detection per distro family
* loop over possible dnf/yum paths in case there are multiple canonical sources later in life

Signed-off-by: Adam Miller <admiller@redhat.com>

* pkg_mgr: fixed apt_rpm detection (#43769)

Instead of checking the distribution name (which apparently is tricky to find out)
check if /usr/bin/apt-get is managed by RPM.

Fixes #43539

* Ensure that apt is always chosen on debian/ubuntu

One can install alternate packages managers on debuntu machines.
However, doing so doesn't mean you want to suddenly start using them.

Add in a check similar to the fedora yum/dnf check that sets apt as the
pkg_mgr if the ansible_os_family is Debian.
6 years ago
Sam Doran 5a26560cca Properly un expire account on creation (#44174)
When creating a new account, check to see if the expiration parameter is negative and pass in the appropriate parameter. Since the negative integer passed into expires is converted to time.struct_time which in turn gets converted to a formatted time string when passed to the underlying command, a -1 or large negative number would result in passing a date before 1970-01-01 to the underlying command.

This had the opposite effect of creating an account with no expiration account resulting in a newly created account that was already expired, or just throwing an error on certain systems.

(cherry picked from commit df335d91b0)
6 years ago
Rafael f7f6d47c7e Backport/2.6/44568 (#44728)
* fixes parameters via environment variables, issue #44163

(cherry picked from commit 2c84022b20)

* including test case using environment variables as per issue #44163

(cherry picked from commit eaaada25c7)

* including missing environment variable in shared documentation fragement, related to issue #44163

(cherry picked from commit e97d2e7ed1)

* added changelog

* yml fix
6 years ago
Jordan Borean c86794ace2 win_psexec: fix arg handling when command contains multiple args (#44797)
(cherry picked from commit 9d91607754)
6 years ago
Matt Clay 545d0eda17 Remove obsolete `test/utils/docker/` directory.
(cherry picked from commit 78bd020429)
6 years ago
Matt Clay f8cbb62358 Ignore CentOS 6.10 for passwordstore test.
(cherry picked from commit 18da873531)
6 years ago
Matt Clay f8e742acee Restore repos after zypper_repository test runs.
This also allows the test to run on newer containers by not
manipulating any of the pre-configured repositories.

(cherry picked from commit cac51e6da8)
6 years ago
John R Barker 76392c3ddd inventory plugins: add test about config API usage (#41888) (#43040)
* inventory plugins: add test about config API usage (#41888)

* Check get_option method works with inventory plugins

This use case is already tested by some cloud inventoty plugin but
these tests are slow and aren't always executed, hence this new quick
test.

* AnsiblePlugin: Fix typo in docstring

(cherry picked from commit 06f5e49dfb)

* Update aliases
6 years ago
Yuwei Zhou d49240a619 Azure module bugfix backport (#43808)
* Fix nsg cannot add rule with  purge_rules false (#43699)

(cherry picked from commit 88a738b0ba)

* Create azure_securitygroup_fix_adding_rule.yaml

* azure_rm_loadbalancer_facts.py: list() takes at least 2 arguments fix (#29046) (#29050)

(cherry picked from commit d1d08304f9)

* azure_rm_deployment: collect tags from existing Resource Group (#26104)

(cherry picked from commit 6741e98c04)

* add change log
6 years ago
Jiri Tyr 7e835bf60a Fix for creation and removal of swap record in fstab (fixes #42706, #31437 and #30090) (#42837) 6 years ago
Shuang Wang f33ec9fc0a fix issue [ get_url does not change mode when checksum matches ] (#43342)
* fix  #29614

* add change log for #43342

* Cleanup tests and add tests for this scenario


Co-authored-by: ptux
(cherry picked from commit 68683b4c73)
6 years ago
Sam Doran 4cbf048996 Only template values in vars_prompt rather than all vars (#39304)
This allows the use of variables in vars_prompt fields but allows variables entered in the prompt to affect play vars rather than throwing an undefined error.

Add tests for vars_prompt

(cherry picked from commit 6d38167d49)
6 years ago
Deepak Agrawal 9794e5b610 openvswitch_db : Handle column value conversion and idempotency in no_key case (#43914)
* openvswitch_db : Handle column value conversion and idempotency in no_key case (#43869)

* change column value to string. handle idempotency in no key case

* fix unit test failures in baseline

(cherry picked from commit 8eaebf86b6)

* change column value to string. handle idempotency in no key case
6 years ago
Matt Clay 71eabf134f Fix download URL for yum integration test.
(cherry picked from commit 3b693be80f)
6 years ago
Pilou 39182552ef improve 'service' integration tests (#43655)
* service tests: check that daemon is really running

(spoiler: it isn't)

* service tests: add PIDFile directive in systemd unit

* service tests: check 'changed' too

* service tests: fix indentation & use changed test

* service tests: #16694 has been fixed a long time ago

* service tests: refactor

- always execute cleaning tasks
- move tests tasks in a dedicated file

* service tests: add test for #42786

* service tests: display value of ansible_service_mgr

* service tests: allow to run tests twice in a row

stop & disable ansible test service

* service tests: 'pattern' value must be a substring

'pattern' parameter is poorly named

* service tests: check ansible_test service status

* service tests: test daemon must handle SIGHUP

because 'initctl reload' sends SIGHUP, otherwise test daemon stops when
receiving the signal

* service tests: remove upstart override file too

and check that files were removed using raw module and stat command

(cherry picked from commit c5f37f6bd6)
6 years ago
Felix Fontein 9ad21fbfb5 Forgot to include validations. 6 years ago
Sam Doran 2267ba2f05 Only report change when home directory is different on FreeBSD (#42865)
* Only report change when home directory is different

Add tests with home: parameter

Have to skip macOS for now since there is a bug when specifying the home directory path for an existing user that results in a module failure. That needs to be fixed in a separate PR.

(cherry picked from commit 0ca61e9d87)
6 years ago
Jordan Borean 3e9a390809 win_user: use different method to validate credentials that does not rely on SMB/RPC (#43059)
* win_user: use different method to validate credentials that does not rely on SMB/RPC

* Use Add-Type as SetLastError on .net reflection not working on 2012 R2

(cherry picked from commit 04431216e7)
6 years ago
Brian Coca e84931b9c2 don't assume all delegation subkeys exist (#43032)
* don't assume all delegation subkeys exist

fixes #43026

* add tests

(cherry picked from commit cdc762dd9e)
6 years ago
Matt Clay 880882bfd4 Update Shippable integration test groups. (#43118)
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.

(cherry picked from commit 4e489d1be8)
6 years ago
Matt Clay 4b7925dfd4 Fix win_reboot test and mark win_uri unstable.
(cherry picked from commit 547f11ad8f)
6 years ago
Nathaniel Case d9f5eb69d5 [2.6] Update ios tests (#42509) (#42516)
* [2.6] Update ios tests (#42509)

* 192.168.0.1/24 conflicts with management IP

* Images don't have the hostnames we expect
(cherry picked from commit 399d13d)

Co-authored-by: Nathaniel Case <this.is@nathanielca.se>

* ios test cleanup pt 2 (#42570)

* Remove local from ios_config to avoid needing to add provider

* ios_smoke should test all with local to pick up the slack

(cherry picked from commit 381263ad99)
6 years ago
Sam Doran 31a425d26c Fix pause module so it does not stack trace when redirecting stdout. (#42217)
* Use separate variables for stdin and stdout file descriptors

* Do not set stdout to raw mode when output is not a TTY

(cherry picked from commit 1d1595b990)
6 years ago
Julien Vey 9edd51928f efs_facts: improve performance by reducing the number of api calls (#36520)
* efs_facts: improve performance by reducing the number of api calls

* Remove efs_facts tests from running in CI
(cherry picked from commit 0f612d1b76)
6 years ago
Jordan Borean 69a36a3fa7 Fix remote_tmp when become with non admin user (#42396)
* Fix tmpdir on non root become

 - also avoid exception if tmpdir and remote_tmp are None
 - give 'None' on deescalation so tempfile will fallback to it's default behaviour
   and use system dirs
 - fix issue with bad tempdir (not existing/not createable/not writeable)
   i.e nobody and ~/.ansible/tmp
 - added tests for blockfile case

* Revert "Temporarily revert c119d54"

This reverts commit 5c614a59a6.

* changes based on PR feedback and changelog fragment

* changes based on the review

* Fix tmpdir when makedirs failed so we just use the system tmp

* Let missing remote_tmp fail

If remote_tmp is missing then there's something more basic wrong in the
communication from the controller to the module-side.  It's better to
be alerted in this case than to silently ignore it.

jborean and I have independently checked what happens if the user sets
ansible_remote_tmp to empty string and !!null and both cases work fine.
(null is turned into a default value controller-side.  empty string
triggers the warning because it is probably not a directory that the
become user is able to use).

(cherry picked from commit 8bdd04c147)
6 years ago
Jakub Libosvar c3f2e4679c openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is
required only for columns with type of a 'map'. This patch makes 'key'
an optional parameter to allow setting values for other column types
like int.

Fixes #42108

(cherry picked from commit 26b0908270)
6 years ago
Jordan Borean f3570c2b0c win_reboot: fix 2.6 issues and better handle post reboot reboot (#42330)
* win_reboot: fix 2.6 issues and better handle post reboot reboot

* changed winrm _reset to reset

* Add handler to reset calls when .reset() throws an AnsibleError on older hosts

* Moving back to _reset to get the issue fixed

(cherry picked from commit 940d4a0e89)
6 years ago
jamessemai 9e706a3ed4 win_security_policy: Allow setting a value to empty (#42051)
* win_security_policy: allow removing values (resolves #40869)

* Removing warning

* Adding test for remove policy setting

* Fixing string comparison

* Make idempotent

* Adding idempotency and diff test

* added changelog fragment

(cherry picked from commit dc32842573)
6 years ago
Matt Clay 7968a84e4b Fix openshift integration test requirements.
(cherry picked from commit 2fbc2abf86)
6 years ago
Trishna Guha edf933918d nxos and eos bugfix pick2.6 (#42291)
* fix nxos_vxlan_vtep_vni issue (#42183)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 981c9f6a79)

* nxos CI failures bugfix (#42240)

* fix nxos_portchannel and remove deprecated param in test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix _nxos_switchport CI failures

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxapi nxos_command test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove unsupported param nxos_smoke test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxos_vxlan_vtep_vni

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* syntax error

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit 805d13f287)

* Update eos_l2_interface.py (#42270)

(cherry picked from commit 51092c6ea5)

* add changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Enforcing NXAPI default HTTP behavior (#41817)

* nxos_nxapi http default behavior

* Use nxos_nxapi module in prepare_nxos_tests

* Refactor nxos_nxapi configure test to use yaml block

* Extend nxos_nxapi https & http test cases

* Removed NXOS internal release naming

* Resolved ansibot sanity errors

* Fix typo in prepare_nxos_tests

* Address PR comments

* Shippable indicates this is no longer needed

* Add port change logic and testing

(cherry picked from commit db7300904d)

* update changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Sam Doran 3bec68a3b3 Backport #42013 for 2.6 - linenfile empty regexp warning (#42204)
* Add warning when using an empty regexp in lineinfile (#42013)

* Revert "Account for empty string regexp in lineinfile (#41451)"

This reverts commit 4b5b4a760c.

* Use context managers for interacting with files

* Store line and regexp parameters in a variable

* Add warning when regexp is an empty string

* Remove '=' from error messages

* Update warning message and add changelog

* Add tests

* Improve warning message

Offer an equivalent regexp that won't trigger the warning.
Update tests to match new warning.

* Add porting guide entry for lineinfile change

# Conflicts:
#	docs/docsite/rst/porting_guides/porting_guide_2.7.rst
#	lib/ansible/modules/files/lineinfile.py
#	test/integration/targets/lineinfile/tasks/main.yml

* Add porting guide info
6 years ago
Jordan Borean 1024f53ffd Win group membership sid refactor 2.6 (#41990)
* Refactor/fix win_group_membership to use SIDs for internal comparisons (#40725)

* refactor win_group_membership to use SIDs for comparisons instead of name parsing

* carry over previous doc cleanup changes

* remove trailing whitespace from docs

(cherry picked from commit bcb49f2575)

* Added changelog fragment
6 years ago
Kevin Breit d2b447e8a1 Fixes idempotency check for partial configurations (#41941)
- Previous PR would overwrite new and existing values improperly

(cherry picked from commit 7ab3f755ce)
6 years ago
Sam Doran bd1ecd016b Backport #41767 for 2.6 - Skip if insertbefore is using BOF until later in the module (#41929)
* Skip if insertbefore BOF until later (#41767)

If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF.

Add tests for this scenario.

(cherry picked from commit eaae1318f8)

* Add changelog fragment
7 years ago