Commit graph

1720 commits

Author SHA1 Message Date
Matt Clay
996f9c2467
Fix mysql-server install/upgrade on Ubuntu 16.04. (#39241)
* Fix mysql-server install/upgrade on Ubuntu 16.04.
* Prevent service restart in docker_secret test.
2018-04-24 12:02:26 -07:00
Jordan Borean
629efb6eaa
psexec: new module to run commands on a remote Windows host without WinRM (#36723)
* psexec: new module to run commands on a remote Windows host without WinRM

* fix up sanity issue, create test firewall rule for SMB traffic

* Fixed up yaml linting issues, trying to fix on the fly firewall rule

* Added SMB exception to catch when cleaning up PAExec exe

* Don't load profile for Azure hosts when becoming another user

* Fixed up example to use correct option

* Reworded notes section of module docs

* Simplified module options around process integrity levels and the system account
2018-04-24 12:15:15 +10:00
Jordan Borean
b6afe6946d
Ansible.ModuleUtils.FileUtil - Add ability to test non file system provider paths (#39200) 2018-04-24 10:06:47 +10:00
Matt Clay
c262dbfd30 Use https for links to ansible.com domains. 2018-04-23 11:33:56 -07:00
saichint
6eecbf10e6 fix nxos_igmp_interface issues (#38752)
* fix nxos_igmp_interface issues

* shippable fix

* fix oif_prefix and oif_source

* shippable fix

* shippable fix

* shippable fix

* add an example for oif_ps

* review comments

* review comments

* more review comments

* fix typo
2018-04-23 20:38:49 +05:30
Will Thames
412373ce8e Improve ec2_ami tests (#38987)
* Improve ec2_ami tests

Ensure that ec2_ami_image_id fact gets set immediately after AMI
creation so that they get torn down even if tests fail

Use YAML anchor to simplify AWS credential passing

Use aws_connection_info to reduce AWS credential boilerplate

Improve exception handling when updating image attributes

Error messages weren't correctly formatted to show image ids.
2018-04-23 07:54:49 -04:00
Alan Rominger
f072e6c15a add newer syntax to detached HEAD check (#38879) 2018-04-23 13:40:54 +02:00
Tim Steinbach
f61172e6c7 vmware: Add portgroup_portkey and portgroup_key (#38958)
* VMware: apply correct value for datacenter in TC

Signed-off-by: Tim Steinbach <tim@nequissimus.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-23 14:04:35 +05:30
David Passante
7437d6fdc4 cs_ip_address: add a "tags" parameter to ensure idempotency (#39016)
* cs_ip_address: add a "tags" parameter to manage idempotency

* cs_ip_address: add integration tests
2018-04-22 20:13:01 +02:00
Matt Clay
9488b0c8b1 Remove unused test files. 2018-04-22 07:11:34 -07:00
Toshio Kuratomi
ce796bc34d Clarify the behaviour of file's src parameter with relative paths
Fixes #21401

Also sdd some more tests to validate file state=link creates a symlink
which points to the file we intended.
2018-04-20 14:12:27 -07:00
Toshio Kuratomi
f332151f59 Fix copy to only follow symlinks for files in the non-recursive case
Revert "**Temporary**"

This reverts commit 28b86b1148.

We don't need this now that copy has been fixed
2018-04-20 10:04:24 -07:00
Matt Clay
fafceb9895 Mark unstable azure_rm_functionapp test. 2018-04-20 07:06:07 -07:00
Martin Krizek
62d2df74b0 apt: fix build-dep idempotency (#38999) 2018-04-20 07:57:14 +02:00
Sviatoslav Sydorenko
87eca24969 Add playbook with foreman tests 2018-04-20 00:36:23 +02:00
Sviatoslav Sydorenko
fb0487945c Add runme script to foreman inventory tests 2018-04-20 00:36:23 +02:00
Sviatoslav Sydorenko
d0018848a5 Enable foreman inventory plugin in tests 2018-04-20 00:36:23 +02:00
Sviatoslav Sydorenko
e169da0748 Initialize foreman test suite 2018-04-20 00:36:23 +02:00
Abhijeet Kasurde
268c682a05 VMware: new module : vmware_cluster_facts (#37105)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-19 05:41:04 -04:00
Sloane Hertel
e2aa1155ba [ec2_ami] Ensure name or image_id is provided for state=present (#38972)
Add integration tests for backward compatibility and ensuring name or image_id is provided
2018-04-19 09:28:25 +10:00
David Gunter
a833281e22 Add Yarn module (#19026)
* Add yarn module based off of NPM module, adjust syntax for install cmd

* Update author list

* Add Return docbloc

* Remove extra var assignment

* Always return output without emojis, small changes for yarn 0.16.1

* Move import line, add ANSIBLE_METADATA, bump version_added

* Updating module format to meet newest lint requirements. Update options and example docs.

* Bring back RETURN block and main() execution.

* All trailing whitespace removed.

* Remove json try/except.

* Add initial pass at setting up Yarn integration tests.

* Add better handling for latest and removal states. Add tests for upgrading a single package.

* Fix issue where state=latest for installing all packages caused failure.

* Set yarn bin to latest version for tests. Fix sanity tests.

* Switch template task to copy task in yarn integration tests.
2018-04-18 08:19:38 -05:00
Matt Clay
e401927d67 Restore seboolean and sefcontext tests on RHEL. 2018-04-17 16:34:47 -07:00
Jordan Borean
77ef4802f0
win_regedit: stabilise tests (#38912) 2018-04-18 08:11:44 +10:00
Matt Clay
57f1298074 Restore docker_secret test on RHEL. 2018-04-17 13:56:11 -07:00
Ryan Brown
44d06f8858
[cloud] Add support for updating IAM role with ec2_instance module (#38812)
* [cloud] Add support for updating IAM role with ec2_instance module

* Add test for updating IAM role
2018-04-17 15:02:46 -04:00
Will Thames
0b4f92d852 Lambda policy arn (#38863)
* Fix the function_name handling logic for lambda_policy

Switch the logic handling function_names that are ARNs
so that ARNs are correctly handled and detected

* Add tests for lambda_policy function_arn

Ensure that function_arn works.

Needs a reasonable ansible_lambda_role.
2018-04-17 09:53:59 -04:00
saichint
a372142434 fix ntp_auth issues (#38824) 2018-04-17 08:25:05 -04:00
Martin Krizek
3922b6cc93
apt: integration tests for #31577 (#38586) 2018-04-17 10:17:29 +02:00
Jordan Borean
44fc3459cf
win_pester: move away from public repo to source test files (#38862) 2018-04-17 15:24:54 +10:00
Matt Martz
354aa8d602
Skip self._parent on dynamic, defer to grandparent for attr lookup (#38827)
* Skip self._parent on dynamic, defer to grandparent for attr lookup

* Revert _inheritable

* Add tests for include inheritance from static blocks

Fixes #38037 #36194
2018-04-16 16:46:47 -05:00
Matt Clay
5bf5f25115 Temporarily disable sefcontext test on RHEL. 2018-04-14 17:35:17 -07:00
Matt Clay
0f13333615 Temporarily disable seboolean test on RHEL. 2018-04-14 16:24:35 -07:00
Matt Clay
74f7b8e81c Temporarily disable docker_secret test on RHEL.
Test does not pass on RHEL 7.4 with pip 10 installed.
2018-04-14 13:10:15 -07:00
Matt Clay
eb72f2d1f3 Mark rabbitmq_user test unstable. 2018-04-14 13:05:21 -07:00
Matt Clay
cacc3c893b Disable fortios_* integration tests.
These tests require pyfg which depends on pip internals that are
no longer available under pip 10.
2018-04-14 13:02:00 -07:00
Abhijeet Kasurde
9b139baacb
VMware: Set default network type as 'dhcp' (#38518)
If user does not specify any network type then set network type
to dhcp. There are additional checks around 'ip', 'netmask' and
'type' in network spec.

Fixes: #38466

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-13 23:21:39 +05:30
saichint
1d975bdc93 fix nxos_ntp_options (#38695) 2018-04-13 06:17:32 -04:00
Matt Clay
ab52d84151 Mark win_pester test as unstable. 2018-04-12 22:23:45 -07:00
Matt Clay
26f2da3874 Mark unstable integration tests. 2018-04-12 21:41:35 -07:00
Matt Clay
8a223009ca
Improve handling of integration test aliases. (#38698)
* Include change classification data in metadata.
* Add support for disabled tests.
* Add support for unstable tests.
* Add support for unsupported tests.
* Overhaul integration aliases sanity test.
* Update Shippable scripts to handle unstable tests.
* Mark unstable Azure tests.
* Mark unstable Windows tests.
* Mark disabled tests.
2018-04-12 16:15:28 -07:00
Matt Clay
3dee0b67e8 Fix test aliases. 2018-04-12 11:08:15 -07:00
Alex Stephen
9de9633cac [GCP] New module GCP DNS Resource Record Set (#35920) 2018-04-12 07:31:43 -04:00
Sam Doran
e5776a129a Add include_import tests for many top level include_tasks (#36531)
* Add include_import tests for many top level include_tasks

Rename a few test playbooks to make more sense

* Use fewer include_tasks due to memory limits in CI
2018-04-11 17:08:33 -04:00
saichint
ed42331105 fix nxos_igmp_snooping issues (#38566)
* fix nxos_igmp_snooping issue

* shippable error fix
2018-04-11 10:14:27 -04:00
Matt Martz
0507c907a9
get_url should accept headers as a dict, instead of only a complicated string (#35470)
* get_url should accept headers as a dict, instead of only a complicated string

* update headers description text

* Add headers string and dict tests for get_url

* Add intg test for string header format parsing error

* Adjust deprecation version ahead 1 release, add the version dict format was added in to description
2018-04-10 11:50:39 -05:00
Matt Martz
450cfa8776
Handle duplicate headers in the uri module (#33792)
* Handle duplicate headers, and make it easier for users to use cookies, by providing a pre-built string

* Ensure proper cookie ordering, make key plural

* Add note about cookie sort order

* Add tests for duplicate headers and cookies_string

* Extend tests, normalize headers between py2 and py3

* Add some notes in test code

* Don't use AttributeError, use six.PY3. Use better names.
2018-04-10 09:26:51 -05:00
Matt Martz
f1082af73f
Error if a module is found to shadow a reserved keyword (#34649)
* Error if a module is found to shadow a reserved keyword

* Add test for shadowed module

* Bring in functools.wraps for the decorator

* Drop the decorator, make _find_plugin the real function, find_plugin now holds the shadow logic

* Swap order of functions for bottom to top execution order

* Only error for modules

* Add test for loading a lookup plugin that shadows a keyword
2018-04-10 09:26:27 -05:00
Martin Krizek
d97952dbf4
apt: allow for --allow-unauthenticated in upgrade (#38381)
* apt: allow for --allow-unauthenticated in upgrade

* Style fix

* Another style fix

* Add trailing comma
2018-04-10 15:37:41 +02:00
saichint
361437b042 fix nxos_igmp issues (#38496) 2018-04-10 00:05:58 -04:00
saichint
dabe5e6d07 fix nxos_hsrp issues (#38410)
* fix nxos_hsrp issues

* shippable fix

* add examples for md5 auth
2018-04-09 23:54:05 -04:00
Nate
c38617a736 fix for when status codes are provided as a comma separated list (#38080)
* fix for when status codes are provided as an array of strings

* convert status codes to int, additional tests
2018-04-10 12:25:08 +10:00
Jordan Borean
0d374f28d2 win_exec_wrapper: fix tests after recent change (#38504) 2018-04-09 17:48:14 -07:00
Martin Krizek
bb6f90ff6f
apt: properly set changed for autoremove/autoclean (#38329) 2018-04-09 11:10:42 +02:00
Yanis Guenane
99497ce54c openssl_certificate: Handle dump() in check_mode (#38386)
Currently, when ones run the module in check_mode it tries to retrieve
values from the actual certificate generated in the generate() function.

Since in check_mode we call dump() without calling generate(), self.cert
is None, leading to self.cert.get_notBefore(), self.cert.get_notAfter()
and self.cert.get_serial_number() raising an error.

>  NoneType' object has no attribute 'get_notBefore'

The solution is to have two way to handle dump() method, whether its run
in check_mode=True or check_mode=False leading to different way the
information is retrieved.
2018-04-09 09:26:02 +01:00
Julien Vey
bab947d854 Migrate s3_bucket module to boto3 (#37189) 2018-04-06 14:33:58 -04:00
Dag Wieers
9bb1ee30bf Required changes to support redirects on HTTP 307/308 (#36809)
* Required changes to support redirects on HTTP 307/308

This ensures HTTP 307 and 308 will redirect the request to the new
location without modification.

* Fix the unused newheaders reference

* Be more compliant

* Add integration tests for follow_redirects=all

* Improve other tests for new behaviour

* Make follow_redirects values more strict
2018-04-06 13:17:14 -05:00
Brian Coca
3c996d0f74 make aef test more predictable
revert "Disable any_errors_fatal test."
This reverts commit 56189cc312.

fixes #38407
2018-04-06 09:48:30 -07:00
Matt Clay
56189cc312 Disable any_errors_fatal test. 2018-04-06 08:16:15 -07:00
David Newswanger
712d30f46c
Add eos_smoke integration tests (#36957)
* added eos_smoke tests

* removed left over file

* added note to uncomment broken eapi test when #36919 is fixed

* uncommented fixed test, added unbecome test

* skip become tests when connection=local
2018-04-06 08:16:07 -04:00
Erwan Quélin
49aac5f8c7 Added module win_pester and relatives integration tests (#37343)
* Added module win_pester and relatives integration tests

* Corrected issues as stated by ansible-test

* Added defaults variable in integration tests

* Added task to install Pester if needed in the integration test

* Corrected error in win_psmodule task

* Added Pester installation with Chocolatey when Powershell version < 5

* Get facts...

* Disabled invoke-pester output

* Added pester_result type

* Added jhawkesworth changes proposal

* Corrected documentation linting

* Corrected linting

* Added dagwieers recommendations

* Added dagwieers recommendations

* Corrected linting errors and task error in integration test

* Corrected error in integration test

* Added dagwieers recommendations

* Corrected requirements in the DOCUMENTATION block
2018-04-06 11:48:45 +01:00
saichint
1bf29651af fix nxos_acl issues (#38283)
* fix nxos_acl issues

* typo fix

* typo fix in sanity.yaml

* another typo fix in sanity.yaml
2018-04-06 00:57:13 -04:00
Brian Coca
2afb1090b1 allow incremental update for vars in loop for set_fact/include_vars (#38302)
* fix set_fact/include_vars looping

* tests for all behaviours affected

* add tests with injection off/on
2018-04-06 09:57:34 +10:00
Jordan Borean
71e8527d7c powershell: display non-ascii characters in command outputs (#37229) 2018-04-05 14:59:51 -07:00
Jordan Borean
fd4d264253
win_setup: Added connection name to interfaces (#37327) 2018-04-06 07:36:38 +10:00
jhawkesworth
ad94d03ba1 Tolerate win line endings on windows module_util load (#37291)
* tolerate windows line endings when loading windows module utils.  Helpful for old custom windows modules.

* add test modules to demonstrate win line ending module load behaviour.

* attempt to fix sanity check failures

* pep8 fix

* explict skip of test modules from shebang check (core modules must still have expected unix style line endings)

* switch to rstrip() following core team meeting feedback
2018-04-06 07:13:31 +10:00
Ed Costello
0d31d1cd24 [cloud]Add aws_ses_identity_policy module for managing SES sending policies (#36623)
* Add aws_ses_identity_policy module for managing SES sending policies

* Add option to AnsibleAWSModule for applying a retry decorator to all calls.

* Add per-callsite opt in to retry behaviours in AnsibleAWSModule

* Update aws_ses_identity_policy module to opt in to retries at all callsites.

* Add test for aws_ses_identity_policy module with inline policy.

* Remove implicit retrys on boto resources since they're not working yet.
2018-04-05 15:11:12 -04:00
Matt Clay
39aa50022a Fix rpm_key test on Fedora 27. 2018-04-05 08:56:21 -07:00
Andrew Gaffney
8673e1e661 Support for module param defaults (#22648) 2018-04-05 11:44:51 -04:00
Matt Clay
534e9e142b Fix openssl_certificate test for newer openssl. 2018-04-04 14:48:18 -07:00
David Newswanger
0bd2cd4394
added junos_smoke tests (#37216)
* added junos_smoke tests

* enable check mode test

* fix check mode test
2018-04-04 10:46:47 -04:00
David Newswanger
38fa1d0b15
added iosxr_smoke (#37828)
* added iosxr_smoke tests

* finalized netconf tests

* cleaning up files
2018-04-04 10:46:30 -04:00
Matt Clay
980a130f2e
Update aliases on integration tests. (#38258)
* Enable dpkg_selections test.
* Enable vmware_maintenancemode test.
* Enable azure_rm_deployment test.
* Mark aws_waf_web_acl test unsupported.
2018-04-03 23:40:23 -07:00
saichint
b8cb382a40 nxos_acl_interface tests addition (#38230) 2018-04-04 02:07:37 -04:00
Matt Clay
d653d52dd8
Mark unsupported integration tests. (#38251)
* Mark UCS integration tests as unsupported.
* Mark various connection tests as unsupported.
* Mark win_domain_group test as unsupported.
* Mark java_cert test as unsupported.
* Mark synchronize-buildah test as unsupported.
* Mark various AWS tests as unsupported.
* Mark azure_rm_acs test as unsupported.
* Mark GCP tests as unsupported.
2018-04-03 19:04:23 -07:00
Jordan Borean
f37a44430f win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets (#37897)
* win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets

* compare username in lowercase for test
2018-04-03 18:28:10 -07:00
Julien Vey
63a8ae94a7 cloudfront_distribution: fix restrictions (#37476) 2018-04-04 10:26:14 +10:00
Sloane Hertel
873a9ddf8d [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534)
* stabilize ec2_vpc_subnet module

* Add waiters for ec2_vpc_subnet

Clean up integration tests

* Reenable CI for stabilized ec2_vpc_subnet tests

* rename waiters

* Use module_json_aws where applicable

Handle WaiterError first if waiting failed

* Fix traceback when tagging with keys/values that look like booleans

* Fix check mode with tags

* Add integration tests for tags that look like booleans and check mode

* Add waiter for deleting subnet

* Sleep a few seconds after using aws command line
2018-04-03 15:25:00 -04:00
Julien Vey
b000339a31 ec2_instace: fix instance_role argument (#37465) 2018-04-03 11:39:39 -04:00
Martin Krizek
f666208b75
Add integration test for #35900 (#38090)
* Add integration test for #35900

* Fix cleanup
2018-04-03 16:25:51 +02:00
Trishna Guha
119352b538
nxos_vlan purge (#38202)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-03 02:53:44 -04:00
saichint
24cc6b80bd fix nxos_aaa_server_host issues (#38188) 2018-04-03 01:53:43 -04:00
Alex Stephen
d129396274 GCP: Compute IP Addresses (#36325) 2018-04-02 16:42:49 -04:00
Will Thames
423b0e0f58 Improve details and events results for ecs_service_facts (#37983)
* Use AnsibleAWSModule to simplify AWS connection
* Add Exception handling, pagination, retries and backoff
* Allow events to be switched off
* Allow details to be obtained without having to specify services
2018-04-02 11:26:23 -04:00
saichint
697c301f04 fix nxos_aaa_server issues (#38117) 2018-04-02 07:56:06 -04:00
Dag Wieers
800dad5bdf uri: Add redirect tests for none, safe, urllib2 and all (#37068)
This is required if we want to ensure that #36809 doesn't cause any
important behavioral changes.

This PR changes the uri module to support follow_redirects=urllib2

It also adds a better error message when the connection closes before
any data was returned.
2018-03-29 14:54:42 -04:00
saichint
6f2cb28bb9 fix nxos_vlan issues (#38008) 2018-03-29 06:26:33 -04:00
zikalino
2ad7d79985 additional fixes to function app test 2018-03-29 00:10:43 -07:00
Martin Krizek
73d3ed85ef
Fix apt tests (#37922)
* Fix apt tests

* Enable the test in CI

* Additional fixes not discovered locally

* Don't break mysql tests and fix for 14.04 upgrade

* Remove not needed when cond

* Add shebang to fix-udev script

* Remove workaround in favor of rebuilding containers

* Remove leftover script
2018-03-29 08:20:10 +02:00
Will Thames
98b29f8ad6 [cloud]Ensure SGs in default VPCs get default egress rule (#38018)
SGs created when a VPC ID was not specified would not necessarily
get the default egress rule, even when no explicit egress rules
were set.

Add some checks for egress rules in results from existing tests
2018-03-28 12:53:35 -04:00
Abhijeet Kasurde
4edcbeb62d
VMware: Gather facts when powerstate is specified (#37908)
This fix adds additional facts after VM powerstate management.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-28 00:19:33 +05:30
Adrian Likins
6e737c8cb6
Fix 'New Vault password' on vault 'edit' (#35923)
* Fix 'New Vault password' on vault 'edit'

ffe0ddea96 introduce a
change on 'ansible-vault edit' that tried to check
for --encrypt-vault-id in that mode. But '--encrypt-vault-id'
is not intended for 'edit' since the 'edit' should always
reuse the vault secret that was used to decrypt the text.

Change cli to not check for --encrypt-vault-id on 'edit'.

VaultLib.decrypt_and_get_vault_id() was change to return
the vault secret used to decrypt (in addition to vault_id
and the plaintext).

VaultEditor.edit_file() will now use 'vault_secret_used'
as returned from decrypt_and_get_vault_id() so that
an edited file always gets reencrypted with the same
secret, regardless of any vault id configuration or
cli options.

Fixes #35834
2018-03-27 14:12:21 -04:00
saichint
135d343254 fix nxos_udld_interface issue (#37527) 2018-03-27 02:57:14 -04:00
Jordan Borean
b1ac65d95a
win_copy: added fix for win_copy deleting local tmp folder (#37964) 2018-03-27 16:20:10 +10:00
Jordan Borean
68e44e082e
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968) 2018-03-27 16:19:45 +10:00
saichint
63da50e1d8 Integration Tests only: nxos_user (#37852)
* add new integration file to nxos_user

* fix shippable error

* change nxapi to connection

* review comments
2018-03-27 01:41:39 -04:00
Matt Clay
2d0547c411 Disable unstable win_uri test. 2018-03-26 13:43:53 -07:00
saichint
0df5cfd41f fix nxos_static_route issues (#37614)
* fix nxos_static_route issues

* remove nxos_static_route from ignore
2018-03-26 11:13:32 -04:00
Ganesh Nalawade
8eaa9cc938
Fix junos modules check_mode issue (#37311)
Fixes #37208

If check_mode is enabled instead of committing th config need to
discard all the chnages to cnadidate db
In case of cli to discard changes issue `rollback 0` command
and for netconf execute `discard-changes` rpc call
2018-03-26 07:27:30 -04:00
Nate
2c44061a04 append request headers instead of replacing (#37845) 2018-03-26 05:35:41 +10:00
Matt Clay
d502745a4e Disable unstable s3_bucket test. 2018-03-24 11:00:32 -07:00
Matt Clay
2ffbd5554f Disable unstable ec2_group test. 2018-03-24 05:11:19 -07:00
Matt Clay
c7b6a73d41 Disabled unstable ec2_ami test. 2018-03-23 16:49:41 -07:00
Matt Clay
af15a46f20 Disable unstable ec2_vpc_subnet test. 2018-03-23 16:46:42 -07:00
Matt Clay
97942a588a Disable unstable ec2_vpc_route_table test. 2018-03-23 15:44:57 -07:00
zikalino
7284d40049 trying to fix storage blob timing issue 2018-03-23 15:43:27 -07:00
Sam Doran
00068e9fcc
Add integration tests for include_role using variable for tasks_file (#37742)
* Add tests using a variable in tasks_from field

Related to #32503

* Do not test using hostvars with import_role

hostvars cannot be used with import_role — use include_role instead
2018-03-23 15:43:00 -04:00
Alex Tsitsimpis
c3ab6cb9b1 template: Add option to lstrip_blocks' and fix settingtrim_blocks` inline (#37478)
* template: Add integration tests for `lstrip_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Fix passing `trim_blocks' inline

Fix passing `trim_blocks' option to the template module as inline
argument. Previously passing the `trim_blocks' option inline instead of
using the YAML dictionary format resulted in it always being set to
`True', even if `trim_blocks=False' was used.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add option to `lstrip_blocks'

Add option to set `lstrip_blocks' when using the template module to
render Jinja templates. The Jinja documentation suggests that
`trim_blocks' and `lstrip_blocks' is a great combination and the
template module already provides an option for `trim_blocks'.

Note that although `trim_blocks' in Ansible is enabled by default since
version 2.4, in order to avoid breaking things keep `lstrip_blocks'
disabled by default. Maybe in a future version it could be enabled by
default.

This seems to address issue #10725 in a more appropriate way than the
suggested.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add integration tests for `trim_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Check Jinja2 support for `lstrip_blocks'

Since the `lstrip_blocks' option was added in Jinja2 version 2.7, raise
an exception when `lstrip_blocks' is set but Jinja2 does not support it.
Check support for `lstrip_blocks' option by checking `jinja2.defaults'
for `LSTRIP_BLOCKS' and do not use `jinja2.__version__' because the
latter is set to `unknown' in some cases, perhaps due to bug in
`pkg_resources' in Python 2.6.6.

Also update option description to state that Jinja2 version >=2.7 is
required.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
2018-03-23 12:05:21 -04:00
Martin Krizek
00d9345158
apt: mark installed packages manual (#37751)
* apt: mark installed packages manual

* Add fallback for when manual is not a thing
2018-03-23 12:23:12 +01:00
Pierre-Louis Bonicoli
2a7481444b supervisorctl: add integration tests 2018-03-22 15:46:53 -07:00
Toshio Kuratomi
0633f73faf Fix loader for filters (#37748)
* Fix loading of filter and test plugins

Filter and test plugins are different than other plugins in that they
can have many plugins in a single file.  Therefore they need to operate
a little differently.  They need to have all of the potential files
returned.  Then the caller takes care of passing those onto jinja2 in
order for jinja2 to make use of them.

This problem was (most recently) introduced with f921369445

This commit also restructures how we deduplicate plugins to take paths
into account.  If we want to start scoping which set of modules are
loaded (due to roles, for instance) we'll need to hang on to the path
information.

* add integration test for override

* Fix style checks for bcoca code

* Implement jinja2 plugin loader as a subclass

Having a subclass allows us to customize the overriding of jinja
plugins.  We can then move common parts of common code into the Loader.
2018-03-22 17:23:10 -04:00
Sloane Hertel
da3f7a8db1 [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock - fixes #37003 (#37010)
* [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock

Add module warnings rather than silently skipping

* Permit warnings for routes tables containing vpc endpoints to be turned off

* Add tests to ensure a VPC endpoint associated with a route table does not result in a traceback
2018-03-22 15:15:36 -04:00
Matt Clay
f1899f784b Fix docker_secret test on RHEL. 2018-03-22 11:59:41 -07:00
Martin Krizek
296ad80002
apt: allow for integration tests using fake repo (#37639)
* apt: allow for integration tests using fake repo

* Add integration test for 19102

* Clean up packages and repo

* Fix indentation
2018-03-22 19:14:40 +01:00
Martin Krizek
ab1db9bcb8 yum: clean fake repos after tests run (#37770) 2018-03-22 13:19:29 -04:00
Zim Kalinowski
fcd75bbc5a fixing function app test (#37687) 2018-03-21 20:58:28 -07:00
Matt Clay
c7701fd4ac Disable failing azure_rm_securitygroup test. 2018-03-21 20:52:59 -07:00
Zim Kalinowski
fef5f01b11 adding possibility to specify resource group for referred virtual net… (#36768)
* adding possibility to specify resource group for referred virtual network

* fixed sanity issues

* removed trailing whitespace

* added test

* fixed documentation

* try to fix unstable test

* Tidied up the description of virtual_network_resource_group
2018-03-22 12:10:29 +10:00
Zim Kalinowski
0b828ee830 azure_rm_virtualmachine: adding possibility of disabling public ip address (#36766)
* adding possibility of disabling public ip address

* fixed indent

* fixed whitespace

* fixed mistake

* try to create test with vm without public ip address

* try to fix test

* another attempt for test

* fixing test

* create vm with no ip with different name and delete it immediately

* a few additional fixes

* another attempt to pass test

* must be deleted

* simplified no ip test

* reorganised tests

* Wrapped choice in C()
2018-03-22 09:30:42 +10:00
Zim Kalinowski
89401f13f7 azure_rm_networkinterface: fixed issue when public ip address should not be created (#36824)
* fixed issue when public ip address should not be created

* adding test for public ip address

* fixed samples

* another fix to sample formatting

* fixed test

* fix test

* fixed test

* another attempt to fix test

* maybe it works now

* still wrong

* improved check per customer request

* removed stupid semicolon

* updated test to match main scenario

* changed ip configurations to list

* another attempt
2018-03-22 09:16:32 +10:00
Matt Clay
aee01564a9 Clean up non-standard module shebangs. 2018-03-21 11:04:55 -07:00
Abhijeet Kasurde
0ae7a0e88c
VMware: Use environment variable for connection (#37726)
This fix adds environment variables for connection in vmware_*
modules.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-21 13:31:24 -04:00
Matt Clay
8daa80e5bb Move var precedence check to integration tests. 2018-03-21 09:43:32 -07:00
Julien Vey
ec2e027980 cloudfront_distribution: fix the order of headers to avoid updates again and again (#37340)
* Fix python2/3 compatibilities issues

* Sort cloudfront_distribution headers to avoid useless updates
2018-03-21 22:16:42 +10:00
zikalino
fa2ff6ceaa enabling storage blob as it seems that test is stable 2018-03-20 22:53:36 -07:00
Im0
8c4f349743 Test include role with items in name #36372 (#37001)
* Tests for #36372

* Tests for #36372

* Tests for #36372
2018-03-20 15:39:16 -05:00
Aleksander Kovtunenko
f51a6ea832 implemented installroot option (#33613)
* fix

* move version to 2.6
2018-03-20 10:41:50 +00:00
Matt Clay
1fd9a616a4 Fix uri test on Python 2.6. 2018-03-19 23:11:38 -07:00
Julien Vey
26d9de6f3e apt_repository: check attribute repo for None value (#36944) 2018-03-19 10:16:43 -04:00
Ryan Petrello
872a7b4a7a add some Tower module integration tests (and fix a bug or two) (#37421)
* add additional test coverage for tower modules

* add test coverage for the tower_credential module

* add test coverage for the tower_user module

* fix a bug in py3 for tower_credential when ssh_key_data is specified

* add test coverage for tower_host, tower_label, and tower_project

* add test coverage for tower_inventory and tower_job_template

* add more test coverage for tower modules

- tower_job_launch
- tower_job_list
- tower_job_wait
- tower_job_cancel

* add a check mode/version assertion for tower module integration tests

* add test coverage for the tower_role module

* add test coverage for the tower_group module

* add more integration test edge cases for various tower modules

* give the job_wait module more time before failing

* randomize passwords in the tower_user and tower_group tests
2018-03-16 13:28:19 -04:00
Matt Clay
58eb2e849d Disable unstable azure_rm_virtualmachine test. 2018-03-15 13:48:03 -07:00
Martin Krizek
a6d31b6fb1
apt: better error msg when update_cache fails (#37410) 2018-03-15 17:32:25 +01:00
Trishna Guha
957ab02e52
Ensure network_cli nxos test is run only once - remove unnecessary files (#37462)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-15 17:52:54 +05:30
saichint
05b266cc66 fix nxos_udld issues (#37418) 2018-03-15 15:37:46 +05:30
Trishna Guha
dd37857884
fix ios_l2_interface (#37389)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-15 11:33:59 +05:30
Pilou
4378542ac7 Connection error messages are unsafe: wrap them (#37329)
* Check that connection error msg are not unsafe

* Connection error messages are unsafe: wrap them

For example, in case of error, docker connection plugin returns exception
message containing Go template. These messages weren't tagged as unsafe
and were consequently rendered:

The conditional check 'result is failed' failed. The error was:
{
  'msg': u'Docker version check ([\'/usr/bin/docker\', \'version\', \'--format\', "\'{{.Server.Version}}\'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied\n',
  'failed': True
}:
template error while templating string: unexpected '.'.
String: Docker version check (['/usr/bin/docker', 'version', '--format', "'{{.Server.Version}}'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied
2018-03-13 16:20:24 -07:00
Matt Clay
30bb70cf2d Disable failing github_issue integration test. 2018-03-13 15:50:10 -07:00
Deepak Agrawal
a1026dbce5
Eos :do not push config to device if check_mode is enabled (#37287)
* eos can not check config without config session support

* add testcase for check_mode without config session

* fix eos eapi to read use_session env var
2018-03-13 17:13:23 +05:30
saichint
dc61f4c6b1 Fix nxos_vrf issues (#37092)
* fix nxos_vrf issues

* fix doc
2018-03-13 17:08:37 +05:30
Trishna Guha
ba5e562c76
Fix nxos_l2_interface and test typo (#37336)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-13 13:36:38 +05:30
Mike Wiebe
ff57fd0bb4 Fix nxos_switchport (#37328) 2018-03-13 12:03:05 +05:30
Julien Vey
099d8f0b56 route53_zone: enable check mode (#37201) 2018-03-12 14:43:43 -04:00
Ganesh Nalawade
c1008d693c
Fix eos_facts eapi integration test failures (#37301) 2018-03-12 20:12:44 +05:30
Sebastian Gumprich
16c564c4b4 fix spelling mistakes in several modules (#36296)
* fix more spelling mistakes

* fix spelling mistakes
2018-03-12 11:00:19 +01:00
mikedlr
c2a063a5c0 aws ssm parameter lookup - testing and documentation around negative and failure cases (#36550) 2018-03-09 12:30:33 -05:00
David Newswanger
5e827f4cc4
added nxos_smoke tests (#36647)
* added nxos_smoke tests

* add connection information, check length of output

* updated name of task
2018-03-09 09:03:33 -05:00
Ganesh Nalawade
b440544e73
eos_config module exit session gracefully (#37244)
Fixes #36979
If `abort` is not issued in the top level session prompt
the existing session goes to pending state.
The fix is to come out of config mode by issuing `end` command
and again to same config session and execute `abort` which
`abort` is issued at the top level session prompt.
2018-03-09 19:24:23 +05:30
Trishna Guha
2501834c42
add nxos_snapshot test for missing required param (#37248)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-09 17:47:14 +05:30
saichint
74e79d9f5e fix nxos_vrf_af issues (#37211) 2018-03-09 12:20:27 +05:30
Abhijeet Kasurde
c25a42bef6 VMware: New module : vmware_datastore_cluster (#36365)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-08 23:44:15 -05:00
Jordan Borean
708869edd6
win: handle non string as an environment value (#37215)
* win: handle non string as an environment value

* Changed powershell environment handler to use .net function instead for special chars
2018-03-09 08:02:54 +10:00
René Moser
0130490faa
cs_instance: fix py3 user_data base64 (#37135)
* cs_instance: tests: reproduce py3 user_data base64 issue

* cs_instance: fix base64 encoding with py3
2018-03-08 17:05:57 +01:00
Trishna Guha
02999b77a4
fix nxos_switchport/l2_interface trunk_vlans state absent (#37180)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-08 18:10:04 +05:30
Jordan Borean
c1f5e11cdf
win_uri: return response info on non 200 responses, convert DateTime values to ISO 8601 (#37104) 2018-03-08 09:43:42 +10:00
Matt Clay
b4bf502268 Initial Tower module integration test support. 2018-03-07 14:21:55 -08:00
Julien Vey
7c07877b1b s3_bucket: add integration tests (#36941)
Also update testing-policies/storage
2018-03-07 11:25:24 -05:00
Julien Vey
51d491f8f0 route53_zone: move to boto3, and enable comment update (#36641) 2018-03-07 11:16:04 -05:00
rahushen
b7bc61c7df fix nxos_l2_interface tests for fretta (#37086) 2018-03-07 10:15:56 +05:30
saichint
4ed0e5072d fix nxos_vrrp issues (#36930) 2018-03-06 13:36:50 +05:30
Ganesh Nalawade
ba3201cd2f
Fix eos integration test failures (#37020)
Fixes #36919

Fix other eos modules integration test failure in dci
2018-03-06 10:04:40 +05:30
msven
a2b3120e85 ec2_asg: fix #28087 and #35993 (#36679)
Fixes #35993 - Changes to update_size in commit eb4cc31 made it so
the group dict passed into update_size was not modified. As a result,
the 'replace' call does not see an updated min_size like it previously
did and doesn't pause to wait for any new instances to spin up. Instead,
it moves straight into terminating old instances. Fix is to add batch_size
to min_size when calling wait_for_new_inst.

Fixes #28087 - Make replace_all_instances and replace_instances behave
exactly the same by setting replace_instances = current list of instances
when replace_all_instances used. Root cause of issue was that without lc_check
terminate_batch will terminate all instances passed to it and after updating
the asg size we were querying the asg again for the list of instances - so terminate batch
saw the list including new ones just spun up.

When creating new asg with replace_all_instances: yes and lc_check: false
the instances that are initially created are then subsequently replaced.
This change makes it so replace only occurs if the asg already existed.

Add integration tests for #28087 and #35993.
2018-03-05 11:47:31 -05:00
Guillaume Coré
daeec920b0 ini_file: add allow_no_value param (#24442) 2018-03-05 17:05:41 +01:00
Nathaniel Case
7016b3b9ca
ios_static_route idempotence fix (#35912)
* Remove default admin_distance and fix the idempotence thereof

Fixes #33290

* Fix tests and use yaml anchors to shorten tests

* Add test for undefined admin_distance

* Read config from `show run` if `show ip static route` fails

* Restore flags to ios.get_config &  use get_config where appropriate
2018-03-05 09:28:37 -05:00
René Moser
6578403288
cs_zone_facts: implement return facts as ansible returns (#36993) 2018-03-05 11:42:38 +01:00
Abhijeet Kasurde
d1eb4fe58c
VMware: Refactor vmware_target_canonical_facts (#36964)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-04 10:20:47 +05:30
Abhijeet Kasurde
3a161fa157
VMware: new module : vmware_datastore_maintenancemode (#36436)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-02 23:35:53 +05:30
Ganesh Nalawade
83c3561ee5
Enable eapi integration test for eos modules (#36934) 2018-03-02 12:39:00 +05:30
Ganesh Nalawade
5c2a1a6124
Fix eos_vrf integration test failures (#36893) 2018-03-01 13:05:39 +05:30
Abhijeet Kasurde
0694aca2a0
VMware: refactor configure disk logic (#36617)
This fix corrects logic related to disk parameters.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-01 09:36:54 +05:30
Ed Costello
645952c139 Add aws_caller_facts module and use it in setup-iam.yml (#36683)
* Add aws_caller_facts module and use it in setup-iam.yml

This removes the dependency on having the command line AWS tools
installed.
2018-02-28 16:30:34 +10:00
saichint
db43fe6a76 nxos_facts fix and integration tests (#36796)
* fix nxos_facts ipv6 error

* time_range not supported for N35
2018-02-28 10:45:50 +05:30
Abhijeet Kasurde
8d49bb6eee
VMware: new module: vmware_host_capability_facts (#36497)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-02-28 09:54:52 +05:30
Abhijeet Kasurde
87d6bdaf98
VMware: Re-enable VM poweroff testcases (#36734)
This testcases were failing due to vcsim version.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-02-27 09:04:42 +05:30
nwsparks
e15a903bdf Win lineinfile fix (#35100)
* win_lineinfile: fix #33858. Removed conversion from \r\n

* win_lineinfile: added test for #33858

* win_lineinfile: added documentation and more tests for change

* win_lineinfile: fixed wrong hash in testing
2018-02-26 19:34:44 -05:00
René Moser
cdb2969703
cs_sshkeypair: fix ssh key rename (#36726)
* tests: cs_sshkeypair: add reproducer for failed key rename

* cs_sshkeypair: fix rename ssh key
2018-02-26 13:43:40 +01:00
Martin Krizek
54e9096950
Add integration test for #36534 (#36581) 2018-02-26 09:49:25 +01:00
Abhijeet Kasurde
d94a1ef4cc
VMware: refactor vmware_datastore_facts (#36423)
This fix adds datastore cluster details about datastore in returning
facts. Updated documentation and tests.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-02-26 13:23:22 +05:30
Trishna Guha
44332bda78
fix nxos_vlan aggregate (#36710)
* fix nxos_vlan aggregate

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

* Add test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-26 12:29:49 +05:30
Ganesh Nalawade
5a6b893240
Decouple config and state check in vlan and vrf network modules (#36386)
* Decouple config and state check in {network_os }_vlan and { network_os }_vrf modules

Fixes #35567
Fixes #34754

`interfaces` option is used for configuration as well as operational state
check. If interface is configured to given vlan or vrf but if
operational state of interface is disabled it results in module failure.

Fix is to decouple same option usage for config and state.
With this fix `interfaces` is used as config option and a new
option named `associated_interfaces` will be used for intent check
for assigned interfaces.

* Fix CI failures

* Fix review comment

* Fixed integration test failure
2018-02-26 09:23:54 +05:30
Matt Clay
f283edcb19 Temporarily disable subversion test on osx. 2018-02-24 13:46:40 -08:00
Chris Houseknecht
53cfd70b7d
Adds k8s_raw, openshift_raw tests (#36228) 2018-02-23 10:13:09 -05:00
Jordan Borean
ef4f8851dc
win_feature: better error handling to make it easier to debug issues (#36491)
* win_feature: better error handling to make it easier to debug issues

* removed ignroed pslint rules that are no longer needed
2018-02-22 11:33:48 +10:00
Dag Wieers
430088c6f0
aci_interface_policy_leaf_policy_group: Fix test (#36551) 2018-02-21 23:48:10 +01:00
Sam Doran
723daf3e3a
Check for regexp match when using insertbefore or insertafter (#36474)
Add tests to cover this scenario
Fixes #36156
2018-02-21 17:03:38 -05:00
Bruno
afdd748f4c changed cisco mail to normail hotmail (#36546) 2018-02-21 23:01:26 +01:00
Bruno
53125d37d1 add aci_static_binding_to_epg integration tests (#36542) 2018-02-21 21:45:38 +01:00
Dag Wieers
51ba115dea
aci_domain_to_encap_pool: Remove integration tests (#36535) 2018-02-21 20:33:23 +01:00
Toshio Kuratomi
03a6d72633 Revert "remove query/q (#36315)"
This reverts commit b47d2e07e1.

query is a feature for 2.5.  We're not reverting it now.
2018-02-21 10:37:51 -08:00
Dag Wieers
7435e115e0
ACI: Various changes to module documentation and guide (#36516)
* ACI: Various changes to module documentation and guide

This PR includes:
- We moved the object class information to the notes
- Add version information to guide chapters
- Add generic note to modules with reference to ACI guide
- Reference known issues in aci_rest documentation
- Remove module_utils function docs from modules
- Indicate which parameters are not required for querying all objects
- Added missing RETURN information

* Fix copyright strings

* Remove aci_domain_to_encap_pool.py for v2.5

* More updates

* PEP8 fix

* Improve listings of parameters/return values
2018-02-21 19:35:59 +01:00
Brian Coca
b47d2e07e1
remove query/q (#36315)
* remove query/q

remove and fixed tests for removed func

* paren fix
2018-02-21 10:42:54 -05:00
Martin Krizek
9fced4f0a9
Add integration test for #36430 (#36432) 2018-02-21 16:16:02 +01:00
Sloane Hertel
f7d79d4789 [cloud] Retry WAF actions on WAFStaleDataException (#36405)
Add a util to run functions with AWSRetry to retry on WAFStaleDataExceptions and update ChangeToken for each attempt
2018-02-21 08:14:17 -05:00
mikedlr
52f2057472 aws ssm parameter lookup - change to return Nones for missing variables (#36456)
* aws ssm parameter lookup - change to return Nones for missing variables

* aws ssm parameter lookup - fix error case message to dump response

* aws ssm parameter lookup - fix integration test cases
2018-02-21 06:50:00 -05:00
Jordan Borean
df8a5d7a4f
fetch: set fail_on_missing: True as default as per docs (#36469)
* fetch: set fail_on_missing: True as default as per docs

* Updated docs for fetch to say behaviour was changed in 2.5 and updated tests
2018-02-21 18:10:23 +10:00
goshkis
abb956d9eb vApp properties support (#32579)
* Adding support for vApp properties.
* vm specification updated only if changes have to be applied. I.e. subsequent updates with the same data will not trigger changed state
* Auxiliary variables renamed, hope this makes the code more readable
* Integration tests changed - re-adding the same properties test not implemented, but tested on real vCenter deployment
* fixing documentation "version_added" for the feature
* Addressing reviewers comments #2:
* documentation updated with the only meaningful value for "option" attribute - "remove"
* Fixed improperly handled case when user requested "add" operation for existent property
* vApp configuration is updated only with properties that contains changes, not with all properties requested by user
2018-02-21 11:59:13 +05:30
saichint
47a92386c9 fix nxos_bgp_neighbor_af issues (#36472) 2018-02-21 10:20:24 +05:30
Dag Wieers
5635c50f9b
aci_iplpg: Various fixes to integration tests/module (#36460) 2018-02-21 00:20:38 +01:00
Dag Wieers
1720a210e9
aci_spvpg: Various fixes to integration tests/modules (#36458)
* aci_spvpg: Various fixes to integration tests/modules

This PR includes:
- A fix in module_utils aci.py
- Various fixes in integration tests

* Fix typo
2018-02-20 22:49:55 +01:00
Bruno
7143cf54bc added aci_vpc_protection_group integration test (#36448)
added aci_switch_policy_vpc_protection_group integration test
2018-02-20 20:42:08 +01:00
Trishna Guha
3d06ce245a
fix vyos_l3_interface adding multiple addresses to interface (#36377)
* fix vyos_l3_interface adding multiple addresses to interface

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

* add test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-02-20 20:54:27 +05:30
Bruno
4a6d837879 added aci_fabric_node integration test (#36422)
* added aci_fabric_node integration test

* Update main.yml
2018-02-20 15:06:41 +01:00