Commit graph

4773 commits

Author SHA1 Message Date
Sam Doran
f73ac53e58 Only template values in vars_prompt rather than all vars (#39304) (#44082)
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)
2018-08-13 18:18:48 -07:00
Toshio Kuratomi
8d2c129944 [stable-2.5] Only print warning when ansible.cfg is actually skipped (#43583) (#43649)
Only print warning when ansible.cfg is actually skipped

* Also add unittests for the find_ini_config_file function
* Add documentation on world writable current working directory
  config files can no longer be loaded from a world writable current
  working directory but the end user is allowed to specify that
  explicitly.  Give appropriate warnings and information on how.

Fixes #42388
(cherry picked from commit 30662bedad)

Co-authored-by: Toshio Kuratomi <a.badger@gmail.com>
2018-08-13 18:16:24 -07:00
Shuang Wang
3f7ca8daf1 fix issue [ get_url does not change mode when checksum matches ] (#43342) (#43623)
* fix  #29614

* add change log for #43342

* Cleanup tests and add tests for this scenario


Co-authored-by: ptux
(cherry picked from commit 68683b4c73)
2018-08-13 18:14:53 -07:00
Jiri Tyr
8a0fa4a3e3 Fix for creation and removal of swap record in fstab (fixes #42706, #31437 and #30090) (#42837) (#43518) 2018-08-13 18:13:25 -07:00
Matt Martz
0854dc3f7f Add AnsibleModule signature schema, and fix associated issues (#43512) (#43515)
* Add AnsibleModule signature schema, and fix associated issues (#43512)

(cherry picked from commit 01c0446cb5)

* Address additional module issues
2018-08-13 18:12:37 -07:00
Deepak Agrawal
8b2abfe446 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)
2018-08-13 17:52:47 -07:00
Matt Clay
445a3e4127 Fix download URL for yum integration test.
(cherry picked from commit 3b693be80f)
2018-08-09 14:47:07 -07:00
Jakub Libosvar
6b81a39daa openvswitch_db: Make 'key' parameter optional (#42110) (#43552)
* openvswitch_db: Split key-value pairs correctly (#33335)

Map values can contain commas, e.g.
    - name: Configure OVN bridge mapping
      openvswitch_db:
        state: present                                                                                                                                                                                                                                table: open_vswitch                                                                                                                                                                                                                           record: .                                                                                                                                                                                                                                     col: external_ids                                                                                                                                                                                                                             key: ovn-bridge-mappings
        value: '"vmnet-static:br-vmnet-st,vmnet-dynamic:br-vmnet-dyn"'

Previous behaviour was splitting the value and raised an exception.
(cherry picked from commit 3c53e2f8ea)

* 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)
(cherry picked from commit 01097715fd9466c64bfb37d7604d095275a5e9d8)
2018-08-08 16:01:42 +02:00
Matt Clay
bf8f228fd5 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)
2018-07-24 10:02:00 -07:00
Matt Clay
5805e6a89b Mark win_uri unstable.
(cherry picked from commit 547f11ad8f)
2018-07-23 18:28:04 -07:00
Nilashish Chakraborty
85122a6c38 Fix ios_vlan issue CP in 2.5 (#42668)
* Make ios_vlan identify vlans starting with 9 (#42247)

* Make ios_vlan identify vlans starting with 9

* Add unit test for vlan id start with 9

(cherry picked from commit 70e33ef92c)

* Added changelog for ios_vlan fix
2018-07-23 09:25:18 -07:00
Nathaniel Case
dc37b41b72 [2.5] Update ios tests (#42509) (#42515)
* [2.5] 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)
2018-07-23 09:21:16 -07:00
Trishna Guha
e3993bd01b nxos_nxapi fix pick-2.5 (#42490)
* 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)

* add changelog

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

* Add get_capabilities in nxapi module_utils (#42688)

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
(cherry picked from commit d5e9653c96)
2018-07-23 09:20:54 -07:00
Sam Doran
306be9f23c Fix pause module so it does not stack trace when redirecting stdout. (#42217) (#42441)
* 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)
2018-07-23 09:20:14 -07:00
Matt Clay
b00358e4fb Remove unwanted containers at CI job start.
(cherry picked from commit 528de5b82f)
2018-07-09 21:50:29 -07:00
Sam Doran
0fa56ed65d Add warning when using an empty regexp in lineinfile (#42013) (#42207)
* 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

(cherry picked from commit fb55038d75)
2018-07-05 09:41:07 -07:00
Sam Doran
ab93ad8a0a Backport #41767 for 2.5 -Skip if insertbefore is using BOF until later in the module (#41930)
* 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
2018-07-03 13:08:49 -07:00
Jordan Borean
9757233a93 Stop displaying kinit pass input on a failure (#41882) (#41923)
* Stop displaying kinit pass input on a failure

* Fixed up minor logic info and added tests

(cherry picked from commit 9b7b564d75)
2018-07-03 12:08:26 -07:00
Martin Krizek
ab18048147 Fix rabbitmq_* integration tests (#41836) (#41922)
(cherry picked from commit a8d4bf8642)
2018-07-03 12:08:03 -07:00
Brian Coca
40c47b7785 fix minor issues with debug and item labels (#41331) (#41815)
* fix minor issues with debug and item labels

 - no more `item=None`, we always have a label now
 - debug should only show expected information, either msg= or the var in var=
 - also fixed method name, deprecated misleading _get_item

(cherry picked from commit 27c43daab8)
2018-07-03 12:05:13 -07:00
Nilashish Chakraborty
9101dd6857 Fixed eos_logging test issue (#41777) 2018-07-03 12:04:35 -07:00
Nilashish Chakraborty
b9904b9fe7 Fix vyos_vlan aggregate issue & added tests CP into 2.5 (#41638) (#41775)
* Fix vyos_vlan aggregate issue & added tests (#41638)

* Fix vyos_vlan aggregate issue & Added tests

* Fix #2 for vyos_vlan aggregate issue

(cherry picked from commit 837c216587)

* Added changelog for vyos_vlan aggregate issue fix
2018-07-03 12:02:11 -07:00
Markos Chandras
e20294c1e1 facts: suse: Fix major version detection for SUSE (#41416) (#41650)
When parsing the distribution files such as /etc/os-release, we extract
the full distribution version but not the major version. As such, the
ansible_distribution_major_version ends up being 'NA' whereas the
ansible_distribution_version contains the full version.

Before this patch we get this on openSUSE Leap 15

ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "NA"}, "changed": false}

After this patch we get this

ansible -o localhost -m setup -a filter=ansible_distribution_major_version
localhost | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "15"}, "changed": false}

This also fixes the Tumbleweed distribution test to report a proper
major version and also adds a test for openSUSE Leap 15.0 to avoid
potential future regressions.

Fixes: #41410
(cherry picked from commit 1737b7be3e)
2018-07-03 11:58:00 -07:00
Toshio Kuratomi
7b325baa22 Bkprt recursive copy fix (#40268)
* Fixes #34893 (#40166)

Fixes several bugs exposed in #34893
* Fixes relative path handling in copy so that it splits directories and
  reconstructs the correct file path
* Return failed in the proper circumstances

(cherry picked from commit ca4147f2cc)

* Add changelog for recursive copy fix

(cherry picked from commit cab0f21564)
2018-07-03 11:49:45 -07:00
Matt Clay
9fcf256817 Disable remaining failing rabbitmq_* tests.
(cherry picked from commit 5880404151)
2018-06-21 15:56:22 -07:00
Matt Clay
cd9d18a93b Revert "Disable failing rabbitmq_user test."
This reverts commit e954633739.
2018-06-21 15:55:33 -07:00
Matt Clay
e954633739 Disable failing rabbitmq_user test. 2018-06-21 13:57:37 -07:00
Matt Clay
317388e967 Temporarily disable gem test on osx.
Disabled due to lack of newer TLS version support on the test system.

(cherry picked from commit dce708e63e)
2018-06-19 17:02:14 -07:00
Matt Davis
4202d1d769 skip winrm unit tests if winrm is not installed (#41596)
(cherry picked from commit b01779ad18)
2018-06-15 10:26:33 -07:00
Trishna Guha
68134cc635 Don't retrieve config in running_config when config is provided for diff stable 2.5 (#41557)
* don't retrieve config in running_config when config is provided for diff (#41400)

* don't retrieve config in running_config when config is provided for diff

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

* fix for eos, nxos

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

* add integration test

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

* add changelog

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-06-14 11:55:58 -07:00
Toshio Kuratomi
b4cb0b46e3 Tasks that are expected to fail need to begin with a special string (#41466)
(cherry picked from commit a5fd86cf6d)
2018-06-14 11:55:06 -07:00
Will Thames
cbaef99489 Fail with nice error message if elb target_type=ip not supported (#38313) (#41430)
* Add helpful failure message if target_type=ip is not supported

Create test case for target_type=ip not supported

* Update elb_target_group module to latest standards

Use AnsibleAWSModule
Improve exception handling
Improve connection handling

(cherry picked from commit 29770a297a)
2018-06-14 11:54:32 -07:00
Julien Vey
f73d123ef4 cloudfront_distribution: fix the order of headers to avoid updates again and again (#37340)
* Fix python2/3 compatibilities issues

* Sort cloudfront_distribution headers to avoid useless updates

(cherry picked from commit ec2e027980)
2018-06-14 09:48:59 -07:00
Toshio Kuratomi
698b8e04f3 Bkprt nolog fix (#41453)
* no_log even when task_result doesn't provide key

 - now also checks task property
 - added reproducer to tests for unreachable status on item loop

(cherry picked from commit 336b3762b2)

* Add changelog entry for the no_log fix

(cherry picked from commit 5fdd101a3e)
2018-06-12 12:28:29 -07:00
Nilashish Chakraborty
da67d279be Fixes eos_logging idempotence CP into 2.5 (#40931)
* Fixes eos_logging idempotence issue #31862 (#40604)

* eos_logging idempotence fix

* fixed eos_logging idempotence issue

* Fixed pylint and pep8 errors

* Added tests for eos_logging & minor fix

* Removed q statements

(cherry picked from commit b9ea646839)

* Added changelogs for eos_logging idempotence fix

* changelog tweak
2018-06-07 17:15:56 -07:00
Sloane Hertel
fe2520a830 2.5 backport #40826 to fix async for aws_s3 (#41276)
* cherry-picked from 89cea78e30 and fixed merge conflicts from restructuring the integration tests in devel

Fix async for aws_s3

Add a test that async is able to be used on aws_s3 tasks

(cherry picked from commit cef92e3942cdd76866c47d25f903625e6d7eb6ed)

* changelog format tweak
2018-06-07 17:12:13 -07:00
Nilashish Chakraborty
72ad0dd4ec Fix ios_logging idempotence CP into 2.5 (#41120)
* Fixes to ios_logging (#41029)

* Logging size may not show up in config

* This is much simpler

* Avoid repetition in tests

* Both options of buffered are optional

(cherry picked from commit 92a95368fe)

* Added changelog
2018-06-07 17:05:47 -07:00
Jordan Borean
60ab7b2807 winrm: fix up unit tests (#41112) (#41211)
(cherry picked from commit ad8e13e9f8)
2018-06-06 15:57:00 -07:00
Matt Martz
959821f40e Backport #40833 for 2.5 - synchronize _remote_is_local (#40917)
* Use _remote_is_local=True for local connection in synchronize (#40833)

* All instances of local connection should use _remote_is_local=True. Fixes #40551

* Switch to instance attribute for synchronize

* Add test that shows that synchronize _remote_is_local addresses tmpdir building

(cherry picked from commit ad7ba91f75)

* Add changelog entry for #40833
2018-05-30 17:28:23 -04:00
Brian Coca
5a77aceae5 fix 'doas' become_method support, previously committed patch not submitted to devel branch (#37511) (#40896)
* fix become_method 'doas' support by properly specifying becomecmd

a repatch of https://github.com/ansible/ansible/pull/13451/ which was never committed to 'devel' branch.

* fix play_context test for become_method doas to match new becomecmd

(cherry picked from commit be3670f528)
2018-05-30 16:03:58 -04:00
Sloane Hertel
b1c4d6310d Fix broken aws_ses_identity test - backport #39560 (#40350)
* Fix failing aws_ses_identity integration tests (#39560)

* Fix failing aws_ses_identity integration tests

Reduce boilerplate with yaml anchor

* remove unstable test alias

* Update feedback forwarding check to use desired state rather than
repeated API calls.

(cherry picked from commit 571c183f59)

* changelog
2018-05-30 10:43:02 -07:00
Matt Clay
48f6670b49 Fix FreeBSD package install in test setup.sh.
(cherry picked from commit c3d3b6cedc)
2018-05-30 09:26:04 -07:00
Trishna Guha
8e8b469416
nxos bugfixes 2.5.4 cherry-pick (#40861)
* Fix legacy Nexus 3k integration test and module issues. (#40322)

* Add setup ignore_errors for nxos_config test

* Fix parse_fan_info for n3k

* Skip bidir tests for N3k

* Omit vni config for n3k

* Skip unsupported nxos_vrf_af test on N3K

* Add legacy N3K platform tag

(cherry picked from commit 63e16431b7)

* Skip N35 and N3L platforms for nxos_evpn_global test (#40333)

(cherry picked from commit ad69ef88e7)

* add normalize_interface in module_utils and fix nxos_l3_interface module (#40598)

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

* nxos_interface: Disable switchport for loopback/svi (#40314)

* nxos_interface: Disable switchport for loopback/svi

* Replace interface_type with get_interface_type(name)

(cherry picked from commit d04a989bd2)

* fixes bug with matching nxos prompts (#40655)

This change addresses an issue where the prompt matching regular
expressions would not match a prompt if the hostname starts with a
numeric value.  Before this change, the connection would fail with a
socket.timeout() error.  This change updates the termnal_stdout_re
values to now check for a number.

See Github issue #38639

(cherry picked from commit d829ff6993)

* fix nxos_vrf and migrate get_interface_type to module_utils (#40825)

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

* nxos_vlan fix

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

* changelog nxos bugfixes 2.5.4

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-30 11:21:53 +05:30
Yuwei Zhou
5f384ec0a6 Fix #26755 by ensuring that the first nic in the nic list is primary (#38994) (#40781) 2018-05-29 10:28:54 +08:00
Nathaniel Case
d6a07186fd
Backport ios test fixes to 2.5 (#40662)
* Ios test fixes (#40503)

* Return messages generated from edit_config to module

* This does not seem to work that way

* Change test IP addresses to not conflict with device config

(cherry picked from commit eb818df1ec)

* Search all assigned ipv6 addresses instead of just the first (#40533)

* Search all assigned ipv6 addresses instead of just the first

* Add test for idempotency with multiple ipv6 addresses assigned

(cherry picked from commit e8d02a3a0f)

* Fix ios test pt. 2 (#40628)

* Add missing idempotence assert

* Remove dhcp with other addresses on ipv6

(cherry picked from commit f88412b7cd)
2018-05-24 10:22:46 -04:00
Sviatoslav Sydorenko
0b080de855
[2.5] Fix ios_vlan to correctly identify unmodified config when having long interface names (#40145) (#40656)
Change the command to get the interface in a vlan "show vlan" => "show vlan brief"
Change the parsing of the return command of the switch.
The return of the ios command is fixed so i cut with fix number of carracter.
Adding looking for the next line to add the forgeted interfaces.
(cherry picked from commit 3903ca5)

Co-authored-by: pierremahot <pierre.mahot@orange.fr>
2018-05-24 15:55:13 +02:00
Jordan Borean
a63b6d363b
winrm: add better exception handling for krb5 auth with pexpect (#39930) (#40634)
* winrm: add better exception handling for krb5 auth with pexpect

* Added changelog fragment

* Added exception handler in case kinit path isn't valid, added test cases

* fixed for Python 2 compatibility

(cherry picked from commit 5e28e282a5)
2018-05-24 07:17:21 +10:00
Sviatoslav Sydorenko
2cb9f7f5b9
[backport] Detect separate git dir and set git config path value appropriately
PR #38016

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
(cherry picked from commit 0a701ff)

Co-authored-by: Senya <senya@riseup.net>
2018-05-23 21:01:07 +02:00
Sam Doran
dbcecb64b8
Fix ctrl+c in pause module and add tests (#40134) (#40480)
Backport # 40134 - Ensure Ctrl+C interrupt for pause module works in all cases
2018-05-22 13:11:21 -04:00
Sam Doran
9bef06ccd9
Add better error messages and checking to known_hosts (#38307) (#40502)
(cherry picked from commit 13aff08748)
2018-05-22 12:42:39 -04:00