Commit graph

4206 commits

Author SHA1 Message Date
Matt Clay
c007422d05 Fix OpenSSL tests on FreeBSD with Python 3.x. 2019-03-28 01:50:29 -07:00
Yunge Zhu
9e42038747
add new module: azure_rm_rediscachefirewallrule (#53161) 2019-03-28 14:27:30 +08:00
James Cassell
bc4ef99533 standardize TLS connection properties (#54315)
* openstack: standardize tls params

* tower: tower_verify_ssl->validate_certs

* docker: use standard tls config params

- cacert_path -> ca_cert
- cert_path -> client_cert
- key_path -> client_key
- tls_verify -> validate_certs

* k8s: standardize tls connection params

- verify_ssl -> validate_certs
- ssl_ca_cert -> ca_cert
- cert_file -> client_cert
- key_file -> client_key

* ingate: verify_ssl -> validate_certs

* manageiq: standardize tls params

- verify_ssl -> validate_certs
- ca_bundle_path -> ca_cert

* mysql: standardize tls params

- ssl_ca -> ca_cert
- ssl_cert -> client_cert
- ssl_key -> client_key

* nios: ssl_verify -> validate_certs

* postgresql: ssl_rootcert -> ca_cert

* rabbitmq: standardize tls params

- cacert -> ca_cert
- cert -> client_cert
- key -> client_key

* rackspace: verify_ssl -> validate_certs

* vca: verify_certs -> validate_certs

* kubevirt_cdi_upload: upload_host_verify_ssl -> upload_host_validate_certs

* lxd: standardize tls params

- key_file -> client_key
- cert_file -> client_cert

* get_certificate: ca_certs -> ca_cert

* get_certificate.py: clarify one or more certs in a file

Co-Authored-By: jamescassell <code@james.cassell.me>

* zabbix: tls_issuer -> ca_cert

* bigip_device_auth_ldap: standardize tls params

- ssl_check_peer -> validate_certs
- ssl_client_cert -> client_cert
- ssl_client_key -> client_key
- ssl_ca_cert -> ca_cert

* vdirect: vdirect_validate_certs -> validate_certs

* mqtt: standardize tls params

- ca_certs -> ca_cert
- certfile -> client_cert
- keyfile -> client_key

* pulp_repo: standardize tls params

remove `importer_ssl` prefix

* rhn_register: sslcacert -> ca_cert

* yum_repository: standardize tls params

The fix for yum_repository is not straightforward since this module is
only a thin wrapper for the underlying commands and config.  In this
case, we add the new values as aliases, keeping the old as primary,
only due to the internal structure of the module.

Aliases added:
- sslcacert -> ca_cert
- sslclientcert -> client_cert
- sslclientkey -> client_key
- sslverify -> validate_certs

* gitlab_hook: enable_ssl_verification -> hook_validate_certs

* Adjust arguments for docker_swarm inventory plugin.

* foreman callback: standardize tls params

- ssl_cert -> client_cert
- ssl_key -> client_key

* grafana_annotations: validate_grafana_certs -> validate_certs

* nrdp callback: validate_nrdp_certs -> validate_certs

* kubectl connection: standardize tls params

- kubectl_cert_file -> client_cert
- kubectl_key_file -> client_key
- kubectl_ssl_ca_cert -> ca_cert
- kubectl_verify_ssl -> validate_certs

* oc connection: standardize tls params

- oc_cert_file -> client_cert
- oc_key_file -> client_key
- oc_ssl_ca_cert -> ca_cert
- oc_verify_ssl -> validate_certs

* psrp connection: cert_trust_path -> ca_cert

TODO: cert_validation -> validate_certs (multi-valued vs bool)

* k8s inventory: standardize tls params

- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs

* openshift inventory: standardize tls params

- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs

* tower inventory: verify_ssl -> validate_certs

* hashi_vault lookup: cacert -> ca_cert

* k8s lookup: standardize tls params

- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs

* laps_passord lookup: cacert_file -> ca_cert

* changelog for TLS parameter standardization
2019-03-28 00:19:28 -05:00
Blue
b62ab97685 win_shell: Implement option 'profile', allowing the user to control p… (#54299)
* win_shell: Implement option 'profile', allowing the user to control powershell profile sourcing before running a command

* Set version_added to 2.8

* Make sure profile directory exists before writing profile file

* Changes to make tests immutable and align with ps args
2019-03-28 11:28:28 +10:00
Dag Wieers
e152b277cf Use locking for concurrent file access (#52567)
* Use locking for concurrent file access

This implements locking to be used for modules that are used for
concurrent file access, like lineinfile or known_hosts.

* Reinstate lock_timeout

This commit includes:
- New file locking infrastructure for modules
- Enable timeout tests
- Madifications to support concurrency with lineinfile

* Rebase, update changelog and tests

We need to specify ansible_python_interpreter to avoid running interpreter discovery and selecting the incorrect interpreter.

Remove the import of lock in known_hosts since it is not used.
2019-03-27 20:20:18 -04:00
Yuwei Zhou
dc6c0cb9f8 Add workspace module for azure (#53731)
* add workspace

* add other properties

* add facts modules

* add test

* add doc

* fix lint

* fix lint

* rename the module

* fix docs
2019-03-27 17:04:40 -07:00
Matt Clay
09cd355bec Pin rabbitmq tests to pika < 1.0.0 to fix tests.
Tests are failing with the release of pika 1.0.0.
2019-03-27 15:30:07 -07:00
Matt Clay
6e12517164
Make pip test work with versioned virtualenv. (#54483) 2019-03-27 13:56:28 -07:00
Jordan Borean
9e93a84429
win_optional_feature - support multiple feature in name (#54368) 2019-03-28 05:26:20 +10:00
Matt Clay
7dea316c81
Fix service integration test python selection. (#54449)
* Fix service integration test python selection.
* Clean up source in ansible_test_service.
* Rename script to include in python tests.
* Make shebang templating sanity friendly.
* Fix checksum.
* Use realpath of python to avoid selinux issues.
2019-03-27 11:36:07 -07:00
Matt Clay
55d9ee0cb2 Revert "Temporarily skip failing Docker tests on RHEL 7.6."
This reverts commit affde96fa8.
2019-03-27 10:02:49 -07:00
Matt Clay
8612b126a8 Fix tests which assume virtualenv is available. 2019-03-27 09:23:17 -07:00
Kevin Breit
17fc6c6ff1 meraki_network - Parameter change for combined network type (#49160)
* Added support for types parameter
- Parameter is used to specify multiple network types

* Fix documentation

* Apply suggestions from code review

Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>

* Reworked type parameter to be a list so types isn't needed

* Re-add tags documentation

* Fix documentation around compatibility

* Convert tags to list from string

* Add changelog fragment
2019-03-27 16:10:15 +01:00
Sebastiaan Mannem
d90cb71210 Added a new module that can manage rules in pg_hba files. (#32666)
* Added a new module that can manage rules in pg_hba files.

* Adding a backup_file option
2019-03-27 15:54:20 +01:00
Anil Kumar Muraleedharan
8d742d9bff Lenovo cnos user module (#53763)
* Adding cnos_user module to Ansible

* Update cnos_user.py

* Adding Functional test cases and unit test cases.

* Fixing Bug found in testing with Lenovo Mars.

* Review comments incorporated

* Review comments implemented.

* Copy paste mistake
2019-03-27 19:22:05 +05:30
Lukas Kämmerling
3614f78bc5 Add hcloud_server_type_facts module (#53852) 2019-03-27 11:52:31 +01:00
Lukas Kämmerling
87554da4d6 Add hcloud_datacenter_facts module (#53851) 2019-03-27 11:52:04 +01:00
Lukas Kämmerling
d5ca1eed89 Add hcloud_server_facts module (#53850) 2019-03-27 11:51:36 +01:00
Lukas Kämmerling
7d0ae41901 Add hcloud_image_facts module (#53849) 2019-03-27 11:20:21 +01:00
Lukas Kämmerling
6220eafb73 Add hcloud_location_facts module (#53848) 2019-03-27 10:53:54 +01:00
Patryk D. Cichy
cdb1d02f4c Add new CloudStack module cs_physical_network (#54098) 2019-03-27 10:48:44 +01:00
Matt Clay
6b4aabd355 Use virtualenv for filters and lookups tests. 2019-03-27 00:23:49 -07:00
Matt Clay
affde96fa8 Temporarily skip failing Docker tests on RHEL 7.6. 2019-03-26 20:59:38 -07:00
Brian Coca
bc95720780
renaming facts to info (#54432)
(cherry picked from commit c5edffcdb8)
2019-03-26 20:30:16 -04:00
Jordan Borean
10f006036c
win_acl - fix support for registry paths (#54427) 2019-03-27 09:52:39 +10:00
Sloane Hertel
cbfe77ad63
[inventory_aws_conformance] use consistent sg order in script (#54423)
* [inventory_aws_conformance] Use consistent security group order for the script
2019-03-26 17:11:37 -05:00
James Cassell
51f2065df5 use ANSIBLE_ prefix on all ansible-defined env vars (#54272)
mark old version deprecated in all places referenced via docs
2019-03-26 17:43:48 -04:00
James Cassell
5d32dbd532 selogin: check_mode, ignore_selinux_state, tests
ignore_selinux_state based on #48945
2019-03-26 17:18:36 -04:00
Christopher Schmitt
fe0765eb2b Add hcloud_volume module (#53745) 2019-03-26 19:24:10 +01:00
David Passante
baa3327387 cs_volume: fix unit tests cleanup (#54397) 2019-03-26 19:18:09 +01:00
Matt Clay
07e9438848 Move interface management into delegate_to test. 2019-03-26 11:15:41 -07:00
Anton Roman
1e3428a766 fix issue in random_mac filter with short prefixes (#53928) 2019-03-26 13:49:23 -04:00
Sloane Hertel
a47edc9968
[inventory_aws_conformance] fix the order of list variables created in config since it otherwise varies (#54365)
modify mock for boto to reflect the new fixed order for the config
2019-03-26 11:18:05 -05:00
Matt Martz
6996926d89
Expose loop_control.loop_var as ansible_loop_var (#54240)
* Expose the loop_var as ansible_loop_var

* Add docs

* fix assert test

* Indicate version added
2019-03-26 11:07:54 -05:00
Evan Kaufman
cf69ec5db0 replace - fixed combined before and after usage (#31452)
When using before and after in combination, the opposite behavior was induced. This PR makes the the replacement happen between the specified patterns as intended.

* Added integration tests
* Add changelog, porting guide entry, and minor doc fixes
2019-03-26 11:49:58 -04:00
Felix Fontein
5bb5c9d295 openssl_certificate: update for #54298 (state=absent fix) (#54353)
* Update for #54298: Certificate is abstract, so instantiating doesn't work.

* Add test for removal.
2019-03-26 15:09:54 +00:00
Andrea Tartaglia
df86b9ec3d openssl_pkcs12: privatekey_path and friendly_name are not always required together (#54370)
* Removed required_together, updated tests

Since required_together: privatekey_path -> friendly_name, is not always
required it has been removed.
Updated openssl_pkcs12 integration tests to be in line with other
openssl_* modules, and added a test for export with no privatekey_path.

* linter fixes

* Removed cryptography from tests

* Added changelog fragment

* Removed non-necessary select_crypto_backend
2019-03-26 15:06:00 +00:00
Hannes Ljungberg
be293fbe50 docker_swarm_service: Remove configs and secrets defaults (#54361)
* Remove defaults

* Skip redundant casting

* Indentation fix

* Use generic compare functions

* Add tests for compare functions

* Remove extra whitespace

* Add changelog fragment
2019-03-26 09:45:40 -04:00
Felix Fontein
791176252b docker_swarm inventory: fix tests, and make sure that they fail if no host is found (#54380)
* Fix tests, and make sure that they fail if no host is found.

* Fix interpreter.
2019-03-26 09:44:42 -04:00
Andrey Klychkov
9fa1f78126 postgresql_facts -> postgresql_info (#54389)
* postgresql_facts -> postgresql_info

* postgresql_facts -> postgresql_info: fix comment
2019-03-26 12:11:47 +00:00
Jordan Borean
3044326b4d
win basic - do not warn on case insensitive matches (#54371) 2019-03-26 10:54:33 +10:00
Matt Clay
a775af919e
Merge pull request #54367 from mattclay/fix-ping-test
Fix ping integration test to work with ssh.
2019-03-25 16:27:56 -07:00
Matt Clay
29de0619e8 Fix nuage_vspk integration test:
- Wait for API to be ready.
- Enumerate test cases on controller.
2019-03-25 16:27:38 -07:00
Matt Clay
8a2b99d1ee Fix rabbitmq_publish integration test. 2019-03-25 15:43:20 -07:00
Felix Fontein
4fac91bed5 docker_container: add networks_cli_compatible option (#54198)
* Adding networks_cli_compatible option.

* Move network tests into own test file.

* Extend tests (for networks_cli_compatible=no).

* Adding tests for networks_cli_compatible=yes.

* There seems to be no way to create a container without at least one network attached.

* Integrate networks / purge_networks with comparisons.

* Speed up tests.

* Removing double dot.

* Add changelog.

* Use comparisons value only if the networks option has been specified. purge_networks on the other hand also removes networks if it has not been specified.
2019-03-25 15:06:21 -04:00
tcraxs
af669dec24 add missing integration tests for postgresql_schema module (#54185)
* add missing integration tests for postgresql_schema module

* add missing integration tests for postgresql_schema module

* postgresql_schema: add CI test with function in module from #54237

* postgresql_schema: add CI test with function in module from #54237

* add DROP SCHEMA test with check_mode=yes #54185
2019-03-25 17:10:47 +00:00
jctanner
6d978bc285 check aws inv plugin (#53435)
* Add the constructed config with legacy settings enabled to match the script

* Add interesting characters in tags and security group names

* add strict to config

* Add a stopped instance in inventory

* Create symlinks in the test

* Add reservation details to mock

* run script and plugin with a virtual env

* call the script with ansible-inventory

* Fix code coverage collection.
2019-03-25 11:15:31 -05:00
Mike Wiebe
e9c66ffb6f Add nxos_config sanity test (#54258) 2019-03-25 21:35:47 +05:30
Zim Kalinowski
8768c05d3e more 2.8 facts modules renamed to info (#54313) 2019-03-25 11:28:13 -04:00
Felix Fontein
d7a273273a openssl_*: proper mode support (#54085)
* Add write helper.

* Adjust modules (except openssl_certificate).

* Adding tests for mode (with openssl_privatekey).

* Add openssl_certificate support.

* Never, ever remove the output file before actually trying to generate new content for it.

Removal is only allowed when state=absent, or when the object has been regenerated and the result needs to be written to that place.

* Add changelog.

* Extend test.
2019-03-25 14:20:52 +01:00
Felix Fontein
5d460ae865 Fix broken backup. (#54290) 2019-03-25 14:19:25 +01:00
Zim Kalinowski
19e1b4de58
special case for rest module (#54236) 2019-03-25 11:55:43 +08:00
Kevin Breit
bcbcd209f4 meraki_admin - Add documentation for tags and network access (#51415)
* Add documentation for tags and network access
* Documentation changes from dag and sam
* Change examples to include proper YAML and not dict
* Update lib/ansible/modules/network/meraki/meraki_admin.py

Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
2019-03-23 08:29:08 -05:00
Martin Krizek
bafa291af9 uri: do not write the file after failure (#53515)
* uri: do not write the file after failure

Fixes #53491

* Add changelog
2019-03-22 09:32:43 -05:00
Andrea Tartaglia
36a790dcde New cryptography backend for openssl_certificate (#53924)
* New cryptography backend for openssl_certificate

load_* functions in module_utils/crypto.py now have a backend paramter
which when set to 'cryptography' will return cryptography objects so
they can be used for both pyopenssl and cryptography backends.
Added a select_message_digest function too returning a cryptography
digest hash from `cryptography.hazmat.primitives.hashes`
Added new classes for Cryptography backend

* Run test with various backends.

* Prefixing tests.

* Make sure we have the correct backend available.

* Linting (flake8).

* Moved cryptography import to separate try/except

* Make sure certificate is actually valid at some time in the past.

* Improve error handling.

* Trying to fix validation for cryptography backend.

* Fixed issue with keyUsage test in assertonly

* Fixed CI/Lint issues

* Fix private key problem for OwnCA.

* Cryptography backend doesn't support v2 certs.

* issue an expired cert with command when using cryptography backend

* Added warning when backend is auto and v2 cert is requested

* Bumped min cryptography version to  1.6

* Correctly check for failure when backend is cryptography and cert is v2

* Use self.backend where possible

* Use secp521r1 EC when testing on CentOS6

* Fixed pylint issue

* AcmeCertificate support for both backends

* Review fixes

* Fixed missing '(' when raising error

* Fixed date_fmt loop

* Updated docs and requirements with cryptography

* Add openssl_certificate to changelog.
2019-03-22 13:21:23 +00:00
Christian Rohmann
90c092a104 Allow configuration of connection_limit per postgresql database (postgresql_db) (#40345)
Fixes #40060

* Fix coding style errors
* Use CONNECTION LIMIT (no underscore)
* From review done by amenonsen and bcoca - Set default at None, make the change detection less confusing
* Added EXAMPLE on how to apply a database specific connection limit
* Added some basic tests for conn_limit applied to a database
* Check that conn_limit has actually been set / updated to 200
* Add changelog fragment regarding postgresql_db conn_limit parameter
2019-03-22 18:21:39 +05:30
Andrey Klychkov
76f1f96163 postgresql_ext: Update param handling, fix doc formatting, added: CI tests, examples, a return value (#54027)
* postgresql_ext: instead_of_3196, initial

* postgresql_ext: fixes

* postgresql_ext: fixes
2019-03-22 12:39:33 +00:00
Zim Kalinowski
18d9715fb1 Fix CosmosDB parameter translation bug (#54212) 2019-03-22 15:21:53 +08:00
Felix Fontein
946a16cc82 docker_host_info and docker_node: fix return variable names (#54172)
* docker_host_info: host_facts -> host_info

* docker_node: node_facts -> node
2019-03-22 02:28:57 -04:00
Yuwei Zhou
d73db7f060 azure subnet's properties should not be changed if parameter set to None (route table, nsg...) (#54019) 2019-03-22 14:27:12 +08:00
David Passante
aa32164d15 cs_volume: add volumes extraction and upload features (#54111)
* cs_volume: add volumes extraction and upload features

* cs_volume: Update doc, remove deprecated code

* cs_volume: Add unit tests for extract and upload features
2019-03-22 07:09:26 +01:00
Matt Clay
e69828e285
Force tests to set ansible_python_interpreter. (#54191)
* Force tests to set ansible_python_interpreter.

This avoids use of interpreter discovery unless tests opt-in to using it.
Avoiding interpreter discovery helps avoid selecting the wrong interpreter for tests.

* Prevent use of global inventory in tests.

This will avoid issues with tests picking up global inventory
instead of using implicit localhost as intended.

* Require hosts to exist in inventory for tests.

This will prevent tests from unintentionally passing
when hosts are not found in inventory. Does not prevent
the use of implicit localhost.
2019-03-21 21:54:41 -07:00
Matt Clay
8aa4b037ce Fix include_import test.
This will allow the test to work when HOST_PATTERN_MISMATCH is set to error.
2019-03-21 20:08:27 -07:00
Matt Clay
2d15811843 Fix unicode integration test.
This will allow the test to work when HOST_PATTERN_MISMATCH is set to error.
2019-03-21 19:05:16 -07:00
Matt Clay
1bed2cbb9d Fix vault integration test inventory references.
Previously parts of the tests were being skipped due to missing inventory.
2019-03-21 18:36:15 -07:00
Matt Clay
363c9594ec
Clean up group_by integration test. (#54206)
* Split group creation out into separate file.
* Move skipped group into separate playbook.
2019-03-21 17:31:04 -07:00
Matt Clay
43bd8c4711 Switch async_extra_data test to inventory file. 2019-03-21 16:19:40 -07:00
Sam Doran
ff88bd82b5
Move type checking methods out of basic.py and add unit tests (#53687)
* Move check_type_str() out of basic.py

* Move check_type_list() out of basic.py

* Move safe_eval() out of basic.py

* Move check_type_dict() out of basic.py

* Move json importing code to common location

* Move check_type_bool() out of basic.py

* Move _check_type_int() out of basic.py

* Move _check_type_float() out of basic.py

* Move _check_type_path() out of basic.py

* Move _check_type_raw() out of basic.py

* Move _check_type_bytes() out of basic.py

* Move _check_type_bits() out of basic.py

* Create text.formatters.py

Move human_to_bytes, bytes_to_human, and _lenient_lowercase out of basic.py into text.formatters.py
Change references in modules to point to function at new location

* Move _check_type_jsonarg() out of basic.py

* Rename json related functions and put them in common.text.converters

Move formatters.py to common.text.formatters.py and update references in modules.

* Rework check_type_str()

Add allow_conversion option to make the function more self-contained.
Move the messaging back to basic.py since those error messages are more relevant to using this function in the context of AnsibleModule and not when using the function in isolation.

* Add unit tests for type checking functions

* Change _lenient_lowercase to lenient_lowercase per feedback
2019-03-21 09:40:19 -04:00
tcraxs
bb61d7527f #50877: add support to postgresql_privs to use "FOR { ROLE | USER } target_role" in "ALTER DEFAULT PRIVILEGES" (#51073)
* #50877:
* add support to postgresql_privs to use "FOR { ROLE | USER } target_role"
   in "ALTER DEFAULT PRIVILEGES"

* fix sanity errors

* #50877: fix documentation and add a check for correct usage
of target_roles

*  #50877: fix missing absent option for default privs with target_role

* #50877: add clear description, when target_roles can be used

* #50877: fix conflicts, formatting, and add a changelog fragment

* #50877: fix sanity error E335

* #50877: swap conditions and fix error to warning msg

*  #50877: add tests for default privileges

* #50877: fix tests for default privileges

* #50877: fix tests for default privileges on centos 6
2019-03-21 13:26:44 +00:00
Chris Van Heuveln
7b44bc1ac9 nxos_static_route: reconcile_candidate fails to remove 'track' routes (#53806)
* * `reconcile_candidate()`
  * old code searched the ip route configs for a given prefix+nexthop and then tried to remove the route based on prefix+nexthop only; this would fail when a static route was configured with `track` values.
  * new code still looks for prefix+nexthop but uses the route config it finds on the device to remove it; e.g.
    * search for: `ip route 192.168.20.64/24 192.0.2.3`
    * find:       `ip route 192.168.20.64/24 192.0.2.3 track 1 10`
    * remove:  `no ip route 192.168.20.64/24 192.0.2.3 track 1 10`

* logic cleanups:
  * old code did a `show run` for every prefix. This can be a lot of data when there are large configs.
  * new code uses filters to only return the static route configs.
  * The filters now allow a common code path so no need for default vs vrf code paths

* `sanity` test: 100% Pass rate on N9K,N7K,N6K,N3K

- Bugfix Pull Request

`nxos_static_route`

* filter() does not return a list with python3

`filter()` was breaking pytest when it ran with python3, since it returns
an iterable instead of a list with python3.

Found that I didn't really need `filter()` anyway so just removed it

* restore var names /w/want/
2019-03-21 18:52:46 +05:30
Zim Kalinowski
0a2971dcf5
adding new container instance options (#54072) 2019-03-21 17:01:12 +08:00
Felix Fontein
8d62794f91 docker: rename docker_*_facts -> docker_*_info (#54124)
* Rename docker_*_facts -> docker_*_info.

* Add changelog.

* Update scenario guide.
2019-03-21 08:37:18 +00:00
Zim Kalinowski
9c77509cbc
azure virtual machine facts -- querying all machines in subscription fix (#54075) 2019-03-21 15:53:44 +08:00
techknowlogick
a03e69550c add azure_rm_mariadbdatabase (#54147) 2019-03-21 15:22:18 +08:00
Matt Clay
1a286a95e5 Disable failing azure_rm_managed_disk test. 2019-03-20 23:55:40 -07:00
Matt Clay
6401683e0b Mark azure_rm_hdinsightcluster test unstable.
The unstable alias wasn't intended for slow but otherwise stable
tests. However, the alternatives are to either dedicate an entire
test group to this one test or mark it unsupported.

Marking it unstable at least permits the test to run when changes
are made to the integration test or the module itself, which is
better than not running the tests at all.
2019-03-20 23:06:05 -07:00
Yunge Zhu
fb5f85d2c1
add azure_rm_roleassginment_facts (#52626) 2019-03-21 12:48:55 +08:00
techknowlogick
f34a43f2c7 add azure_rm_mariadbfirewallrule (#54146) 2019-03-21 12:25:01 +08:00
techknowlogick
ddee29d00f add azure_rm_mariadbconfiguration (#54145) 2019-03-21 11:22:18 +08:00
techknowlogick
949692431b add azure_rm_mariadbserver module (#53998) 2019-03-21 10:04:40 +08:00
Zim Kalinowski
c431d18e28 Additional DevTest Lab modules (#53091)
* [WIP] Additional DevTest Lab modules

* updates

* try global schedule again

* dtl schedule

* try full dtl schedule test

* fixing schedule

* fixed problem

* another fix

* fixed test

* different time format

* fixed absent state

* test policy idempotence

* more updates

* updated devtestlabpolicy

* fixed syntax

* updated dtl policy test

* updated image id

* fixed test

* fixed bug

* fixed bugs and docs

* fixed bug

* + small cleanup

* reenabled tests but disabled leaking tests

* disabled test
2019-03-20 16:07:30 -07:00
Zim Kalinowski
d71ca02d60 adding hdinsight cluster (#52612)
* adding hdinsight cluster again

* updated hdinsight cluster test

* fixes

* updated test

* some updates

* removed non-essential

* fixed sanity

* fixed test

* newer default_compare implementation

* debugging code

* try to fix comparison issue

* fix test

* fixed sanity

* fix comparison

* added zookeeper node

* zookeeper target instance count

* don't compare passwords

* test updates

* next iteration

* fix

* more fixes

* another fix

* one more fix

* flattening configuration

* doc update

* one more doc change

* fixed sanity

* properly handling cluster update

* changed default_compare function

* fixed comparison

* changed compare result

* compare stuff

* removed some custom stuff

* improved hdinsight change warning

* fixed syntax

* fix another syntax

* one more hdinsight cluster update fix

* and removed some unnecessary stuff

* one more update

* forgot one lropoller

* reduce number of cores

* head node size

* still bigger nodes

* fix mistake

* fix problem

* fixed another issue

* don't delete unexisting
2019-03-20 15:50:57 -07:00
Matt Clay
777b726e4f Pin the ansible-runner version in tests.
The tests need to be updated to support newer ansible-runner releases.
2019-03-20 14:59:55 -07:00
René Moser
c5609c51bf
include_tasks: fix traceback if no file specified (#54044) 2019-03-20 19:17:20 +01:00
Martin Krizek
0e28ab4528
Template run_once for handlers (#54030)
Fixes #27237
2019-03-20 14:46:19 +01:00
Felix Fontein
05bca95ab1 ACME: rename acme_account_facts -> acme_account_info (#54082)
* Rename acme_account_facts -> acme_account_info.

* Add changelog fragment.
2019-03-20 13:21:28 +00:00
Anil Kumar Muraleedharan
7a24ecde86 Lenovo cnos system module (#53764)
* Adding cnos_system module to Ansible.

* Adding UT, Functional test required for cnos_system. Bugs came up are fixed

* Adding more files to the cnos_system suit.
2019-03-20 08:50:45 -04:00
Anil Kumar Muraleedharan
e4a1473a8f Lenovo cnos static route (#53736)
* Adding new module to Ansible viz. cnos_static_route.
2019-03-20 08:47:45 -04:00
Chris Van Heuveln
07774b4ccf nxos_igmp_snooping: more group-timeout fixes (#53553)
* Fixed another problem where `group-timeout` was processed before `ip igmp snooping` was enabled

* `sanity` playbook:
 * N6K: `show ip igmp snooping | json` succeeds on the device but doesn't return any data in body; added a skip to the sanity playbook to keep it out of CI
 * Added a setup task to do initial cleanup on the device
2019-03-20 13:08:36 +05:30
Zim Kalinowski
5b79631380
Getting latest API version if not specified in azure_rm_resource (#54022) 2019-03-20 14:38:18 +08:00
Carson Anderson
31ceba7fd8 Windows module: win_optional_feature for Windows workstations (#53709)
* initial commit

* fix execute and \r\n

* \r attempt 2

* updated with integration tests and using new csharp import

* Apply suggestions from code review

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

* fixed small docuement inaccuracies wrt returns

* removal of state in feature result

* removal of rc

* small fixes suggested in code review

* fixed variable assigning to result

* addition of comments on conditionals for clarity on matching

* swap logic of check_mode

* set $reboot_required so it is always returned

* removal of extraneous return information

* addition of integration tests

* set installation of parent features to true

* remove 2008 from tests

* changed test for TelnetClient from NetFx3

* change of tabs to spaces

* Add test check for OS version
2019-03-20 12:13:06 +10:00
Pilou
dbb782a594 Conditional bare: fix typos (#53807) 2019-03-19 21:29:59 -04:00
Alexander Bethke
8f354ea307 Use local dummy repo for flatpak_remote integration tests (#52668)
* Use local dummy repo for flatpak_remote integration tests

* Excludes versions of Ubuntu older than 16.04 from tests

Since there are no flatpak packages available for these Ubuntu versions

* Adds handler that removes temporary symlink
2019-03-19 17:16:26 -07:00
Patryk D. Cichy
968bedd8c2 Add an integration test for deleting image stores in check mode (#54015) 2019-03-19 08:10:05 +01:00
John Nelson
38346d0337 win_dns_record (#51925)
* win_dns: Initial work

* win_dns: initial commit

* Renaming win_dns -> win_dns_record

* win_dns_record: Fix record leakage in output

* win_dns_record: Fix erroneous minimums enforcement

It is apparently completely legitimate to specify a TTL that is below
minimum; it will just get ignored in favor of the server's minimum.

* win_dns_record: Fix new-host changes reported incorrectly

* win_dns_record: Fix TTL changes reported incorrectly

* win_dns_record: Fix existing records not recognized

* win_dns_record: Remove obsolete object

* Refactorize check mode

* Add computer_name parameter

* Refactorize diff and changed to read DNS end state

* Fix pslint tests PSUseDeclaredVarsMoreThanAssignments and PSAvoidUsingCmdletAliases

* Minor fix, misnamed variable.

* win_dns_record: Fix "changed" state in check mode

* win_dns_record: cleanups

* win_dns_record: fix TTL update not changed regression

* Add initial integration tests

* win_dns_record: integration tests

* win_dns_record: Reverted 9cf5f2d8e6

The approach from that commit breaks check mode.

* win_dns_record: de-scope some records

These are either esoteric (meaning limited realworld testing)
or require additional thought to do properly (eg MX, which
has its "priority" level).

* win_dns_records tests: Ensure DNS services are installed

* Update lib/ansible/modules/windows/win_dns_record.py

Co-Authored-By: johnboy2

* Update lib/ansible/modules/windows/win_dns_record.py

Co-Authored-By: johnboy2

* Aggregated suggestions from dagwieers

* Fix bad powershell test argument

* win_dns_record partially converted to new Powershell module interface

win_dns_record converted to new Powershell module interface, except diff 
and required_if

* win_dns_record: convert diff support

* win_dns_record: convert diff support to after-before style

* Don't test for Add-WindowsFeature

* win_dns_record: Fix diff

When check mode is used diff changes must be simulated.

* Style consistency/clean-ups

* Fix integration test typos

* Improve readability of diff output

The original intention of the diff output was to resemble zone file records
(except that the zone-name is added onto each record). In that light, the
missing *record class* information (always "IN" in our case) was an oversight.

This just makes the diff output more "instantly readable" for DNS gurus.

* win_dns_record: Add diff tests

* Fix ansible-test sanity check fails

* Apply suggestions from code review

Added suggestions from dagwieers

Co-Authored-By: johnboy2 <john@jnelson.ca>

* win_dns_record: Skip 2008 and friends

* Reword error messages so they start capitalized.

* Fix sanity error

* win_dns_record: Document ttl range

* win_dns_record: Additional supportability barriers in tests

* win_dns_record: Typo

* win_dns_record: Sanity fix

* win_dns_record: Use OS-test only for compat checking
2019-03-19 15:37:14 +10:00
Zim Kalinowski
41be7851cb
adding deployment facts (#53204) 2019-03-19 12:10:31 +08:00
Jordan Borean
7ab77f6c8a
win_psexec - support paths with a space (#54009) 2019-03-19 12:51:30 +10:00
Jordan Borean
cf24542e9f
win_get_url - fix glob like paths (#54008) 2019-03-19 12:01:35 +10:00
Jordan Borean
eb18df1a0f
win_certificate_store - fix glob like paths (#54007) 2019-03-19 11:49:25 +10:00
Jordan Borean
2f1bc34589
win_copy - fix glob like paths (#54006) 2019-03-19 11:22:17 +10:00
Jordan Borean
8a4079ddbf
win_find - fix glob like paths (#54005) 2019-03-19 10:30:11 +10:00
Felix Fontein
e00f315358 openssl_privatekey: add backup option (#53593)
* Add backup option to openssl_privatekey.

* Add changelog fragment.

* Make module available in remove().

* Add tests for backup.

* Update lib/ansible/modules/crypto/openssl_privatekey.py

Co-Authored-By: felixfontein <felix@fontein.de>

* Update lib/ansible/modules/crypto/openssl_privatekey.py

Co-Authored-By: felixfontein <felix@fontein.de>

* Update lib/ansible/modules/crypto/openssl_privatekey.py

Co-Authored-By: felixfontein <felix@fontein.de>

* Update lib/ansible/modules/crypto/openssl_privatekey.py
2019-03-18 16:34:47 +00:00
Sloane Hertel
7da565b3ae
parse botocore.endpoint logs into a list of AWS actions (#49312)
* Add an option to parse botocore.endpoint logs for the AWS actions performed during a task

Add a callback to consolidate all AWS actions used by modules

Added some documentation to the AWS guidelines

* Enable aws_resource_actions callback only for AWS tests

* Add script to help generate policies

* Set debug_botocore_endpoint_logs via environment variable for all AWS integration tests

Ensure AWS tests inherit environment

(also remove AWS CLI in aws_rds inventory tests and use the module)
2019-03-18 08:29:03 -05:00
Andrey Klychkov
cf5aceb482 New module postgresql_set - Change a PostgreSQL server configuration parameter (#51875)
* New module postgresql_set - Change a PostgreSQL server configuration parameter

* New module postgresql_set - fix

* New module postgresql_set - fix tests

* New module postgresql_set - fix tests

* New module postgresql_set - fix tests

* New module postgresql_set - fix tests

* New module postgresql_set - fix tests

* New module postgresql_set - fix tests

* New module postgresql_set - fix tests

* Various cosmetic and docs changes

* New module postgresql_set - add returned value

* New module postgresql_set - add returned value

* New module postgresql_set - add check mode

* New module postgresql_set - fix comment

* New module postgresql_set - added CI tests for check_mode

* New module postgresql_set - added aliases, fix typos

* New module postgresql_set - fix

* New module postgresql_set - fix sanity

* New module postgresql_set - fixes

* New module postgresql_set - fixes

* New module postgresql_set - fixes
2019-03-18 11:39:10 +00:00
Andrey Klychkov
db17e88fd2 New module postgresql_facts: Gathers facts about PostgreSQL servers. (#51164)
* New module postgresql_facts: Gathers facts about remote PostgreSQL instances

* New module postgresql_facts: fix default values of function

* New module postgresql_facts: add extension support

* New module postgresql_facts: fixed typo

* New module postgresql_facts: added integration test

* New module postgresql_facts: fix test error

* New module postgresql_facts: add info about min server version

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: added repl stat tables checks

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: fix

* New module postgresql_facts: ansible_facts -> postgresql_facts

* New module postgresql_facts: fix ci

New module postgresql_facts: revision for review

New module postgresql_facts: revision for review, fix

* fix doc

* New module postgresql_facts: add data types to param dict

* New module postgresql_facts: code refactoring

* # This is a combination of 3 commits.
# The first commit's message is:
New module postgresql_facts: incl_subset => filter

# This is the 2nd commit message:

New module postgresql_facts: fix a typo

# This is the 3rd commit message:

New module postgresql_facts: fixes

* New module postgresql_facts: incl_subset => filter

New module postgresql_facts: fix a typo

New module postgresql_facts: fixes

Various cosmetic and doc changes

* New module postgresql_facts: fix filter type

* New module postgresql_facts: fix sanity

* New module postgresql_facts: change ansible_facts to postgresql_facts

* New module postgresql_facts: fix tests

* New module postgresql_facts: fixes

* New module postgresql_facts: fixes

* New module postgresql_facts: fixes

* New module postgresql_facts: doc fixes

* New module postgresql_facts: added pretty_val

* New module postgresql_facts: added pending restart

* New module postgresql_facts: fix documentation

* New module postgresql_facts: fix documentation

* New module postgresql_facts: fixes by KN

* New module postgresql_facts: fixed sanity

* New module postgresql_facts: fixed tests
2019-03-18 11:31:32 +00:00
Felix Fontein
50d56ca89d docker_image: stop pulling by default on build (#53911)
* Prepare to change default of build.pull from yes to no in Ansible 2.12.

* Specify build.pull.

* Add changelog.

* Fix bad indent.
2019-03-18 01:34:07 -04:00
Felix Fontein
35b295f6af docker_swarm inventory plugin: extend tests (#53913)
* Extend tests.

* Update BOTMETA so that docker* inventory tests are associated with .
2019-03-17 10:28:55 +00:00
René Moser
f20575e2a8
tests: vultr_server: adjust plan names, fixes integration test (#53914)
* vultr_server: update plan name, fixes integration tests

* remove superfluous templating in assert
2019-03-17 11:28:29 +01:00
Felix Fontein
259b2e06a4 docker_swarm inventory plugin: add basic integration tests (#53908)
* Add basic docker_swarm inventory plugin integration tests.

* Call dependency explicitly.
2019-03-17 08:16:18 +00:00
Patryk D. Cichy
851cfc0c18 Add new Cloudstack module cs_image_store (#53617) 2019-03-16 07:58:55 +01:00
Abhijeet Kasurde
142732dba9 dataloader: check exact value of dir (#52021)
Include path in role with directory which has 'tasks' as end.
For example, roles/sometasks/templates is now considered while searching path.

Fixes: #42585

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-03-16 01:48:01 -04:00
The Magician
92fd49de77 Bug fixes for GCP modules (#53880) 2019-03-15 17:49:49 -04:00
The Magician
3a43e41b39 Bug fixes for GCP modules (#53881) 2019-03-15 17:49:38 -04:00
The Magician
b429ba61dc Bug fixes for GCP modules (#53879) 2019-03-15 17:38:27 -04:00
The Magician
e8e69bf069 Bug fixes for GCP modules (#53878) 2019-03-15 15:43:12 -04:00
The Magician
204ae88491 Bug fixes for GCP modules (#53882) 2019-03-15 15:43:00 -04:00
Matt Clay
b25a37bb38
Convert k8s test to role and fix virtulenv usage. (#53883) 2019-03-15 12:37:46 -07:00
Matt Martz
85138a78a8 Cleanup yaml files with incorrect task attrs (#53813) 2019-03-15 13:05:09 -04:00
Matt Clay
906427caba
Add shippable/posix/group4/ for CI. (#53816) 2019-03-15 07:25:37 -07:00
Gaudenz Steinlin
a65a137cdd Fix failure of cloudscale_floating_ip without server (#53702)
The cloudscale_floating_ip module failed if no server was assigned to
the floating IP. This also adds a test to avoid a regression.

The only way to have a floating IP without a server assigned is to
delete the server where the floating IP is currently assigned. Under
normal circumstances it's not possible to have an unassigned floating
IP.
2019-03-15 09:50:09 +00:00
Jordan Borean
980ca564ce
windows - Fix module utils with glob paths (#53835)
* windows - Fix module utils with glob paths

* fix link util tests when using DOS 8.3 paths
2019-03-15 19:44:53 +10:00
Felix Fontein
77f7e5a986 Only use ports in the range 9001-9060. 2019-03-14 23:50:41 -07:00
Jordan Borean
cac3c6efcf
win_chocolatey - Fix incompatibilities with latest Chocolatey release (#53841) 2019-03-15 16:40:30 +10:00
Jordan Borean
e0c0e9a10b
win_chocolatey_source - don't rely on cmd to get source info (#53837) 2019-03-15 16:26:48 +10:00
Jordan Borean
d00418c924
win_slurp - fix glob like paths (#53831) 2019-03-15 14:59:01 +10:00
Jordan Borean
d063cefb64
win_owner - fix glob like paths (#53830)
* win_owner - fix glob like paths

* Fix issues on older PS versions
2019-03-15 14:58:15 +10:00
Jordan Borean
3cfa71bff0
win_acl_inheritance - fix glob like paths (#53829) 2019-03-15 14:57:59 +10:00
Jordan Borean
aba6f5f50d
win_acl - fix glob file paths (#53828) 2019-03-15 14:57:41 +10:00
Jordan Borean
4f9de45785
win_tempfile - return absolute path on created temp file (#53827)
* win_tempfile - return absolute path on created temp file

* Fix tests for CI
2019-03-15 14:57:27 +10:00
Matt Clay
17ed39a009
Fix uri integration test uninstall of urllib3. (#53834) 2019-03-14 21:52:03 -07:00
Sam Doran
1e595493d9
User module - Check local database when local is specified in the task (#51088)
The output of pw.getpwnam() does not distinbuish between local and remote accounts. It will return a result if an account exists locally or in the directory. When local is set to True in the task parameters, look through the local password database explicitly.

* Ensure luseradd is present for tests
* Add docs and warnings about local mode
2019-03-14 22:16:53 -04:00
Sam Doran
43a44e6f35
Move utility functions out of basic.py (#51715)
Move the following methods to lib/anisble/module_utils/common/validation.py:

- _count_terms()
- _check_mutually_exclusive()
- _check_required_one_of()
- _check_required_together()
- _check_required_by()
- _check_required_arguments()
- _check_required_if
- fail_on_missing_params() --> create check_missing_parameters()
2019-03-14 21:29:55 -04:00
Matt Clay
34b928d283 Remove conflicting urllib3 from pip in uri test.
The uri test will fail on centos6 if run after a test that installs urllib3 via pip unless it is uninstalled.
2019-03-14 18:00:13 -07:00
Matt Clay
b8349b1d61 Fix aliases for order integration test. 2019-03-14 13:24:32 -07:00
Matteo Ferrando
86405b8fe4 (postgresql_privs) accept 'ALL_IN_SCHEMA' objs for 'function' type (#35331)
* avoid using Postgres formatting function
* add tests for ALL FUNCTIONS IN SCHEMA
* documentation and changelog
* requested changes in tests
* fixed changelog
2019-03-14 20:21:05 +05:30
Felix Fontein
4573f349ea luks_device: add allow_to_remove_last_key option (#52371)
* Add allow_to_remove_last_key option.

* Dump headers.

* Add support for old versions of cryptsetup luksDump.

* Update lib/ansible/modules/crypto/luks_device.py

Co-Authored-By: felixfontein <felix@fontein.de>

* Rename allow_to_remove_last_key -> force_remove_last_key.
2019-03-14 09:55:35 +00:00
Felix Fontein
35e7fb776a docker_image: improve usage (#52894)
* Add source option.

* Split force parameter into force_source, force_absent and force_tag.

* Move all build-related options into a suboption called build.

* Add changelog.
2019-03-14 09:46:38 +00:00
Zim Kalinowski
a202509ba4
fixing resource facts (#53727) 2019-03-14 11:46:33 +08:00
Bob Boldin
b67505d271 AWS: new module ec2_transit_gateway fixes #49376 (#53651)
* AWS: new module ec2_transit_gateway fixes #49376

* Add permissions neeeded for integration tests

* uncomment nolog on creds

* add unsupported to integration test aliases

* remove the shippable/aws/group alias so doesn't conflict with unsupported
2019-03-14 09:42:33 +10:00
Matt Clay
7c315170c6 Reduce verbosity of blocks test. 2019-03-13 15:05:10 -07:00
Jordan Borean
d3792145d5
win_get_url - refactor tests to use httptester (#53765)
* win_get_url - refactor tests to use httptester

* Use the file lookup instead of slurp
2019-03-14 08:04:49 +10:00
Gabriel do Nascimento Ribeiro
f97a593da5 Add non_unique parameter for group module (#53085) 2019-03-13 15:40:07 -04:00
Alex Stephen
08918c6c2b GCP IAM Role (#53490)
* GCP IAM Role

* module util file

* test fix

* unit tests

* test fixes

* doc fragment fixes

* test fixes

* test fix
2019-03-13 13:28:01 -04:00
Matt Clay
a8e328f474
Overhaul ansible-test code coverage and injector. (#53510) 2019-03-13 07:14:12 -07:00
Fedor V
8ac6145180 vmware_vm_facts: custom attributes support (#45773)
* Add toggle to attribute facts gathering

Signed-off-by: Fedor V <f.vompe@comptek.ru>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-03-13 09:49:20 +05:30
Jordan Borean
b044bb431e
Use shared remote_tmp_dir to simplfy tests (#53721) 2019-03-13 12:26:59 +10:00
Jordan Borean
d9795bad98
win_reboot - fix broken tests after recent commit (#53722) 2019-03-13 12:24:41 +10:00
Jordan Borean
33939f7fe8
win_psexec: make the tests more stable (#53716) 2019-03-13 11:22:59 +10:00
Brian Coca
b793f08a92
fixes for stripping (#52930)
function changed to do in place replacement, should be less expensive even with copy as it avoids 'sub copies', can compose with module_args_copy to create replacement for old behavior

  attempt to fix #52910

* handle lists and subdicts correctly
* added  missing exception case, which was not noticed since 'cleaning' was not working
* added comments to clarify exceptions
2019-03-12 18:18:38 -04:00
Matt Clay
7a387e216e Disable failing azure_rm_keyvault test. 2019-03-12 14:29:15 -07:00
Matt Clay
6fd83f96d1 Disable old_style_cache_plugins integration test. 2019-03-12 14:04:30 -07:00
Gaudenz Steinlin
8111425a96 Cloudscale server password (#53701)
* cloudscale_server: remove required parameter check

The valid parameter combinations are already checked by the API. There
is no need to check a subset of this in the Ansible module as well. This
makes it more likely that future changes in the API won't require
changes in the Ansible module.

* cloudscale_server: add password parameter

Recent revisions of the cloudscale.ch API allow setting a password for a
server. Add this option to the cloudscale_server module.
2019-03-12 21:56:05 +01:00
Gaudenz Steinlin
6471e4653d Integration test cleanup for cloudscale modules (#53629)
* Integration test cleanup for cloudscale modules

This refactors the cleanup procedure for the integration tests of the
cloudscale_server and cloudscale_volume modules to use an "always"
section for cleanup. The cleanup code also deletes all resources which
contain the test run prefix. This ensures that all resources are cleaned
up regardless of the actual test result which is a prerequisite for
running these tests in CI.

* Move cloudscale_floating_ip tests from legacy to integration

This also adds code to make sure that floating IPs are deleted even if a
test run fails. This is unfortunately not possible for floatint IPv6
networks.
2019-03-12 17:53:49 +01:00
Chris Van Heuveln
15303b05ef nxos_vxlan_vtep: sanity.yaml test needs cast for httpapi tcam check (#53531)
This check was working for network_cli (returns value as int) but
failing for httpapi (returns value as str). Casting to int fixes the problem.
2019-03-12 19:19:27 +05:30
Nilashish Chakraborty
f615011de3
New module for BGP configuration management in iosxr (#53121)
* Add iosxr_bgp module

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Remove unused code

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Remove netconf code

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
2019-03-12 17:47:40 +05:30
Nilashish Chakraborty
9365c0f468
New module for BGP configuration management in Arista EOS (#52722)
* New module for BGP in EOS

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Add function to validate input

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Fix line indentation

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Add integration tests

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Fix CI

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Fix sanity test failure

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>

* Remove unused code

Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com>
2019-03-12 17:31:58 +05:30
Matt Clay
1143889f26 Fix integration test inventory. 2019-03-12 00:00:32 -07:00
Matt Clay
759e037edc Fix integration tests with custom inventory.
All inventory hosts to which a connection is actually established
should declare ansible_python_interpreter to avoid interpreter
auto-discovery, as that may select the wrong interpreter.
2019-03-11 21:43:58 -07:00
Simon Metzger
0d7ea0bae6 new module aci_access_sub_port_block_to_access_port (#51940)
* new module aci_access_sub_port_block_to_access_port

* new line at end of file
2019-03-11 18:05:57 -04:00
Lukas Kämmerling
32c337ee39 hcloud_server: streamline label handling (#53633) 2019-03-11 16:57:23 +01:00
Lukas Kämmerling
3e02502056 Add hcloud_ssh_key module (#53550) 2019-03-11 15:42:49 +01:00
Sam Doran
a4b2ce5e13
Add test to ordered integration tests to exercise shuffle code path (#53138)
This is meant to exercise the code path not test for randomness, though it somewhat does that.
2019-03-11 10:14:06 -04:00
Chris Van Heuveln
591e0ffb69 nxos_user: auth.yaml test: stronger test password needed (#53533)
Basic passwords are rejected by the nxos device unless `no password strength-check`
is configured. This change just makes the password meet the minimum strength checks.
2019-03-11 18:06:25 +05:30
Chris Van Heuveln
c5de2233d0 nxos_pim_rp_address: N7K sanity test fix when removing rp w/pfx-list (#53556)
The N7K is another platform that raises an error when trying to remove
an RP w/prefix-list specified. These tests are now skipped for N7K.
2019-03-11 18:05:59 +05:30
Chris Van Heuveln
c1e9f594d2 nxos_ospf_vrf: sanity.yaml test: fix timer_throttle_lsa_hold (#53561)
* The test was setting `lsa max` value to 2222 but the default `lsa hold` value is 5000.

* `hold` must be less than `max` or else the device raises a clierror, so I just added a lower non-default `hold` value to satisfy the cli.
2019-03-11 18:05:03 +05:30
Felix Fontein
3117900b1e docker_container: show warnings, fix/improve tests (#53440)
* Output warnings from docker daemon on container create and update.

* Accept warning for blkio_weight instead of idempotency.

* Value quoting.

* Avoid loop variable conflict.

* Add changelog.

* Make one test case faster.

* Add 'Docker warning: ' prefix.

* Add a generalized warning reporting function.
2019-03-11 19:04:06 +10:00
Hannes Ljungberg
7bb174214c docker_swarm_service: Add option rollback_config (#53594)
* Add rollback_config

* Add change log fragment

* Fix broken test

* Actually fix broken tests

* Add rollback_config example

* Default rollback_config as None

* Abort early if rollback_config does not exist
2019-03-11 18:55:41 +10:00
Jordan Borean
830a11dd38
test: optimize win_psmodule tests (#53431) 2019-03-11 05:43:21 +10:00
Hannes Ljungberg
57f706e5a0 docker_swarm_service: Extend mount options (#53559)
* Add mount options

* Remove mount readonly default

* Fix driver_config test

* Add documentation

* Add changelog fragment

* Properly indent tmpfs_ options

* Use correct service suffix for mount tests

* Check for None value on tmpfs usage check

* Document change of mounts.readonly return key

* Use correct change log type

* Really use correct change log type

* Revert changing mount.readonly to read_only
2019-03-09 14:35:57 -06:00
Matt Clay
5134ba95ca
Fix conditionals integration test. (#53583)
* Fix inventory for conditionals test.
* Remove extra groups from conditionals test.
2019-03-08 22:59:00 -08:00
Matt Clay
37bfa92076 Disable DevTest Labs tests. 2019-03-08 22:22:41 -08:00
Matt Martz
414440e323
Allow dict2items to work with hostvars (#53538) 2019-03-08 14:36:53 -06:00
Brian Coca
8940732b58
Configurable and parallel gather facts (#49399)
* Configurable list of facts modules (#31783)

 - allow for args dict for specific modules
 - add way to pass parameters
 - avoid facts poluting test
 - move to 'facts gathered' flag
 - add 'gathering' setting tests
 - allow parallel option in case serialization is too slow
 - added support to automatically map network facts
   uses "smart" connection mapping
2019-03-08 13:08:37 -05:00
Felix Fontein
caf7fd2245 openssl_*: improve passphrase handling for private keys in PyOpenSSL (#53489)
* Raise OpenSSLBadPassphraseError if passphrase is wrong.

* Improve handling of passphrase errors.

Current behavior for modules is: if passphrase is wrong (or wrongly specified), fail.
Current behavior for openssl_privatekey is: if passphrase is worng (or wrongly specified), regenerate.

* Add changelog.

* Add tests.

* Adjustments for some versions of PyOpenSSL.

* Update lib/ansible/modules/crypto/openssl_certificate.py

Improve text.

Co-Authored-By: felixfontein <felix@fontein.de>
2019-03-08 16:21:18 +00:00
Lukas Kämmerling
d4bd01c7ac hcloud: Add labels support to hcloud_server (#53514) 2019-03-08 11:10:30 +01:00
Chris Van Heuveln
8c33ba3ecd nxos_igmp_snooping: group-timeout fails when igmp snooping disabled (#53079)
* nxos_igmp_snooping: group-timeout fails when igmp snooping disabled

group-timeout config will be rejected by the device if `ip igmp snooping` is disabled.

  * raise a failure for this condition

  * reorder the command list so that group-timeout is always last

* SA fixes

* SA fixes

* only call gt_dependency if gt
2019-03-08 15:33:24 +05:30
Chris Van Heuveln
ea0ef3b2e1 nxos_pim_rp_address: update sanity test to work with legacy N3K (#53471)
Test yaml fixes for n3048:

* 3048 does not support bidir option
* 3048 cannot remove rp-address if prefix-list/route-map is present
  * yes: no ip pim rp-address x.x.x.x
  *  no: no ip pim rp-address x.x.x.x prefix-list foo
  *  no: no ip pim rp-address x.x.x.x route-map bar

This test now passes on N9k/N7k/N6k/N3k.
2019-03-08 15:29:34 +05:30
Bartosz Licheński
6e198487c9 postgresql_privs: Support FOREIGN DATA WRAPPER and FOREIGN SERVER (#38803)
* Support FOREIGN DATA WRAPPER and FOREIGN SERVER in postgresql_privs module
* Added available from note to fdw and fs object types
* Integration tests, examples in documentation
* Complete integration tests
2019-03-08 14:51:03 +05:30
Hannes Ljungberg
f5faf8211d docker_swarm_service: Add read_only option (#53482)
* Add read_only option

* Add changelog fragment

* Add version_added

* Fix broken test
2019-03-08 03:34:49 -05:00
Jakob Ackermann
13ab9a61a8 [docker_image] fix the changed state for tagging and pushing (#53451)
* [docker_image] fix the changed state for tagging and pushing

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* [docker_image] add tests for (force) tagging and force pushing

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* [docker_image] add a news fragment for the fixed force tag/push behavior

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
2019-03-08 08:28:42 +00:00
S
3bc474bf99 Fixed win_file crash with hidden files (#52584)
* Fixed crash with hidden files

added "-force" parameter on "Get-Item" cmdlet. this is needed to get file info if the file is "hidden" 
without this option modules like win_file, win_template, win_copy crashes on hidden files. this is because with "test-path" it sees that the file exists, but "get-item" can't get the file info. 
for more information on "-force option": https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-item

* Add changelog and integration tests

* fix tests for older Windows versions
2019-03-08 15:32:32 +10:00
Chris Van Heuveln
cfe4477c10 nxos_vxlan_vtep: Add dependency checks (#53288)
* nxos_vxlan_vtep: Add dependency checks

Some of the N9k-specific attrs are failing due to hardware/feature/resources.

 * `global_suppress_arp`
   - dependency on TCAM resources

 * `global_mcast_group_L3`
   - hardware dependency on specific chassis/linecards
   - feature dependency on `ngmvpn`

 * `global_ingress_replication_bgp`
   - hardware dependency on specific chassis/linecards

Tested on N9k with/without TCAM resources, various N9k chassis, N7k, N6k. All 100% Pass.

* pylint
2019-03-08 10:33:54 +05:30
Jordan Borean
0f2041abbd test: fix get_url issues in CI for Ubuntu 14.04 2019-03-07 20:37:31 -08:00
Jordan Borean
8ef2e6da05 Add support for Windows hosts in the SSH connection plugin (#47732)
* Add support for Windows hosts in the SSH connection plugin

* fix Python 2.6 unit test and sanity issues

* fix up connection tests in CI, disable SCP for now

* ensure we don't pollute the existing environment during the test

* Add connection_windows_ssh to classifier

* use test dir for inventory file

* Required powershell as default shell and fix tests

* Remove exlicit become_methods on connection

* clarify console encoding comment

* ignore recent SCP errors in integration tests

* Add cmd shell type and added more tests

* Fix some doc issues

* revises windows faq

* add anchors for windows links

* revises windows setup page

* Update changelogs/fragments/windows-ssh.yaml

Co-Authored-By: jborean93 <jborean93@gmail.com>
2019-03-07 16:38:02 -08:00
Hannes Ljungberg
3d07e7241a docker_swarm_service: Documentation fixes (#53479)
* Document and validate mode choices

* Update examples

* Test cpu float values

* Test correct option

* Fix module return sample

* Add secrets and user to module return value

* Order options alphabetically

* Add changelog

* yaml indentation

* Revert "Order options alphabetically"

This reverts commit 51dabccda7.

* Be consistent with choices type
2019-03-07 16:51:59 -06:00
Jordan Borean
072fa54b50
win reg - Support special chars in path (#53305)
* win reg - Support special chars in path

* Added deprecation warning for path separators
2019-03-08 05:41:52 +10:00
Felix Fontein
e4f2e15b96 Trying to work around spurious test failures. (#53472) 2019-03-07 14:35:47 -05:00
Matt Clay
3907ea31f5 Rebalance docker_* integration tests. 2019-03-07 10:59:40 -08:00
Andrey Klychkov
b41027b6cd New module postgresql_tablespace (#52914)
* New module postgresql_tablespace
2019-03-07 16:27:20 +00:00
Felix Fontein
b2e992cecd openssl_csr: improve subject validation (#53198)
* Improve subject field validation.

* Add country name idempotency test.

* Add failed country name test.

* Add changelog.
2019-03-07 15:29:35 +00:00
Matt Martz
264d9a9008
Allocate an explicit stdin in async_wrapper (#53410)
* add changelog fragment

* Add stdin async test

* Allocate an explicit stdin in async_wrapper. Fixes #50758
2019-03-07 09:28:44 -06:00
Chris Van Heuveln
495bd02dbf nxos_evpn_vni: exclude legacy N3k from sanity test (#53452)
The test was only skipping N3K|N35, needs to also skip N3L (legacy n3048 chassis).
2019-03-07 18:39:47 +05:30
Zim Kalinowski
b906db5f2a
removed state present which is default (#53434) 2019-03-07 13:13:12 +08:00
Matt Clay
9ed9cfb40c Split Windows tests into 5 groups. 2019-03-06 20:52:17 -08:00
Matt Clay
77a03af394 Use sed instead of perl in assert test. 2019-03-06 15:11:47 -08:00
Felix Fontein
a904bc7797 improve docker_* test speed (#53417)
* docker_swarm_service tests: use 'resolve_image: no' to avoid registry lookup if image is up-to-date.

* Improve docker_node performance: don't sleep after last try.
2019-03-06 14:01:00 -08:00
Hannes Ljungberg
c563caf451 docker_swarm_service: Set minimum docker-py version to 2.0.2 (#53295)
* Fix version checks in tests

* Set minimum version to 2.0.2

* Networks can only be updated >= docker-py 2.7

* Constraints require docker-py 2.4.0

* Healthchecks require docker-py 2.6.0

* Properly run tests different docker_py_versions

* Add changelog fragment

* Specify lowest version on placement.constraints

* Fix running new tests on older docker-py

* Handle different hosts formats returned by docker

* FIx test naming

* Quote str options

* secrets options require docker-py 2.4.0
2019-03-06 20:50:05 +00:00
Yunge Zhu
5ef7b7d767 add azure role definition module (#52468)
* add role definition module

* fix sample

* fix lint

* fix lint

* add facts module

* fix lint

* disable test due to no owner permission

* use unsupported

* fix lint

* resolve comments

* fix not_xxx_actions
2019-03-06 11:09:54 -08:00
Sloane Hertel
9687879840
Fix inventory cache interface (#50446)
* Replace InventoryFileCacheModule with a better developer-interface

Use new interface for inventory plugins with backwards compatibility

Auto-update the backing cache-plugin if the cache has changed after parsing the inventory plugin

* Update CacheModules to use the config system and add a deprecation warning if they are being imported directly rather than using cache_loader

* Fix foreman inventory caching

* Add tests

* Add integration test to check that fact caching works normally with cache plugins using ansible.constants and inventory caching provides a helpful error for non-compatible cache plugins

* Add some developer documentation for inventory and cache plugins

* Add user documentation for inventory caching

* Add deprecation docs

* Apply suggestions from docs review

* Add changelog
2019-03-06 12:12:35 -06:00
Anil Kumar Muraleedharan
77565554c8 To fix bug on switch port issue of L3 interfaces. (#53267)
* To fix bug on switch port issue of L3 interfaces.

* Adding mock return value for is_switch_port method
2019-03-06 12:08:53 -05:00