Commit graph

8560 commits

Author SHA1 Message Date
Jordan Borean
65049620ee
Generate galaxy.yml based on single source of truth (#59170)
* Generate galaxy.yml based on single source of truth

* Fix up tests and align file names

* Minor Makefile tweak

* Remove link in galaxy.yml file and make it a template file

* Moved collections docs to dev_guide

* change Makefile clean path

* Added readme to example meta file

* review fixes

* Use newer style for doc generation script

* Fix mistake in dev_guide index

* removed uneeded file, fixed links and added preview banner

* Moved banner for sanity test
2019-07-23 06:50:46 +10:00
PRASOON KARUNAN V
a20afb5822 Add support for test script parameters in win_pester (#58790)
* add parameter list argument

* add tests

* fix test and add doc

* correct test file

* fix typo

* fix tests

* fix typo in file name

* correct file name reverting the previous commit

* correct property name

* add checkmode message

* changes as per review comments

* variable casing and other review comment changes

* define $test_parameters_check_mode_msg variable
2019-07-23 05:46:26 +10:00
Matt Martz
284dafe476
Perfy McPerferton (#58400)
* InventoryManager start of perf improvements

* 0 not 1

* More startswith to [0] improvements

* Remove unused var

* The hash doesn't need to be a string, start as a list, make it into a tuple

* set actually appears faster than frozenset, and these don't need to be frozen

* Cache hosts lists, to avoid extra get_hosts calls, pass to get_vars too

* negligible perf improvement, it could help with memory later

* Try the fast way, fallback to the safe way

* Revert to previous logic, linting fix

* Extend pre-caching to free

* Address test failures

* Hosts are strings

* Fix unit test

* host is a string

* update test assumption

* drop SharedPluginLoaderObj, pre-create a set, instead of 2 comparisons in the list comprehension

* Dedupe code

* Change to _hosts and _hosts_all in get_vars

* Add backwards compat for strategies that don't do set host caches

* Add deprecation message to SharedPluginLoaderObj

* Remove unused SharedPluginLoaderObj import

* Update docs/comments

* Remove debugging

* Indicate what patterh_hash is

* That won't work

* Re-fix tests

* Update _set_hosts_cache to accept the play directly, use without refresh in get_hosts_remaining and get_failed_hosts for backwards compat

* Rename variable to avoid confusion

* On add_host only manipulate _hosts_cache_all

* Add warning docs around _hosts and _hosts_all args
2019-07-22 14:25:20 -05:00
Chris Archibald
6adf0c581e New feature to na_ontap_snapmirror (#59047)
* updates

* updating version added for connection type
2019-07-22 13:46:00 -04:00
Matt Clay
52ad0f3217 Update ansible-test sanity requirements.
Skip installation of packages on Python 2.x which are only used on 3.x.
2019-07-22 10:14:33 -07:00
Chris Archibald
b1360c0d94 bug fixes (#59049) 2019-07-22 11:05:56 -04:00
Trois-Six
6f9f67be18 virt_net: add way to get facts for only one specified network 2019-07-22 16:34:07 +02:00
Andrey Klychkov
59e647910d Add unit tests for bytes_to_human formatter
PR #58664

Co-Authored-By: Sam Doran <sdoran@redhat.com>
2019-07-22 15:45:07 +02:00
Evert Mulder
66d12f6f1e Only convert VirtualDiskFix for #57653 clone_with_convert is failing 2019-07-22 12:52:48 +02:00
Gonéri Le Bouder
e9b1e36d76 vcenter provider: avoid a TypeError exception
Avoid `TypeError: option values must be strings` with `ConfigParser`.
Default values must be string, not `None`.

The error happens when `test/integration/cloud-config-vcenter.ini` does
not have the `vmware_proxy_host` or `vmware_proxy_port` keys defined.
2019-07-22 11:19:39 +02:00
Martin Krizek
b7868529ee
Revert "Speed up VariableManager by preserving Templar state. (#45572)" (#59280)
This reverts commit 6069d09b9d.

Fixes #57351
2019-07-22 10:27:11 +02:00
Abhijeet Kasurde
791e565802
VMware: Additional testcase for mem_reservation (#59365)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-22 10:44:19 +05:30
Tyler Ramer
8d0f2e5725 Address regression causing bootproto=dhcp for manual IP addresses (#56376)
Commit b7724fdf85
appears to have caused a regression, where `ip4`, `gw4`, `ip6`, `gw6`
were converted to `ipv4.address`, `ipv4.gateway` etc.

This causes bootproto (or `ipv4.method`) to remain `dhcp`, as noted in https://github.com/ansible/ansible/issues/36615

This commit only reverts the key-value pairs to the original names,
which is in line with both expectation (manual ip addr == no dhcp) and
the language used in the playbook, which is, for example, "ip4" not
"ipv4.address"

Co-authored-by: Stuart Pollock <spollock@pivotal.io>
Co-authored-by: Tyler Ramer <tramer@pivotal.io>
2019-07-22 09:30:24 +05:30
Abhijeet Kasurde
1f49abb51c
VMware: Accept 0 as valid value for memory reservation (#59230)
vmware_guest accepts 0MB as valid value for memory reservation in
virtual machine hardware configuration. This fixes the regression
introduced via 193f69064f.

Fixes: #59190

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-22 09:03:25 +05:30
Jordan Borean
2f2b106423
Fix win_reg_stat for HKU hives (#59359) 2019-07-22 09:12:14 +10:00
Jordan Borean
015119df8c
Windows - Add common util for web requests (#54759)
* Windows - Add common util for web requests

* Use different method of retrieving options from module arg spec

* Added proper version_added for module options

* Fix linting errors

* Fix proxy issues and updated cred docs

* Fix FTP usage with proxy settings

* Removed uneeded function added in bad rebase

* Fix up client certificate auth

* fix new sanity checks

* Edit http agent code and update porting guide
2019-07-22 08:42:24 +10:00
Matt Clay
b378e885ed Make ansible-test TestMessage hashable. 2019-07-19 21:34:04 -07:00
Matt Clay
4f1d0f1b39 Skip using paths for ansible-doc sanity test. 2019-07-19 16:17:56 -07:00
The Magician
e7fba5cea0 New Module: gcp_mlengine_version (#59224) 2019-07-19 16:52:40 -04:00
The Magician
5b0214bcce New Module: gcp_appengine_firewall_rule (#58852) 2019-07-19 16:42:37 -04:00
The Magician
40ff1949fb New Module: gcp_mlengine_model (#59222) 2019-07-19 16:41:07 -04:00
Sam Doran
8edad83ae0
User - make groups and append mutually exclusive with local (#59309)
* Update intigration tests
2019-07-19 16:05:15 -04:00
The Magician
5c6aa9b9e8 Bug fixes for GCP (as of 2019-07-09T06:06:53Z) (#59171)
* Bug fixes for GCP modules

* ignore syntax
2019-07-19 11:33:47 -07:00
The Magician
c5e26ab4da Bug fixes for GCP (as of 2019-07-09T06:06:53Z) (#59172)
* Bug fixes for GCP modules

* ignore syntax
2019-07-19 11:33:04 -07:00
The Magician
b75e8d19be Bug fixes for GCP (as of 2019-07-09T06:06:53Z) (#59132)
* Bug fixes for GCP modules

* ignore syntax
2019-07-19 11:32:05 -07:00
Sloane Hertel
1d3f2c7764
disable s3_lifecycle tests (#59311) 2019-07-19 13:20:15 -04:00
Felix Fontein
4a574c4d0c Option parsing: warn if both an option and its alias are specified for a module (#53698)
* Print warning when both an option and its alias is specified.

* Improve output.

* Put warnings into self._warnings directly, resp. use self.warn() when handling subspecs.

* Add changelog.

* Add unit test.
2019-07-19 13:11:41 -04:00
Sam Doran
f231f21669
Handle situation where ansible_architecure may not be defined when gathering facts (#55466) 2019-07-19 11:33:05 -04:00
Nilashish Chakraborty
bb006db7c8
Add exclusive configuration mode support (#59289)
Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
2019-07-19 19:03:35 +05:30
Abhijeet Kasurde
4b152235ff
Typo fixes (#59227)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-19 18:18:14 +05:30
Raul Mahiques
fd2116e26a Added state "remount" which will remount the device (#52649) 2019-07-19 08:59:27 +02:00
Toshio Kuratomi
87601969a3 Correct places where match was intended
pytest.raises has two parameters, message and match.  message is meant
to be the error message that pytest gives when the tested code does not
raise the expected exception.  match is the string that pytest expects
to be a match for the repr of the exception.  Unfortunately, it seems
that message is often mistakenly used where match is meant.  Fix those
cases.

message is also deprecated so removed our usage of it.  Perhaps we
should write a sanity test later that prevents the use of
pytest.raises(message) to avoid this mistake.

seealso: https://docs.pytest.org/en/4.6-maintenance/deprecations.html#message-parameter-of-pytest-raises

Also update the exception message tested for as we're now properly
detecting that the messages have changed.
2019-07-18 17:10:58 -07:00
Aljaž Košir
42073b6331 Add lambda_bucket_event module (#58059) 2019-07-18 10:54:01 -07:00
Jill R
1c1da3c11d
Re-enable ec2_vpc_vpn_facts test (#58893) 2019-07-18 09:17:15 -07:00
pratikgadiya12
393e4a41d0 Added support to create and delete multiple databases in MySQL (#58602)
* Added support to create/delete mulitiple databases in MySQL

Fixes: #58370

* Added additional tests cases and fixed documentation changes

* Code refactoring and added tests for better test coverage

- Removed db_exists usage from most of the code. Used existence_list
 and non_existence_list instead

- Added additional tests to cover all scenarios w.r.t creation and deletion
 on multiple databases

- Added tests for dump operations

* Minor fix

* Minor fix - create check mode test

* Added dump tests for better dump tests coverage

* Removed minor database connection details

* fixed error

* Added test case for import operations

* Code refactoring and review fixes

- Added dump all test case

* Fixed review comments

* Minor review comment fixes

* Altered db_create return value

* Removed db_list and altered "does exist" to just "exist"

* Kept db and db_list in module.exit_json

* Refactored tests

- Added removal of dump2 file

* Moved import tests to state_dump_import file

* Removed import tests from multi_db_create_delete

* Updated porting guide, added RETURN block

* Minor identation fix

* Added validation to check if databases are dumped
2019-07-18 16:56:32 +02:00
Hannes Ljungberg
0e8eb1d17f pip: Remove unused option use_mirrors and remove all ignore.txt entries
PR #58977

* Remove unused option use_mirrors

* Add changelog fragment
2019-07-18 16:38:37 +02:00
Sam Doran
d2edf1d435 User - Create parent directories if they do not exist in the specified home path (#51043)
* Create a user home directory if it has parents that do not exist

The useradd command line tool does not create parent directories. Check if the specified home path has parents that do not exist. If so, create them prior to running useradd, then set the proper permission on the created directory.

Add tests

Signed-off-by: Sam Doran <sdoran@redhat.com>

* Use dict for default user group in tests

Signed-off-by: Sam Doran <sdoran@redhat.com>

* Fix tests

Signed-off-by: Sam Doran <sdoran@redhat.com>
2019-07-18 10:19:11 -04:00
Sumit Jaiswal
b01b1d40cf
PR to add Unit TC for Checkpoint network module (#57710)
* cp_network unit TC

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
2019-07-18 16:24:09 +05:30
Yunge Zhu
cb201bfba1 add xmltodict to azure requirements file (#55748)
* add xmltodict

* fix lint
2019-07-18 01:32:51 -04:00
Sebastiaan Mannem
d0538c0d7a postgresql_pg_hba: Exception when two lines with same weight are compared (#59198) 2019-07-18 10:50:19 +05:30
Abhijeet Kasurde
8a13b41823
VMware: Use managed object id to find VM (#59143)
* Based upon partial work of wilmardo
* Now, user can specify managed object id of virtual machine to find
an existing virtual machine

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-18 07:38:12 +05:30
Yunge Zhu
42c43a2822 add azure_rm_keyvaultkey_info module (#55754) 2019-07-18 06:55:51 +08:00
Matt Clay
13bbfacb04 Show ansible-test --explain errors in CI. 2019-07-17 15:34:00 -07:00
Andrey Klychkov
0e09800a9a Postgresql modules: tidying up of CI tests (#59099) 2019-07-17 11:00:40 -04:00
Brian Coca
a39b721db5
fixes to config manager (#58530)
* skip unreadable ansible.cfg

* all types should check for type

* patch access for tests and fix tests that relied on missing files not being checked
2019-07-17 10:39:30 -04:00
dx0xm
b8eba8e1f0 VMware: Add testcase for vmware_dvs_portgroup_facts (#59088)
* Tests for choosing specific DVS while gathering facts

Signed-off-by: dx0xm <52723266+dx0xm@users.noreply.github.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-17 18:31:52 +05:30
Hannes Ljungberg
6f94995b52 npm: Validate all option types (#58965)
* Add type validation for name, version and registry
* Add changelog fragment
* Remove ignore of E337 and E338
2019-07-17 09:34:58 +05:30
Matt Davis
d28f25d118
patch ansible-connection collection plugin loading (#59119) 2019-07-16 13:46:15 -07:00
Matt Clay
d4dec59cb0 Fix collection loader builtin handling. (#58897)
- Support more import statements:

  from ansible_collections.ansible.builtin.plugins.module_utils import basic
  from ansible_collections.ansible.builtin.plugins.module_utils.basic import AnsibleModule

- Add unit tests for more import statements.
- Raise ImportError instead of returning None if load_module fails.
2019-07-16 13:40:22 -07:00
Toshio Kuratomi
019d078a5a
Move common build code from _build_helpers (#55986)
We have some common code used by several docs scripts.  Migrate that
into the build-only shared code repository.

* Move lib/ansible/utils/_build_helpers.py to the directory for common
  build code
* Migrate docs/bin/dump_config.py to a build-ansible subcommand
* Migrate dump_keywords to the build-ansible framework
  * Make the script more maintainable by using functions and good
    variable names
  * Port to Python3 idioms
  * Fix bug so that private attributes will be undocumented
* Move generate_man to a build-ansible subcommand
* Port plugin_formatter to a build-ansible subcommand
* Rework command_plugins so that docs scripts can target Python-3.4+ and
  releng-only subcommands can use more recent versions of Python.
  The architecture is now that command_plugins/* need to be importable
  on Python-3.4.  The init_parsers() method needs to run on Python-3.4.
  But the main() method can utilize features of more recent Python as
  long as it fits within those parameters.
* Update docs build requirements

Port the plugin_formatter to build-ansible framework
2019-07-16 12:19:01 -07:00
Matt Clay
cb0dfc9793 Prepare pylint test for collections support. 2019-07-16 11:24:16 -07:00
Chris Archibald
8bf069114f New Module: Vscan Enable (#57953)
* new module

* fix netapp.py

* updates

* fixes
2019-07-16 13:40:56 -04:00
Sam Doran
d17e7a91b1
Add test for meta: end_play (#59118)
- Set ansible_python_interpreter for hosts using local connection
2019-07-16 12:41:48 -04:00
Wojciech Sciesinski
e8a7d89180 Correct a documentation of the jenkins_plugin module (#59139) 2019-07-16 11:46:18 -04:00
Matt Clay
2ed78b650f Update to ansible-test to prepare for collections.
Changes to simplify merging of collections support.
2019-07-16 08:04:07 -07:00
Abhijeet Kasurde
de66abe521
VMware: Add support for storagePod (#58627)
* User now can be specify datastore cluster for deploying OVF
* Added find_resource_pool_by_cluster API

Fixes: #57849

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-16 13:14:21 +05:30
Matt Clay
4b9391f32a Clean up ansible-test target handling. 2019-07-15 20:33:23 -07:00
Matt Clay
4255ee8e5a Prepare ansible-test for collections support.
Another round of changes to prepare ansible-test for supporting collections to help keep later PRs a manageable size.
2019-07-15 17:46:29 -07:00
Matt Clay
f81238012b Clean up pylint issues in test infra. 2019-07-15 14:45:30 -07:00
Martin Krizek
4898b0a4a2 group: detect duplicate GIDs when local=yes (#58469) 2019-07-15 12:52:15 -04:00
Alvaro Olmedo Rodriguez
a1dcba63b3 java_keystore - Prefer SHA256 and solve SHA256 keytool in java11 version (#57302) 2019-07-15 12:44:30 -04:00
Andrey Klychkov
2a07123fdd jboss module: add check mode support and integration tests (#58959)
* git war file and wildfly archive from S3
* create setup_wildfly_server role for integration tests
2019-07-15 12:17:08 -04:00
Noe Gonzalez
3a5d13b0d7 VMware: Fix vmware_guest cloning bug (#58737)
* fix vmware_guest cloning bug
* added tests for resizing disks during clone
2019-07-15 10:09:54 +05:30
n3pjk
a135c483ce Add OAuth and Multi-Record Query for SNOW (#58410)
* Add SNOW OAuth Support and Multi-record Query

* Add OAuth documentation to snow_record_find

* Fix lint and verification issue for PR 58410

* Fix E309 and E324 errors in PR 58410

* Fix E307, need advice on E309

* Fix E309 for PR 58410

* Re-add instance, username and password documentation

* Fix data type mismatch in documentation

* Remove doc_fragment overlap

* Refactor service now module space

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-13 20:34:36 +05:30
Matt Clay
d910c971b4
Minor ansible-test code cleanup. (#59052)
* Minor ansible-test code cleanup.
* Fix type annotations.
2019-07-12 21:58:19 -07:00
The Magician
d1587bca41 Bug fixes for GCP modules (#58902) 2019-07-12 18:50:49 -04:00
Chris Archibald
f3aac3a112 MOTD was not idempotent (#57372)
* fix issue

* fix issues

* fix issues

* fix issues
2019-07-12 16:47:41 -04:00
The Magician
51e1b090db Bug fixes for GCP modules (#58901) 2019-07-12 16:21:43 -04:00
The Magician
119b8521a6 Bug fixes for GCP modules (#58904) 2019-07-12 16:21:31 -04:00
Matt Clay
6645054329
Code cleanup for test infrastructure. (#59046)
* Remove useless object inheritance in test code.
* Remove unnecessary pass statements from test code.
* Comment on why certain pylint rules are ignored.
* Add more pylint test contexts.
* Fix import order.
* Remove unused variables.
* Remove unnecessary pass statement.
* Fix bad continuations.
* Remove unnecessary elif.
* Allow legitimate broad except statements.
* Allow legitimate protected access.
* Clean up names to make pylint pass.
2019-07-12 13:17:20 -07:00
Toshio Kuratomi
dd2755e0b4 Fix pylint warnings for update-bundled 2019-07-12 12:35:56 -07:00
The Magician
6fb7a2b7cc Bug fixes for GCP modules (#58903) 2019-07-12 15:11:22 -04:00
The Magician
5cd0e2f19f Bug fixes for GCP modules (#58900) 2019-07-12 15:08:08 -04:00
Ganesh Nalawade
70db07fa82 Fix junos_interfaces integration test failure (#59035)
* Fix junos_interfaces failure

*  Remove lo0 interface by default since
   vsrz zuul env seems to add it intermittently
   as part of device intial config

* Add missing change for replace case
2019-07-12 13:55:28 -04:00
Pavan Bidkar
7b8edbf9dd VMWare: New Module for content library CRUD operations (#58716) 2019-07-12 09:34:05 -07:00
Matt Clay
3f2b766d10 Add future and metaclass boilerplate to test code.
Continue to ignore:

- test/integration/
- test/legacy/
- test/units/
2019-07-12 09:18:24 -07:00
Gonéri Le Bouder
f98a4ef2f7 vmware: ro=False datastores for the functional test
https://github.com/ansible/ansible/issues/58541 prevents us from using
read-only datastore. So for now, we mount everything read-write.
2019-07-12 16:23:17 +02:00
Pavan Bidkar
6bd6bf98e5 VMware: New Module for VMWare content Library info (#58703)
* Changes as per review comments and renamed file to vmware_content_library_info
* Removing password field from publish info dictionary
* Removed current password field from publish info
* Modified vmware_content_library_info module with review comments.
* Review comments. Moved test .yml files under tasks folder
* Moved test files under module name folder. Handled library_get call under try catch to throw proper error message
* Fixed precheck failure bare except. Catching Exception
2019-07-12 15:50:30 +05:30
Gonéri Le Bouder
31baab85f9 ansible-test: vcenter through a HTTP proxy
Give the ansible-test user the ability to target a lab behind a HTTP proxy.
2019-07-12 10:56:36 +02:00
Abhijeet Kasurde
617972499f
VMware: Correct network_exists_by_name API call (#59006)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-12 11:22:06 +05:30
Ganesh Nalawade
f09bd91ad0
Add junos_interfaces resource module (#58871)
* Add junos_interfaces resource module [junos_interfaces]

*  Add new resource module junos_interfaces.
*  Targets model https://github.com/ansible-network/resource_module_models/pull/8
*  Depcreate junos_interface module

* Fix CI failures

* Fix integration test failures

* Fix CI failures

* Fix review comments
2019-07-12 09:05:48 +05:30
Matt Clay
6327a6114b Add ansible-test units --num-workers option. 2019-07-11 17:15:16 -07:00
Matt Clay
43c3b9fb0e Simplify ansible-test cwd setup. 2019-07-11 17:15:16 -07:00
Chris Archibald
9cb78b4826 New options to volume (#58531)
* updates to volume

* fix ansibot

* fix issues

* Revert "fix issues"

This reverts commit 54988709ae.
2019-07-11 17:42:00 -04:00
Matt Clay
bc3a599678 Fix invalid type hints in ansible-test. 2019-07-11 14:25:57 -07:00
Jordan Borean
bcc23e70e6
win_dns_client - fix bug in devel and added tests (#58971)
* win_dns_client - fix bug in devel and added tests

* Fix sanity issue
2019-07-12 05:36:12 +10:00
Chris Archibald
59feb63d19 Add uid, and gid to volume clone (#57371)
* and new features

* fix issues

* fix issues

* fix issues

* add unit tests
2019-07-11 13:57:36 -04:00
Brian Coca
a7b14ec1be
Fix strat inv (#58982)
* Fix strategy functions that update inventory

* added tests
2019-07-11 13:49:49 -04:00
Matt Clay
86ad4c99ba Reorganize util code in ansible-test.
Code in util.py that depends on CommonConfig is now in util_common.py.
2019-07-11 08:54:13 -07:00
Chris Archibald
6e3d54ae81 Set vscan_fileop_profile for na_ontap_cifs (#57373)
* new features

* update unit tests
2019-07-11 10:49:35 -04:00
Sam Doran
36da7e462a
Better fix for invalid data in 'options' field (#58353) 2019-07-11 10:19:18 -04:00
pratikgadiya12
e8f4ebb22c nmcli: Argument vlanid (int) is changed internally to string (#58963)
* Argument vlanid (int) is changed internally to string
* Modified test case to check vlan id

Fixes: #58949
2019-07-11 18:02:02 +05:30
Toshio Kuratomi
33d2728879 Rename python files in hacking/ directory to have .py suffix
ansible-test only passes files which have the .py suffix for sanity
tests on python files.  This change will allow sanity tests to run on
the Python files in hacking/

* Rename test-module to test-module.py
* Symlink test-module for backwards compat since end users may be using
  test-module
* Fix test-module sanity errors that are now triggered
* Rename ansible_profile to ansible-profile.py
* Rename build-ansible
2019-07-10 22:17:35 -07:00
Toshio Kuratomi
146a7f8ff6 Split the metaclass == type and from future boilerplate code.
The metaclass boilerplate is safe to apply en masse.  The future import
boilerplate needs code to be inspected to be sure that there aren't any
py2isms that need to be fixed.  Split these two checks so that we can
fix them independently

Be explicit about which files are grandfathered so we can fix them up one by one
2019-07-10 22:17:35 -07:00
Gonéri Le Bouder
909f7f2ce5 vmware_dvswitch_nioc: fix the integration test (#58920)
Correct the name of the vcenter variables.
2019-07-11 08:06:27 +05:30
Chris Archibald
ee24e6c5be Qtree was not idempotent (#58596)
* fixes

* fixes
2019-07-10 20:18:17 -04:00
flowerysong
c513c1e2d3 aws_s3: Improve ETag handling (#46332)
* cosmetic: Remove useless call to ec2_argument_spec()

* aws_s3: Improve ETag handling

* Extract ETag calculation into a utility function for reuse by
  aws_s3_sync.
* Reduce code duplication in put/get by restructuring the logic
* Only calculate ETag when overwrite == different
* Fail gracefully when overwrite == different and MD5 isn't available
  (e.g. due to FIPS-140-2).

* aws_s3: clean up integration tests

Clean up tests, add tests for overwrite settings in both directions.
2019-07-10 14:05:12 -07:00
Pilou
b58c64e3b1 consul_session: ensure empty result is handled (#58694) 2019-07-10 15:15:18 -04:00
anshulbehl
00d7aed56b
Changing LBName used by same task inside azure_rm_loadbalancer (#58936)
fixes #58933
2019-07-10 14:20:35 -04:00
Matt Clay
c79afb1cba Move ansible-test unit coverage code into plugin. 2019-07-10 10:09:46 -07:00
Matt Clay
520af5cb47 Sanity test fixes for future collections support. 2019-07-10 07:03:48 -07:00
Paul Belanger
9e1b19e364 Fix nxos_install_os test cases typo (#58825)
This should be ansible_connection, not connection_type. We can also
update local testing logic.

Remove nxos_install_os/tasks/network_local.yaml as it is nolonger used.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-07-10 19:11:53 +05:30
Sam Doran
c68bf5997f
Add version 2.13 to the removed_in list (#58924) 2019-07-10 09:38:31 -04:00
Pilou
ef1cf2d2e8 consul_session: ensure scheme parameter is used (#58692)
* Ensure an error occurs when unknown scheme is used
* consul_session: don't ignore 'scheme' parameter
2019-07-10 09:16:17 -04:00
Martin Krizek
7346b699ee
Use templated loop_var/index_var when looping include_* (#58866)
Fixes #58820
2019-07-10 13:49:24 +02:00
Gonéri Le Bouder
ad49057330 fix the vm name 2019-07-10 12:19:55 +02:00
Tomorrow9
fcc0b71c74 add new module vmware_guest_sendkey 2019-07-10 12:19:55 +02:00
Andrey Klychkov
41b7b1c6e9 jboss module: actualize doc formatting (#58913)
* jboss module: actualize doc formatting, remove exceptions from ignore.txt
2019-07-10 15:38:53 +05:30
rajaspachipulusu17
753f998262 Pluribus Networks ipv6 security reguard vlan module with UT (#58319) 2019-07-10 14:39:53 +05:30
Andrey Klychkov
63b606ee94 postgresql_user: add integration tests (#58864)
* postgresql_user: add separate integration tests

* postgresql_user: add separate integration tests, add always block

* postgresql_user: add separate integration tests, include -> import_tasks, jinja checks

* postgresql_user: add separate integration tests, fix formatting

* postgresql_user: add separate integration tests, fix formatting

Co-Authored-By: Felix Fontein <felix@fontein.de>
2019-07-10 10:59:28 +02:00
Chris Archibald
8731fc7a86 returning invalid security (#58595) 2019-07-10 00:40:31 -04:00
Matt Clay
9e67953b2e
Fix collection loader and add unit tests. (#58701)
* Use `compile` before `eval` in collection loader.

This fixes two issues:

1. File names are available when tracing execution, such as with code coverage.
2. Future statements are not inherited from the collection loader.

* Add unit tests for collection loading.

These tests verify several things:

1. That unit tests can import code from collections when the collection loader is installed.
2. That tracing reports the correct file and line numbers (to support code coverage).
3. That collection code does not inherit __future__ statements from the collection loader.

* Update unit test handling of the collection loader.

Since the collection loader is installed simply by importing ansible.plugins.loader,
we may already have a collection loader installed when the test runs. This occurs if
any other tests are collected which use that import during collection. Until that code
is moved into an initialization function to avoid loading during import, the unit tests
will need to replace any existing collection loaders so that they reflect the desired
configuration.

* Insert into sys.modules before calling exec.

This is a requirement of PEP 302.

It will prevent recursion errors when importing the current module or using a relative import.

* Use the correct value for __package__ in modules.

This allows using relative imports in collections.

* Add warning about modifying code for trace test.

* Add test for relative import in collection.

* Add __init__.py to collection to satisfy pylint.

The relative-beyond-top-level rule in pylint may not be appropriate for collections.
However, until that rule is disabled for collections this will keep tests passing.
2019-07-09 17:31:33 -07:00
Matt Clay
1e1463401d
Prepare ansible-test for supporting collections. (#58886)
This is a small but incomplete set of the initial changes for supporting testing of collections with ansible-test.
2019-07-09 17:31:04 -07:00
Sam Doran
b9dafdbade
Move integration tests to using RHEL 8.0 GA (#57772) 2019-07-09 17:45:06 -04:00
Sam Doran
5ccd674dba
Update default test container to use Python 3.8.0b2 (#58877) 2019-07-09 17:44:16 -04:00
Jordan Borean
b6791e6ae3
ansible-galaxy: add collection sub command (#57106)
* ansible-galaxy: add collection init sub command

* Fix changelog and other sanity issues

* Slim down skeleton structure, fix encoding issue on template

* Fix doc generation code to include sub commands

* Added build step

* Tidy up the build action

* Fixed up doc changes and slight testing tweaks

* Re-organise tests to use pytest

* Added publish step and fixed up issues after working with Galaxy

* Unit test improvments

* Fix unit test on 3.5

* Add remaining build tests

* Test fixes, make the integration tests clearer to debug on failures

* Removed unicode name tests until I've got further clarification

* Added publish unit tests

* Change expected length value

* Added collection install steps, tests forthcoming

* Added unit tests for collection install entrypoint

* Added some more tests for collection install

* follow proper encoding rules and added more tests

* Add remaining tests

* tidied up tests and code based on review

* exclude pre-release versions from galaxy API
2019-07-10 05:47:25 +10:00
The Magician
d336a989e4 Bug fixes for GCP modules (#58848) 2019-07-09 14:35:35 -04:00
The Magician
9721c4045b Bug fixes for GCP modules (#58849) 2019-07-09 14:35:25 -04:00
The Magician
eb839c94ea Bug fixes for GCP modules (#58850) 2019-07-09 14:35:14 -04:00
The Magician
d88f686976 Bug fixes for GCP modules (#58851) 2019-07-09 14:35:03 -04:00
Miguel Angel Muñoz González
d50531c6bd New Fortinet's module for fortios_user_device (using new httpapi plugin) (#58291)
* New Fortinet's module for fortios_user_device (using new httpapi plugin

* Fix documentation errors

* Update lib/ansible/modules/network/fortios/fortios_user_device.py

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update lib/ansible/modules/network/fortios/fortios_user_device.py

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update lib/ansible/modules/network/fortios/fortios_user_device.py

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update lib/ansible/modules/network/fortios/fortios_user_device.py

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update lib/ansible/modules/network/fortios/fortios_user_device.py

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update lib/ansible/modules/network/fortios/fortios_user_device.py

Co-Authored-By: Sandra McCann <samccann@redhat.com>
2019-07-09 15:53:36 +05:30
Gonéri Le Bouder
140a8e53f3 vmware_guest: do not use infra.vm_list
Update the functional tests of `vmware_guest` to use the
`virtual_machines` data structure.
2019-07-09 11:55:12 +02:00
Andrey Klychkov
88ec5e14cb Add unit tests for lenient_lowercase function (#58586) 2019-07-08 18:33:15 -04:00
Will Thames
446919de6f Add apply to k8s module (#49053)
* Add apply to k8s module

Use apply method for updating k8s resources.

* Improve apply documentation

* k8s: Make apply and merge_type mutually exclusive
2019-07-08 13:47:41 -07:00
Shachaf92
7ddcaafee5 many pslint fixes (#55862)
* Handles:

PSAvoidTrailingWhitespace
PSAvoidGlobalVars
PSAvoidAssignmentToAutomaticVariable
PSAvoidUsingCmdletAliases
PSAvoidUsingWriteHost
PSUseDeclaredVarsMoreThanAssignments
PSUsePSCredentialType
PSAvoidUsingPositionalParameters
PSAvoidUsingEmptyCatchBlock
PSAvoidUsingWMICmdlet

Replaced Write-Host with Write-Output
Added smart reboot check for win_domain feature installation
Modify the Creation of the pagefileto fit to CIM
Changelog fragment addition
Ignore.txt without fixes

* Changes after community reviews

* Change Out-Null to '> $null'

* Fixes after jborean93 comments

* Test

* Revert "Test"

This reverts commit 35c5c0648fa9d2868a18094d84954e53ffa28880.

* Removed all  > $null since they broke the module since the output got dumped

* run test again

* Revert "run test again"

This reverts commit 80eaf07143f9d8cb0116cbbc68a6a69c0ace840c.

* Changes after community review

* ignore PSUseDeclaredVarsMoreThanAssignments that are on a diffrent PR

* CI failed on extra line in ignore.txt

* Review changes

* PSlint errors

* Trail space

* send to null breaks the tests for  Set-Workgroup

* Lint stuff

* win_domain_user issue of indent.

* Update win_domain_user.ps1

* Update win_domain_membership.ps1

* Fix redirect to null

* lint space issue

* removed return from set-workgroup

* removed send to null
2019-07-09 05:41:58 +10:00
Will Thames
88364d4cfd Add purge_tags to s3_bucket to allow preservation of existing tags (#58754)
* Add purge_tags to s3_bucket to allow preservation of existing tags

Adding `purge_tags` with default `True` to maintain existing behaviour
allows users to set it to `False` to preserve existing tags

Fixes #29366

* s3_bucket: Add further tests and improve tag handling further

Additional tests for purge_tags: False suggested some incorrect
logic and thus further improvements

Increase wait timeout on bucket deletion as it wasn't always completing
in the default 100 seconds
2019-07-08 10:19:01 -07:00
Abhijeet Kasurde
79fdc2190a role: Fix role's hash_params (#55263)
* role: Fix role's hash_params

Fix based upon work done by alikins.

Fixes: #20596

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-08 09:25:59 -04:00
Diane Wang
9c140d26d5 VMware: add new module vmware_guest_network (#52075) 2019-07-08 07:54:54 +05:30
smile37773
8ff97edd1a Add the singlePlacementGroup in the virtual machine scale set module (#58320) 2019-07-06 06:14:14 +08:00
Toshio Kuratomi
0c992d5ae4 Fix for skipping of gitlab_runner test.
Correct variable name for skipping of the gitlab test when gitlab python
client is not installed.
2019-07-05 11:47:19 -07:00
Sunil Raj
641f7c4ae3 VMware: Updates the DRS rule without deletion (#57119)
* The DRS rule will be updated if any changes in the configuration without deleting the existing rule.
The rule itself is updated by the given configuration.
* Lint errors fixed
* VMware: update vmware_vm_vm_drs_rule testcases
2019-07-05 17:00:05 +05:30
Mariusz Mazur
2fb06650a7 kubevirt: even more unit tests (#58593) 2019-07-05 20:35:32 +10:00
Shachaf92
a6b7d0d00b win_domain_user and win_domain_group: add created result boolean (#57901)
* win_domain_user and win_domain_group: add created result boolean

* Fix YML

* add docs

* brackets

* Update win_domain_group.py

* Update win_domain_user.py

* Update win_domain_user.ps1

* fix indent
2019-07-05 08:44:07 +10:00
Shachaf92
e0b8bc1ef9 win_firewall_rule: Only report changed when change is made (#57267)
* Fix bug https://github.com/ansible/ansible/issues/44450

* Added tests

* I will make this CI work

* Update win_firewall_rule.ps1
2019-07-05 08:06:34 +10:00
PRASOON KARUNAN V
db5656cf6e Add support for pester tags (#57918)
* correct argument name

* added documentation

* adding missing version_added to doc

* correcting description in docs

* change type to list

* add tests

* correct test file
2019-07-05 07:45:52 +10:00
Will Thames
60fb9fc208 Fix EC2 test suite to work with testing policies (#44387)
* Update testing policies to ensure all required permissions are present
* Tidy up security policies to reduce duplicate permissions
* Make roles static so that they can be present before CI is run,
  meaning that role creation permission is not required by the CI
  itself, only by someone setting up the roles prior to testing
* Move contents to cloudfront policy to network policy to ensure policy
  count (maximum of 10) stays low
* Maintain compute policy below 6144 bytes
2019-07-04 15:25:19 -04:00
Andrey Klychkov
6cf722fed6 postgresql_query module: add autocommit parameter (#58704)
* postgresql_query: add autocommit parameter

* postgresql_query: add autocommit parameter, add CI tests

* postgresql_query: add autocommit parameter, add a changelog fragment

* postgresql_query: add autocommit parameter, fix sanity

* postgresql_query: add autocommit parameter, cosmetic fix
2019-07-04 12:25:51 +02:00
Sam Doran
d50c8c2b83
Improve setup_docker tests to work with RHEL 8 GA (#58649)
- use include_vars to set appropriate packages and pip packages per distribution and version
- install an older version of Docker CE on RHEL 8 since a dependency is unavailable
- disable warnings on tasks that are ok
- skip tests for CentOS/RHEL 6
2019-07-03 14:24:24 -04:00
Matt Martz
737dbefd78
Get copy tests passing with split controller/target (#58516)
* Get copy tests passing with split controller/target

* Remove sudoers file

* add missed set_fact
2019-07-03 10:37:33 -05:00
Sam Doran
16d6fcf514
Improve dnf test formatting and fix RHEL 8 module name (#58648)
- use single include_vars task rather than multiple set_fact tasks
- use multi-line YAML to break up long conditionals
- use version() test rather than direct comparisions
- use different appstream package on RHEL since '@swig:3.0/default' is not working in the GA
2019-07-03 11:11:20 -04:00
Andrey Klychkov
2e9db87a1b azure_rm_gallery: add disabled to aliases (#58672) 2019-07-03 22:43:06 +08:00
Abhijeet Kasurde
96eccda23b
VMware: Add module vmware_vm_storage_policy_info (#56263)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-03 16:01:08 +05:30
smile37773
8f0bf3e453 Add the azure_rm_..._info modules (#58576) 2019-07-03 13:48:14 +08:00
Ganesh Nalawade
1e3034b96d
junos_facts refactor to work with resources modules (#58566)
* junos_facts refactor to work with resources modules

*  Refactor junos_facts module to work with
   network resource module.

* Fix unit test failures

* Fix review comments
2019-07-03 10:08:45 +05:30
Brian Coca
ee4cba1b85 ensure bytes in run_command (#58411)
* ensure we pass bytes to run_command

* changed tests for new behaviour

* dont b the pytest

* fixes by sivel
2019-07-02 17:07:48 -05:00
s-hertel
7ec31194a5 Ensure only running instance facts are retrieved to match the following assertion
Otherwise lingering terminated instances may be in the result
Use the instance profile arn or the role name, but not the role arn
Mark tests as unstable
2019-07-02 17:48:07 -04:00
Will Thames
a6d757e074 Ensure block device instance creation outputs instances
Not waiting outputs results in a format that will never
be matched by the tests

Ensure instances get tidied up

Allow ec2:ReportInstanceStatus

ec2_instance: Improve test cleanup on failing tests

Improve describe/modify attribute error handling

Address feedback on PR
2019-07-02 17:48:07 -04:00
Andrea Tartaglia
da1a621bd9 Removed nested role for ec2_instance tests
Also moved environment setup and environment cleanup to separate task
files

Added CI group

Updated c4.large instances to t3.nano, use ENA enabled AMI

Updated AMIs with Amazon Linux AMI

Updated us-east-1 AMI id

Specify EBS size

typo, volume_size

Removed 'state: running', updated AMI with amz ami

Also added several wait: false to speed things up

Check for instance state, correctly

Accept pending as valid state

tags_and_vpc_settings do not wait for instance to complete

wait for termination protected instance

Updated IAM role name to match with policy

Skip env cleanup when in CI

Do not wait instance in external_resource_attach

ENI remove is done in env_cleanup/CI

wait some time for instance_profile instnace to be up

Updated ebs_optimized_images

Corrected task name

Added aws_cleanup var in cloud-config-aws

typo in runme

default aws_cleanup to true
2019-07-02 17:48:07 -04:00
lijok
63bdd0d6cd VMware: looking up maxMksConnections in incorrect location (#58061)
maxMksConnections is contained in vim.vm.ConfigInfo not vim.vm.VirtualHardware

Fixes: #58060

Signed-off-by: lijok <28689084+lijok@users.noreply.github.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-02 11:49:00 -07:00
Matt Martz
0e9cfd3ee8
Fix sanity tests that are failing with LC_ALL set (#58604) 2019-07-02 10:56:12 -05:00
Pluggi
7f15331510 Add build.target option to docker_image module (#58487)
Signed-off-by: Antoine Bardoux <pluggi512@gmail.com>
2019-07-02 09:42:35 -04:00
Andrey Klychkov
4da6d8cbf9 postgresql_ext: add version parameter (#58381)
* postgresql_ext: add version new option

* postgresql_ext: add version new option, fix ssl tests

* postgresql_ext: add version new option, fix tests

* postgresql_ext: add version new option, fix examples

* postgresql_ext: add version new option, fix the doc

* postgresql_ext: add version new option, fix examples

* postgresql_ext: add version new option, fix typo in tests
2019-07-02 15:24:46 +02:00
Jordan Borean
c3978fed4b
Load Ansible module_utils for ps_argspec validator (#58571)
* Load Ansible module_utils for ps_argspec validator

* fix validation for modules without Requires statement

* Moved future comment to proper location
2019-07-02 12:22:38 +10:00
Jordan Borean
c260721ce5
win_domain_user: do not hide error on failures (#58357)
* win_domain_user: do not hide error on failures

* Was a bit too overzealous in the removal

* Remove uneeded sanity ignore rule
2019-07-02 07:40:51 +10:00
Felix Fontein
5d5a7d6ebe
openssl_privatekey: forgot to add secp256r1 (#58605)
* Forgot to add secp256r1. This one is the interoperable one.

* Add changelog.
2019-07-01 23:08:54 +02:00
Andrey Klychkov
10af2636d1 Add unit tests for human_to_bytes (#58584) 2019-07-01 13:50:54 -04:00
Sam Doran
c1a23cd763 Add two new Azure groups to prevent timeouts
ci_complete
2019-07-01 10:38:24 -07:00
Pilou
5f8080aaa0 consul_session: improve documentation and add integration tests (#56392)
* consul_session: Python 2.6 is always required on managed node
* consul_session: document all types
* consul_session: add doc for 'id' parameter
* consul_session: improve parameter descriptions
    - use formatting functions in descriptions
    - 'name' parameter is required when state=node
* consul_session: use required_if
* consul_session: add integration tests
* consul_session: use 'retry' with network dependent tasks
* Use ansible-ci-files bucket for consul binaries

Co-Authored-By: Matt Clay <matt@mystile.com>
2019-07-01 10:27:15 -04:00
Tim Rupp
580b013837 rpm_key - add fingerprint parameter (#58373)
This parameter can be used to verify keys before they are imported by providing the long form fingerprint of the key.
2019-07-01 09:57:45 -04:00
Aaron Longchamps
045caaa400 VMware: Adding IP-Specific properties to ESXi host firewall config (#56733)
* Adds IP-Specific properties to firewall config

Fixes: #51240
2019-07-01 16:13:58 +05:30
Diane Wang
39fbdc22ff VMware: Add new module vmware_guest_screenshot (#57449)
Signed-off-by: Tomorrow9 <tommorrow7@gmail.com>
Co-Authored-By: Abhijeet Kasurde <akasurde@redhat.com>
2019-07-01 15:58:05 +05:30
Sumit Jaiswal
539f37ede3
PR to implement ansible_net_model for iosxr facts module (#58488)
* resolves 57767

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* added test

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
2019-07-01 12:26:04 +05:30
Felix Fontein
f0801879c7 Rename xenserver_guest_facts -> xenserver_guest_info (#57032)
* Rename xenserver_guest_facts -> xenserver_guest_info.

* Add changelog.

* Forgot one test.
2019-06-30 10:04:30 -04:00
Gonéri Le Bouder
2401154fc4 VMware: rename VMWare to VMware (#58535)
Follow the nomenclature convention decided in https://github.com/ansible/ansible/pull/56814
2019-06-30 19:30:42 +05:30
Sam Doran
8cfd0ba039 Allow for test groups with double digits (#58532) 2019-06-28 16:24:14 -07:00
Sam Doran
ab6a9ef130
Get minor version number for CentOS and Debian (#57814)
* Get the most detailed version number from distro.version() for CentOS and Debian
* Update tests and fixtures
* Update fixture generation script to gather distro info and work with Python 3
* Update LinuxMint fixtures
* Cleanup fixture formatting
* Improvements based on feedback from abadger:
    - use unicode since that is what distro returns
    - use frozenset with a tuple
    - include link Debian to bug
2019-06-28 19:21:35 -04:00
Sam Doran
6cf6f5a34b
Use atexit to cleanup tmp dirs (#56532)
* Wrap everything in try/except to avoid leaving files behind
* Add unit tests, integration tests, and changelog
* Do text the correct way
2019-06-28 16:19:27 -04:00
Toshio Kuratomi
8acf71f78f
Skip tests with unsatisfied deps (#55853)
* Skip gitlab tests if dependencies aren't met

* Skip certain unittests if passlib is not installed

* Fix tests with deps on paramiko to skip if paramiko is not installed

* Use pytest to skip for cloudstack

If either on Python-2.6 or the cs library is not installed we cannot run
this test so skip it
2019-06-28 13:09:36 -07:00
Sloane Hertel
826f224f02
Handle vaulted non-ascii characters for Python2 (#58503)
* Handle vaulted non-ascii characters for Python2

* Add a test to ensure str() no longer raises UnicodeEncodeError
2019-06-28 13:23:15 -04:00
Gonéri Le Bouder
e28bc46353 vcenter provider: set default values
Set default value for the following optional parameters:

- vcenter_port
- vmware_proxy_host
- vmware_proxy_port

This way we won't get an error if they are not define in the
configuration file.
2019-06-28 13:13:30 -04:00
Sloane Hertel
23f0ca0acd fix unarchive integration tests when LC_ALL is not set to en_US.UTF-8 (#58431) 2019-06-28 09:47:10 -07:00
Olivier Scherler
7ed7d374e4 Fix onepassword lookup plugin and onepassword_facts module when a field has no name. (#58308)
* Fix onepassword lookup plugin crashing on fields with no 'name' or 't' property.

* Fix onepassword_facts module crashing on fields with no 'name' or 't' property.

* Add unit test for onepassword lookup plugin failing on entries without a name.

* Add changelog fragment for onepassword lookup plugin and onepassword_facts module fixes on fields without a name.
2019-06-28 12:37:14 -04:00
Joseph Andreatta
0a27ad6ea0 VMware: Add new module vmware_dvswitch_nioc (#44147)
Signed-off-by: Joseph Andreatta <joseph@vmware.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-28 18:11:33 +05:30
Chris Van Heuveln
0868fec8bd nxos_vpc: pkl_vrf fixes for #57069 (#57370)
* nxos_vpc: pkl_vrf fixes for #57069

Fixes #57069

- Symptom: When playbooks specify `pkl_vrf: default`, the result is that the cli does not set the `vrf` state.

- Analysis:
 - First issue: 'default' is a reserved word when used with the `peer-keepalive` `vrf` keyword. It refers to the default rib.
   - This is confusing in several ways because `peer-keepalive`'s *default* vrf is the `management` vrf.

 - Second issue: When changing only one optional value (`pkl_vrf`) while other optional values are idempotent (`pkl_src`), the result is that the idempotent values are ignored; unfortunately the device cli *replaces* the entire command, in which case the idempotent values are removed.
   - e.g. playbook specifies this:
     ```
     { pkl_dest: 10.1.1.1, pkl_src: 10.2.2.2, pkl_vrf: my_vrf }
     ```

     ```
     peer-keepalive dest 10.1.1.1 src 10.2.2.2             # original

     peer-keepalive dest 10.1.1.1 src 10.2.2.2 vrf my_vrf  # intended result

     peer-keepalive dest 10.1.1.1 vrf my_vrf               # actual result
     ```

 - Third issue: the `pkl` getter was relying on positional data. This broke when the `udp` keyword nvgen'd where `vrf` used to appear (shifting all keywords to the right).

- Tested on regression platforms: `N3K,N6k,N7K,N9K,N3K-F,N9K-F`

* PEP fixes

* PEP fix 2

* pkl should merge by default, not override

* rmv debugs

* add mike's tests

* fix comments
2019-06-28 16:18:46 +05:30
Abhijeet Kasurde
760dc19284
VMware: Set vapp settings while creating VM (#58156)
vApp Settings can be set while creating VM.

Fixes: #50617

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-28 11:57:26 +05:30
Matt Clay
4403f866e3 Simplify Git class in ansible-test. 2019-06-27 18:01:02 -07:00
Sloane Hertel
ec1287ca7e
Fix notifying handlers by using an exact match (#55624)
* Fix notifying handlers by using an exact match rather than a string subset if listen is text rather than a list

* Enforce better type checking for listeners

* Share code for validating handler listeners

* Add test for handlers without names

* Add test for templating in handlers

* Add test for include_role

* Add a couple notes about 'listen' for handlers

* changelog

* Add a test for handlers without names

* Test templating in handlers

* changelog

* Add some tests for include_role

* Add a couple notes about 'listen' for handlers

* make more sense

* move local function into a class method
2019-06-27 17:29:20 -04:00
Hannes Ljungberg
1b90e10cf0 docker_swarm_service: Make secret_id and config_id optional (#58299)
* Lookup secret id by name if not set

* Lookup config id by name if not set

* Add changelog fragment

* Remove usage of secret/config_id in examples

* Python 2.6 compat

* Extend secrets and configs tests
2019-06-27 22:24:34 +02:00
Martin Krizek
5064e67d37 yum: take care of stale/invalid yum.pid (#58457)
* yum: take care of stale/invalid yum.pid

* Add changelog
2019-06-27 15:24:14 -04:00
Sam Doran
20ad120829 Omit -A and -G options in local mode since luseradd does not support these (#55401)
Add integration tests
2019-06-27 14:46:38 -04:00
Sam Doran
1bba30981c
Revert "Add podman container module to ansible" (#58422)
This reverts commit f01468a9d9.
2019-06-27 11:36:31 -04:00
Matt Clay
b06f5634c5 Simplify ansible-test target expansion.
Targets are always expanded to full lists now instead of optimizing
for shorter lists by collapsing directories.

This change only affects unit tests and the ansible-doc sanity test,
as they were the only remaining tests using the old behavior.
2019-06-27 08:27:48 -07:00
Zim Kalinowski
c9d82024c7 shared image gallery modules (#57386)
* modules to handle shared image gallery

* update test

* and firewall update

* fixed gallery problems

* fixed gallery version

* fix

* several fixes to the gallery

* several fixes

* fixes

* fix non-updatable

* fixed test & image

* fixed idempotency

* fix test

* image version test fixed

* fixes

* changed ux

* trigger

* fix syntax

* fixed sanity

* updated module + test delete

* fixed some sanity & delete

* continue fixing sanity

* sanity fix and pause after deleting image version

* extended delay

* removed sanity ignore

* try to ignore errors

* repeat until successful

* more retries

* updated test, etc.

* updated test

* updated shared image gallery docs
2019-06-26 17:15:55 -07:00
Will Thames
eda5dd826f Add rds_snapshot module (#39994)
* new module uses modern ansible AWS standards
* adds additional tests for snapshots
* Update return_skeleton_generator for python3 - should
  set type to `str`, not `string`.
2019-06-26 16:27:11 -07:00
Matt Clay
f109184753 Recognize module tracebacks on stdout and stderr.
Module tracebacks may be reported on stdout instead of stderr when
using some connection plugins. For example, the ssh connection plugin
will report tracebacks on stdout due to use of the -tt option.

This change results in tracebacks being recognized on both stdout
and stderr, instead of the previous behavior of just stderr.

ci_complete
2019-06-26 15:45:46 -07:00
Sam Doran
911a2ec6d3 Make nuage_vspk test more reliable
- don't background the nuage-vsd-sim
- increase the asncy timeout
- use uri to actually query the simulator API to make sure it is ready for connections
2019-06-26 14:32:23 -07:00
Matt Clay
cc7556fb7f Disable podman_container test. 2019-06-26 14:21:11 -07:00
Sam Doran
9ba7015458
podman_image_info - Do not fail when nonexistant image name is provided (#57962)
* Account for older versions of Podman lacking 'exists'
2019-06-26 17:04:26 -04:00
Rui Moreira
edcb5b6775 dms_replication_subnet_group (#56980
* dms_replication_subnet_group implementation
2019-06-26 10:04:27 -07:00
Abhijeet Kasurde
bc3c90f2f1 datadog_monitor: Fix docs with datatypes of params (#58371)
* datadog_monitor: Fix docs with datatypes of params

Fixes: #58342

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* indentation and other minor fixes
2019-06-26 11:21:41 -05:00
Matt Clay
4591a300ae Update sanity test ignore for hostname module. 2019-06-26 08:41:04 -07:00
Daniel Mellado Area
db689f7221 Fix ovsdb module not being idempotent (#57735)
openvswitch_db was not parsing properly some arguments, which caused
some commands to be executed when they shouldn't. This commit fixesit
and adds unit testing for the usecase.

Closes-Bug: #55432
Closes-bug: #43858
2019-06-26 10:48:46 -04:00
René Moser
f2cc447b4d
dnsimple: fix missing defaults and doc (#58116)
* dnsimple: fix missing defaults and doc

* fix sanity
2019-06-26 13:21:13 +02:00
Pilou
77e01e6abc tower_role: ensure alias of "validate_certs" parameter is handled (#57518)
* tower_role: ensure alias of validate_certs is handled

* tower modules: remove tower_verify_ssl alias too

Error was:

    Failed to update role: The Tower server claims it was sent a bad request.
    GET https://tower/api/v2/projects/22/object_roles/
    Params: [('tower_verify_ssl', False), ('role_field', 'admin_role')]
    Data: None
    Response: {"detail": "Role has no field named 'tower_verify_ssl'"}

Full traceback:

    File "/tmp/ansible_tower_role_payload_7_2p0X/__main__.py", line 145, in main
      result = role.grant(**params)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/resources/role.py", line 365, in grant
      return self.role_write(fail_on_found=fail_on_found, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/resources/role.py", line 242, in role_write
      fail_on_multiple_results=True, **data)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/models/base.py", line 301, in read
      r = client.get(url, params=params)
    File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 546, in get
      return self.request('GET', url, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/tower_cli/api.py", line 299, in request
      kwargs.get('data', None), r.content.decode('utf8'))
2019-06-26 10:04:49 +02:00
Matt Clay
5e4f457a47
Fix incorrect assumptions in integration tests. (#58372)
* Fix service integration test.

Set the proper file mode when copying before asserting the mode is correct.

* Fix certificate_complete_chain test.

Do not assume that testhost is the same as localhost.
2019-06-25 22:56:59 -07:00
Tim Rupp
46214c9ef4
Replaces #16690 (#58369)
Adding integration tests for testing the 'mode' arg of the apt_repository module
2019-06-25 20:23:38 -07:00
Matt Clay
d5542afd97 Properly enforce shebang on collections. 2019-06-25 19:21:05 -07:00
Matt Clay
013b0039ba
Fix incorrect assumptions in integration tests. (#58365)
* Fix nested template test.

There were two issues with the previous implementation:

1. The LOGNAME environment variable may not be set.
2. The comparison assumed that testhost is localhost.

* Fix variable display for cartesian lookup test.

* Fix vars list test.

The test assumed that the ansible_user variable is always set,
which is not guaranteed when using connections other than local.

* Fix supervisorctl integration test.

Use ansible_user_id instead of ansible_user since ansible_user
is not guaranteed to be available when the connection is not local.

* Fix file integration test.

Use ansible_user_id instead of ansible_user since ansible_user
is not guaranteed to be available when the connection is not local.

* Fix expect integration test.

Do not assume module_utils is available for utility scripts.

* Fix python_requirements_info integration test.

Check for pip instead of ansible, since ansible is not guaranteed
to be installed when using a connection other than local.

* Fix ansible-runner integration test.

Use implicit localhost to run the test since it requires access
to the ansible installation currently being tested.

* Fix tower_common integration test.

Accept errors on stdout or stderr.

* Fix tower_user integration test.

Recognize errors on stdout or stderr.
2019-06-25 18:39:41 -07:00
Sviatoslav Sydorenko
c604e347b2 Skip podman_container integration tests @ RHEL8b (#58363) 2019-06-25 17:39:30 -07:00
Sagi Shnaidman
f01468a9d9 Add podman container module to ansible
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2019-06-26 02:05:25 +02:00
ShachafGoldstein
65b0e1425b win_pagefile - Fix idempotency when same settings as current (#57893)
* win_pagefile - Fix idempotency when same settings as current

* Fix tests and code

* Fix problem with system managed

* Fix again systemmanaged detection

* Change check of systemmanged in creation

* Fix readability and wrong flag for test
2019-06-25 13:19:59 -07:00
René Moser
360a9f1a68
exoscale: exo_dns: fix sanity checks (#58312) 2019-06-25 21:20:41 +02:00
Matt Martz
e32d60bbcd
Add back _contains_vars method as maybe_template (#58290)
* Add back _contains_vars method as maybe_template. Fixes #58282

* Remove template guard in a few places

* maybe_template sounds like it might template something, rename to is_possibly_template

* Add tests for is_possibly_template
2019-06-25 10:54:37 -05:00
Sam Doran
18d713e6d5 Use Mapping rather than dict when evaluation 'options' (#58215) 2019-06-25 10:17:44 -05:00
Will Thames
a09aa205e1 Fix RDS test suite and minor bugs revealed (#57940)
* Update testing policy to be correct for RDS test suite
* Create read replica in same region to avoid more permissions being
  required
* Ensure modifying DB doesn't try to downgrade engine version
* Add tags to main test suite to limit number of tests run for problem
  solving
2019-06-25 09:54:03 -04:00
Tim Rupp
48af9bdfec Adds tls_version argument to mqtt module (#58264)
Fixes: #22034

This patch adds support for a tls_version parameter that allows the
TLS version used to be configurable. By default the module will let
the underlying system libraries pick the maximum supported version.

This parameter is useful for servers that are unable to support
newer versions of TLS
2019-06-25 15:27:32 +02:00
Wojciech Wypior
ac101f7f33 adds initial_hotfix parameter to vcmp guest (#58180) 2019-06-25 15:26:09 +02:00
Rowin Andruscavage
896b84bfbe VMware: Python3 migrations for vmware_inventory.py (#47538)
* Sort and pretty print json output and cache file
* Enable Python3 test for vmware_inventory.py

Fixes: #46727

Signed-off-by: Rowin Andruscavage <8740187+MTN-RowinAndruscavage@users.noreply.github.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-25 15:40:13 +05:30
Mariusz Mazur
06292566ec kubevirt: more unit tests (#57739)
* Add tests for KubeAPIVersion

* Legibility improvements for KubevirtVM tests

* Create units.utils.kubevirt with common stuff

* Add some VMIRS unit tests
2019-06-25 20:06:13 +10:00
Matt Clay
f749ef5c0a Remove existing invalid ignores. 2019-06-24 13:13:32 -07:00
Matt Clay
535e646a66 Add test for invalid ignore entries. 2019-06-24 13:13:32 -07:00
lolcube
547a29805e openssh_keypair: bugfix make regenerating keypairs via force possible… (#57801)
* openssh_keypair: bugfix make regenerating keypairs via force possible / add invalid file handling

* openssh_keypair: change permissions of read-only file instead of deleting it for regeneration; add changelog fragment

* address review feedbak, refactor

* add integration tests for bigfixes

* linter: fix indent

* fixup integration tests: use force when regenerating an invalid file

* linter: fix indent

* openssh_keypair: address review feedback

* openssh_keypair: fixup, remove backtick

* openssh_keypair: address review feedback

* Only pass 'y' into stdin of ssh-keygen when file exists.
2019-06-24 21:45:49 +02:00
Felix Fontein
b78d23d4ad Use newer test container. 2019-06-24 12:32:57 -07:00
Abhijeet Kasurde
2e1392eff8 ipaddr: unit tests for empty string (#58274)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-06-24 18:47:46 +02:00
Andrey Klychkov
278c59b17e postgresql_privs: bugfix of 27327 - incorrect views handling (#58272) 2019-06-24 18:08:12 +05:30
rajaspachipulusu17
fc1798cc14 Pluribus Networks ipv6security raguard module with UT (#57031)
* Pluribus Networks ipv6security raguard module with UT
* Doc fixes
2019-06-24 16:29:41 +05:30
pratikgadiya12
44058e9425 Allow multiple databases(not all) to be dumped from mysql (#56721)
* Allow multiple databases(not all) to be dumped from mysql

Fixes: #56059

* Altered fail message to provide atleast one database name

* Minor grammatical fix
2019-06-24 09:29:18 +02:00
Felix Fontein
75ca8eb42f
openssl_certificate: fix failing SAN comparisons (#58256)
* Fix failing SAN comparison for older cryptography versions due to not implemented __hashh__ functions.

* Fix SAN comparison: IPv6 addresses need to be normalized before comparing strings.

* Add changelog.

* Fix comment.
2019-06-24 06:34:12 +02:00
Felix Fontein
66a4000058
Adjust tests to new error messages for older docker-py versions. (#58253) 2019-06-23 21:52:24 +02:00
Felix Fontein
808cf4aa26
Remove from sanity ignores. (#57911) 2019-06-23 14:20:26 +02:00
Felix Fontein
4a12be31fb docker_* modules: improve error message when docker-py is missing (#57914)
* Improve error for docker modules when docker-py can't be imported.

* Add changelog.

* Mention platform and Python interpreter in more cases.

* Clarify wording.

* Adjust tests.
2019-06-23 06:27:33 -04:00
Wojciech Wypior
30ada17d4f Adds message routing transport module (#58201) 2019-06-21 12:58:02 -07:00
Wojciech Wypior
b8fd2f4df3 adds generic routing peer module (#58189) 2019-06-21 12:56:25 -07:00
Wojciech Wypior
429bf5340e adds module for message routing protocol (#58188) 2019-06-21 12:56:03 -07:00
Wojciech Wypior
0a3a94a493 adds new module to manage firewall schedules (#58187) 2019-06-21 12:55:50 -07:00
Wojciech Wypior
92a1e6845c Adds two modules to manage AFM log profiles (#58186) 2019-06-21 12:55:37 -07:00
Gonéri Le Bouder
db81b1d0f5 prepapre_vmware_tests: add a common vars file
Add a new file to record the variables that are shared with the two
scenarios (real_lab and vcsim).

The goal is to reduce the the amount of boilerplate configuration from
a user perspective.
2019-06-21 14:35:44 -04:00
Toshio Kuratomi
eb7e4591ae Fix ios test for python2 non-ascii paths 2019-06-21 11:32:28 -07:00
Paul Belanger
d010510835
Remove more usage of pause with junos tests (#58153)
This removes more potential race conditions with junos testing.

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-06-21 14:07:25 -04:00
Wojciech Wypior
fbca93b8ad removes args from the code and corrects few missed tests (#58175) 2019-06-21 09:09:39 -07:00
Wojciech Wypior
56b3b1ac56 adds message routing router module (#58191) 2019-06-21 09:09:14 -07:00
Wojciech Wypior
c1f2df4753 adds message routing route module (#58190) 2019-06-21 09:08:56 -07:00
Sam Doran
7b9d991f78
Add Fedora 30 to test matrix (#57713)
Remove Fedora 28 from test matrix
2019-06-21 10:55:58 -04:00
Wojciech Wypior
95e59e7ee7 adds description to bigip snatpool (#58179) 2019-06-21 07:52:46 -07:00
Wojciech Wypior
3531bf3148 fixes issue with ssl protocols ordering (#58177) 2019-06-21 06:46:53 -07:00
Wojciech Wypior
becca36c5e Added new module for remote user management (#58171) 2019-06-21 06:45:29 -07:00
Kevin Breit
0f12e1c7d8 Meraki - Improve type information in module documentation (#58114)
* Improve type information in module documentation
- Removed some duplicate documentation
- Ensure org_id is always string
- Add type information for items which don't have it

* Fix whitespace
2019-06-21 09:25:03 -04:00
Sam Doran
dc8f7b38e6
Check that provider['options'] is a dictionary in validate-modules (#58078) 2019-06-21 08:39:12 -04:00
Sumit Jaiswal
58d446e61a
PR to fix where ansible_net_model was not being populated (#58159)
* fix bug 57285

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* minor fix

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* adding TC fix related

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* fix shippable error

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
2019-06-21 16:18:59 +05:30
markafarrell
43872d6b88 Fix netconf guess_network_os to use ssh_config if supplied. (#55199)
* feature: use network_os=auto to trigger network os guessing

* doc: add debug messages

* fix linting

* fix test_netconf_init default network_os is auto

* add documentation

* fix rst errors

* use init lexer

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

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

Co-Authored-By: Sandra McCann <samccann@redhat.com>

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

Co-Authored-By: Sandra McCann <samccann@redhat.com>

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

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Update docs/docsite/rst/network/user_guide/platform_netconf_enabled.rst

Co-Authored-By: Sandra McCann <samccann@redhat.com>
2019-06-21 09:04:13 +05:30
Kohei Asano
ddf6d096c5 Support the new TLS termination on NLBs (#51327) (#58031) 2019-06-20 17:03:04 -07:00
Sam Doran
b9d77b997e
passwordstore lookup - replace expired GPG key (#58141)
- Replace private key that expired an 2019-06-20 with a key that does not expire
- Document how to generate a new GPG key using an input file
2019-06-20 18:03:22 -04:00
Dmitriy Yakovlev
122d4164c5 docker_swarm_service: Added default value for mounts.source (#58039)
* Added default value for mounts.source

* Added the changelog fragment

* Added tests

* Fixed separators

* Moved the teardown section at the end
2019-06-20 15:58:32 -04:00
Sumit Jaiswal
77b6255305 PR to fix ios bgp TC failure (#58010)
* fix ios bgp tc failure

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* skip test with 15.6(T)2 ios

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>

* skip test with 15.6(T)2 ios

Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
2019-06-20 17:09:31 +02:00
smile37773
3a3465c47d Add the way to create a VM with the image id (#58106) 2019-06-20 16:42:09 +08:00
Sam Doran
18feeb51a8
Change integration tests in order to pass on Fedora 30 (#58081)
* Use different package for DNF tests
    Ninja caused errors in Fedora 30. This works in both Fedora 29 and 30.

* Fix git integration tests
    Git >= 2.21.0 has either a bug or change in behavior where it errors when fetching a
    repository containing submodules that are behind the upstream submodule commits.
    It's weird and I don't fully understand it.

    Get around this my checking out specific commits from a repository rather than
    switch the origin URL.

* Fix PostgreSQL tests
    The error message is slightly different
2019-06-19 12:38:05 -04:00
Chris Van Heuveln
52c811c841 nxos_bgp_neighbor: Add bfd support (#56932)
* nxos_bgp_neighbor: Add bfd support

- Add support for bfd state in nxos_bgp_neighbor

- Feature Pull Request

- nxos_bgp_neighbor

- Tested on platforms: `N3K,N6K,N7K,N9K`

* bfd T/F now bfd enable/disable

* pep fix ws
2019-06-19 21:23:00 +05:30
Chris Van Heuveln
727a6b405a nxos_ospf_vrf: Add 'bfd' support (#57425)
* nxos_ospf_vrf: Add 'bfd' support

* Add default to bfd doc hdr

* bfd T/F now bfd enable/disable
2019-06-19 21:22:32 +05:30
Chris Van Heuveln
30830a4482 nxos_pim: Add bfd support (#56908)
* nxos_pim: Add bfd support

* Add integration sanity

* minor cleanup

* bfd T/F now bfd enable/disable
2019-06-19 21:22:03 +05:30
Kevin Breit
8f68c8d438 meraki_snmp - Enable check mode (#54625)
* Add support for check mode

* Add diff support

* Remove check mode for idempotent action
2019-06-19 11:35:10 -04:00