Commit graph

5443 commits

Author SHA1 Message Date
Jordan Borean
2af36412f9
runas + async - get working on older hosts (#41772)
* runas + async - get working on older hosts

* fixed up sanity issues

* Moved first task to end of test for CI race issues

* Minor change to async test to be more stable, change to runas become to not touch the disk

* moved async test back to normal spot
2018-06-26 14:40:49 +10:00
Sam Doran
4b5b4a760c
Account for empty string regexp in lineinfile (#41451)
* Use context managers for interacting with files

* Account for empty string as regexp

Rather than explicitly testing for None, also test for an empty string which will evaluate to False. An empty string regexp matches every line, which ends up replacing the incorrect line.

* Store line parameter in a variable

* Add tests
2018-06-25 17:57:05 -04:00
Sam Doran
eaae1318f8
Skip if insertbefore BOF until later (#41767)
If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF.

Add tests for this scenario.
2018-06-25 16:24:41 -04:00
Jordan Borean
9b7b564d75
Stop displaying kinit pass input on a failure (#41882)
* Stop displaying kinit pass input on a failure

* Fixed up minor logic info and added tests
2018-06-26 05:49:19 +10:00
Martin Krizek
a8d4bf8642
Fix rabbitmq_* integration tests (#41836) 2018-06-25 21:29:45 +02:00
Dennis Benkert
28d0a173db [aws] add limit on number of CloudFormation stack events fetched by cloudformation module (#41840)
* Add a module parameter to configure the max fetched AWS CFN stack events
* Add version documentation for new configuration option
* Increase default in order to make sure that enough are fetched by default. This align roughly with the limit of manageable resources in CloudFormation.
2018-06-25 12:39:32 -04:00
Ganesh Nalawade
773c031d33
vyos and ios cliconf plugin refactor (#41846)
* vyos and ios cliconf plugin refactor

*  Refactor vyos cliconf plugin
*  Change vyos module_utils and vyos_config as per refactor
*  Minor changes in ios cliconf plugin

* Fix unit test failure

* Fix sanity issues

* Add get_diff to rpc list
2018-06-25 09:43:37 +05:30
Jordan Borean
2e46688bca
win_chocolatey: always return the rc return value (#41883) 2018-06-25 08:23:31 +10:00
David Passante
f30e0b833d cloudstack: new module cs_disk_offering (#41795) 2018-06-23 01:15:26 +02:00
Nathaniel Case
9aa8c652ba
Netconf bytes fixes (#41607)
* Solve some bytes issues on iosxr

* Solve some bytes issues in junos

* Do the correct thing with tostring based on lxml or not
2018-06-22 11:50:44 -04:00
Sijis Aviles
ba3db90e3a Fix: wildcard excludes in unarchive with tar archives (#40935)
* fix: exclude using wildcards for tar archives

Fixes #37842, #22947

* fix: Remove quote() as it munges the exclude format

* test: Refactor to use single archive structure

A common structure archived by different methods should simplify some of
the feature tests.

* test: Use common archive layout to validate exclude feature

* test: Use the same exclude checks for zip/tar archives
2018-06-22 08:28:14 -07:00
Olivier Bourdon
06b73ff8f1 Add random_mac string filter (#39775)
Add new filter to generate random MAC addresses from
string prefix. See docs/docsite/rst/user_guide/playbooks_filters.rst
for more detailed infos.
2018-06-21 15:56:54 -05:00
Matt Clay
5880404151 Disable remaining failing rabbitmq_* tests. 2018-06-21 13:50:36 -07:00
Brian Coca
27c43daab8
fix minor issues with debug and item labels (#41331)
* fix minor issues with debug and item labels

 - no more `item=None`, we always have a label now
 - debug should only show expected information, either msg= or the var in var=
 - also fixed method name, deprecated misleading _get_item
2018-06-21 16:14:57 -04:00
Matt Clay
00ab12dca2 Disable failing rabbitmq_plugin test. 2018-06-21 12:52:06 -07:00
Andrea Tartaglia
a342538aba Add shell out checks (#41545)
* Added error codes for shell_out checks

* Added ignore lines for allowed Modules

* Added shell out checks

* Fixed pep8

* Updated regex to only match subprocess.Popen

* Added failing modules to ignore.txt

* Wrong postgresql module in ignore.txt

* Removed bigip from ignore.txt
2018-06-21 11:58:39 -04:00
Loïc
b61b113fb9 new provider: ownca (#35840) 2018-06-21 12:41:00 +05:30
Sloane Hertel
c4a6bce69f ecs_service: make assign_public_ip option a boolean (#41759) 2018-06-21 12:17:01 +10:00
Jordan Borean
11bd3fd318 win_updates fix when win_updates is run with async (#41756) 2018-06-20 14:52:24 -07:00
Abhijeet Kasurde
27b85e732d Argument spec must be dict/hash (#40858)
validate-modules should fail when argument is not dict/hash.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-06-20 12:05:49 -04:00
Deepak Agrawal
e91cee1a31
net_put module: add default mode to copy binary files (#41476)
* add default mode to copy binary files

* sanity fix

* add version for new options
2018-06-20 16:02:49 +05:30
Kevin Breit
543a7469b7 New module - meraki_switchport (#41634)
* Initial commit for meraki_switchport module
- Query or modify swichport configurations
- Further optimizations are available
- Integration tests will require manual editing of file for others

* Remove blank lines
2018-06-20 09:48:30 +02:00
Kevin Breit
b8c39a0875 New module - meraki_config_template (#41633)
* Implement configuration template management
- Queries or removes templates
- Can bind or unbind templates to networks
- Module is idempotent only for binding and unbinding
- Meraki does not allow template creation via API
- Integration test is tedious b/c previous bullet point
- Fixed bug in construct_path() so it won't set self.function

* PEP8 changes

* Re-enable some integration tests, use variables, and fix broken code
2018-06-20 09:47:31 +02:00
Kevin Breit
618c3c508f New module - meraki_vlan (#41632)
* Initial commit of meraki_vlan module
- Create, delete, modify, and query VLANs within a network
- Support for all allowed objects in the VLAN data structure
- Meraki defaults networks to have VLANs disabled and there is no
way to use the API to enable VLAN support. It must be enabled
manually.

* Fix formatting error in documentation

* Formatting changes and added documentation

* PEP8 fix
2018-06-20 09:46:15 +02:00
Kevin Breit
7c888b86ba New module - meraki_device (#41631)
* Initial commit for meraki_device module
- Allow claiming, removal, updating, and querying of devices
- Integration tests are included
- Integration tests are not complete because physical gear is required
- Integration tests also require Meraki subscriptions

* Added support for serial number query without network

* Added support for net_id and net_name

* Changes recommended by ansible-test for PEP8 and documentation

* Remove duplicate state in example

* Fix typo
2018-06-20 09:44:50 +02:00
Kevin Breit
564fe87b29 Improve support for org_id in module (#41519)
- Faster performance since it reduces number of API calls
- Also simplified some of the execution
2018-06-20 09:41:53 +02:00
Kevin Breit
cccaf951fa Improved support for parameter testing and checks for org_id (#41517) 2018-06-20 09:40:10 +02:00
Kevin Breit
4a0b8f5123 Added support for passing org_id instead of org_name (#41518)
- Faster execution if passed instead of org_name
- Updated documentation
- Added additional integration tests
2018-06-20 09:39:25 +02:00
Matt Clay
dce708e63e Temporarily disable gem test on osx.
Disabled due to lack of newer TLS version support on the test system.
2018-06-19 16:58:12 -07:00
Sloane Hertel
1268ce4d4f [ecs_service] fix assign_public_ip network configuration to module parameter rather than fixed string (#41689)
Fix parameter name

Use suboptions

document suboptions

Add a test to assert assign_public_ip is configurable
2018-06-19 14:35:53 -04:00
Nilashish Chakraborty
837c216587
Fix vyos_vlan aggregate issue & added tests (#41638)
* Fix vyos_vlan aggregate issue & Added tests

* Fix #2 for vyos_vlan aggregate issue
2018-06-19 18:50:28 +05:30
Deepakkothandan
5a72eef0a3 [ecs_service] fix assign_public ip for network configuration (#41685)
* fix assign_public ip for ecs_service

* used module.botocore_at_least instead of distutils
2018-06-19 08:46:40 -04:00
Tim Rupp
6c654b6947
Fixes the default assignment of values (#41672)
Fixes: #41640

The defaults should be inherited from the parent during initial
creation. This patch fixes that.
2018-06-18 16:06:13 -07:00
Markos Chandras
1737b7be3e facts: suse: Fix major version detection for SUSE (#41416)
When parsing the distribution files such as /etc/os-release, we extract
the full distribution version but not the major version. As such, the
ansible_distribution_major_version ends up being 'NA' whereas the
ansible_distribution_version contains the full version.

Before this patch we get this on openSUSE Leap 15

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

After this patch we get this

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

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

Fixes: #41410
2018-06-18 09:53:50 -04:00
Tim Rupp
16466f3171
Fixes usage of popen in bigip iapplx package (#41612)
This functionality is superceeded by the run_command method in the
ansible module class.
2018-06-15 15:41:57 -07:00
Matt Davis
b01779ad18
skip winrm unit tests if winrm is not installed (#41596) 2018-06-15 10:23:15 -07:00
Sharp Hall
3935cce394 docker: Allow publishing of ports with the same number but different protocol (#38412)
* Don't deduplicate docker container ports with different protocols

* Test _parse_exposed_ports
2018-06-15 12:36:20 -04:00
Andreas Calminder
75e9b76c15 accept + and - modifiers for file attributes (#40061)
* accept + and - modifiers for file attributes
* tests for adding/removing file attributes
2018-06-14 06:31:14 -07:00
Trishna Guha
8ab0d654f3
don't retrieve config in running_config when config is provided for diff (#41400)
* don't retrieve config in running_config when config is provided for diff

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

* fix for eos, nxos

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

* add integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-06-14 18:02:19 +05:30
saichint
79dd206b3e fix reload smu issue (#41270)
* fix reload smu issue

* review comments
2018-06-14 09:17:33 +05:30
Ben Berry
32c191ee9c expand user before calling abspath (#40196)
* expand user before calling abspath

* omit expanduser code smell check for volumes
2018-06-13 21:18:02 -04:00
Zim Kalinowski
5b0bb91c72 reappied changes in a new pr (#41228) 2018-06-13 15:42:29 +08:00
Matt Clay
d6ba139713 Disable failing acme_account integration test. 2018-06-12 18:06:47 -07:00
Toshio Kuratomi
a5fd86cf6d Tasks that are expected to fail need to begin with a special string 2018-06-12 16:31:10 -07:00
Brian Coca
336b3762b2 no_log even when task_result doesn't provide key
- now also checks task property
 - added reproducer to tests for unreachable status on item loop
2018-06-12 10:25:30 -07:00
Matt Martz
ad0827e5c0
When using ANSIBLE_JINJA2_NATIVE bypass our None filtering in _finalze (#41408)
* When using ANSIBLE_JINJA2_NATIVE bypass our None filtering in _finalize. Fixes #41392

* Add tests for _finalize bypass

* Address python3 failures in tests
2018-06-12 08:46:23 -05:00
Zim Kalinowski
e9214725fb more integration test improvements (#41184) 2018-06-12 10:52:07 +08:00
Pilou
5d7afe9d95 Default squash actions add pip (#41390)
* pip tests: remove trailing spaces

* pip tests: use Jinja tests

* fixup! pip tests: remove trailing spaces

* pip tests: use 'command' instead of 'shell' module

* pip tests: remove unused variable

* pip tests: use a package with fewer dependencies

sampleproject has one dependency: 'peppercorn' and peppercorn doesn't
have any dependency.

* pip tests: check that 'name' param handles list

* pip: squash package parameters

Note that squashing will be removed in 2.11, new code should directly
use a list with the 'name' parameter.
2018-06-11 19:58:13 -04:00
Adam Miller
bea3baf94d
Revert "Revert "Remove VC scaleway (#40791)" (#41401)" (#41402)
This reverts commit 391509006c.
2018-06-11 11:22:12 -05:00
Adam Miller
391509006c
Revert "Remove VC scaleway (#40791)" (#41401)
This reverts commit 007127ea27.
2018-06-11 11:19:29 -05:00
Rémy Léone
007127ea27 Remove VC scaleway (#40791) 2018-06-11 11:19:08 -05:00
Shinichi TAMURA
bcd6b5c6f8 BSDTimezone: distinguish UTC and Etc/UTC (#41234)
* Fixed BSDTimezone to distinguish UTC and Etc/UTC

* Added test for timezone to disinguish UTC vs Etc/UTC
2018-06-11 10:27:50 -04:00
Abhijeet Kasurde
c021fd8e84 VMware: Allow user to select disk_mode (#38951)
* VMware: Allow user to select disk_mode

This fix allows user to select disk modes for given disk configuration
in the given VM.

Fixes: #37749

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

* Review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-06-10 22:37:30 -04:00
Matt Martz
76867730bf
Don't ignore a duplicate host for an already processed include (#40361)
* Don't ignore a duplicate host for an already processed include, assume that the repetition indicates a new include. Fixes #40317

* Add intg tests to ensure duplicate items in loop are not deduped

* Add note about relative indexing
2018-06-08 15:36:22 -05:00
Thierry BOUVET
8b9fe42c72 Add new module to create/update a docker swarm. (#38280)
* Add new module to create/update a docker swarm.

* Fix ansible-test sanity

* Fix requirements

* Fix requirements

* Add tag for author

* Test integration test.

* Fix main.yml

* Add linux arch

* Add template

* Fix test result

* Integration test to create/remove a swarm manager

* fix join test

* Downgrade docker-py

* fix rhel

* Fix review documentation.

* Fix whitespace

* Check docker installation.

* test docker install

* check

* Remove docker socket

* Fix docker install

* Fix sanity test

* Rebase

* Add docker_swarm maintainer

* Fix review

* Fix new version.

* Add docker default values

* Fix description.

* Reworked documentation

* Fix YAML error

* Rebase

* Fix example for update state.

* Fix idempotent states. Fix states: present/absent.

* Fix sanity

* Fix variables sanity

* Update example for absent state.

* fix sanity

* Wrap the contents of error message in to_native.


Co-authored by: Dag Wieers <dag@wieers.com>
2018-06-08 10:45:09 -04:00
Ganesh Nalawade
1ce484831b
Fix junos_config integration test (#41304)
*  Change the ip address in fixture files
   as per PR #40554
2018-06-08 13:16:47 +05:30
Sloane Hertel
89cea78e30 Fix async for aws_s3 - fixes #40281 (#40826)
* Fix async for aws_s3

* Add a test that async is able to be used on aws_s3 tasks
2018-06-07 15:09:22 -04:00
Will Thames
46886f8249 Improve aws_s3 permission handling for non S3 (#38574)
* Test case for missing permissions

* Update aws_s3 module to latest standards

* Use AnsibleAWSModule
* Handle BotoCoreErrors properly
* Test for BotoCoreErrors
* Check for XNotImplemented exceptions (#38569)

* Don't prematurely fail if user does not have s3:GetObject permission

* Allow S3 drop-ins to ignore put_object_acl and put_bucket_acl
2018-06-07 13:13:10 -04:00
Andrew Gaffney
0ff04ad41b Fix wrong python keyword (followup to #36357) (#41067)
Also add tests around that code path
2018-06-07 19:48:07 +05:30
Matt Martz
c403f01971
Revert #39365, improve error messaging (#41208)
* Revert " Update TaskInclude _raw_params with the expanded/templated path to file (#39365)"

This reverts commit 4b01b92cfe.

* Improve error messaging, catch error templating parent path
2018-06-07 09:00:50 -05:00
Will Thames
b235cb8734 aws_eks_cluster: New module for managing AWS EKS (#41183)
* aws_eks: New module for managing AWS EKS

aws_eks module is used for creating and removing EKS clusters.

Includes full test suite and updates to IAM policies to enable it.

* Clean up all security groups

* appease shippable

* Rename aws_eks module to aws_eks_cluster
2018-06-07 08:44:04 -04:00
Deepak Agrawal
12be102758
DCI failures (#41241) 2018-06-07 15:55:03 +05:30
Trishna Guha
34e4071eca
increase timeout for connection reset by peer issue with httpapi (#41224)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-06-07 12:46:51 +05:30
Zim Kalinowski
bc690df11e using lighter resource (#41223) 2018-06-07 14:11:00 +08:00
Jordan Borean
ad8e13e9f8
winrm: fix up unit tests (#41112) 2018-06-07 06:09:10 +08:00
Kevin Breit
2be2a572d6 Meraki utility now loads() JSON (#40856)
* Changed request() to run json.loads() instead of module doing it
- Removed json.loads() from modules
- Removed some unreliable integration tests
- Removed self.function setting in construct_path()
-

* PEP8 changes

* Remove debug line for push
2018-06-06 18:24:14 +02:00
Deric Crago
ba848e018c bump version of 'vcenter-test-container' to '1.3.0' (govmomi v0.18.0) (#41151)
* leave vmware_guest_powerstate tests enabled, but revert changes from: 66743f33
* leave VM poweroff tests enabled, but revert changes from: 87d6bdaf
* bumped 'vcenter-test-container' version to '1.3.0'
* updated test task names based on PR feedback
2018-06-06 08:24:21 -07:00
Will Thames
f61164406e [aws] Support custom KMS keys in aws_s3 module (#35761)
* Allow the use of 'aws:kms' as an encryption method
* Allow the use of a non standard KMS key
* Deduce whether AWS Signature Version 4 is required rather than specifying with a parameter
2018-06-06 11:22:52 -04:00
Will Thames
a60fe1946c Remove ECS policies from AWS compute policy
The compute policy was exceeding maximum size and contained
policies that already exist in ecs-policy.

Look up suitable AMIs rather than hardcode

We don't want to maintain multiple image IDs for multiple regions
so use ec2_ami_facts to set a suitable image ID

Improve exception handling
2018-06-06 20:51:50 +10:00
Michael Mayer
fbcd6f8a65 Add Fargate support for ECS modules
Fargate instances do not require memory and cpu descriptors. EC2 instances
 do require descriptions. https://botocore.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.describe_task_definition

Fargate requires that cpu and memory be defined at task definition level.
EC2 launch requires them to be defined at the container level.

Fargate requires the use of awsvpc for the networking_mode. Also updated,
the documentation regarding where and when memory/cpu needs to the assigned.

The task_definition variable for the awspvc configuration colided with
the ecs_service for the bridge network. This would cause the test to fail.

Add testing for fargate

Add examples for fargate and ec2
2018-06-06 20:51:50 +10:00
Martin Krizek
77e2bd5f8e
Fix inserting noop tasks by using active state (#36056) 2018-06-06 12:34:25 +02:00
David Moreau Simard
828e33f419 Do not consider an empty version string as a version (#41044)
When using an empty string as the version argument, the module would
before attempt to run something akin to:

    pip install module==""

This changes the behavior to:

    pip install module

Fixes #41043
2018-06-06 09:52:43 +02:00
Ganesh Nalawade
ba4b12358c
Refactor ios cliconf plugin and ios_config module (#39695)
* Refactor ios cliconf plugin and ios_config module

*  Refactor ios cliconf plugin to support generic network_config module
*  Refactor ios_config module to work with cliconf api's
*  Enable command and response logging in cliconf pulgin
*  cliconf api documentation

* Fix unit test and other minor changes

* Doc update

* Fix CI failure

* Add default flag related changes

* Minor changes

* redact input command logging by default
2018-06-06 11:12:45 +05:30
saichint
9abc3dbec4 nxos_rpm module (#40849)
* Add nxos_rpm feature

* fix timing issues

* fix timing issues

* shippable fix

* review comment

* review comments fixes

* typo fix
2018-06-06 10:09:38 +05:30
Matt Clay
70c475da6c Implement new changelog generator. 2018-06-05 19:08:15 -07:00
Matt Davis
980cdbe679 pin azure deps to exact versions
* added warnings for newer-than-expected versions
* prevent passing api_version and profile for newer clients
2018-06-05 18:50:48 -07:00
Nathaniel Case
02135d5278
Nxos test reorganize (#41089)
* Remove local from most cli tests

* Readd local tests to nxapi until httpapi passes
2018-06-05 07:37:24 -04:00
Andrew J Huffman
fb61680ccd Updating tower_job_template.py (#38821)
* Updating tower_job_template.py

* tower_job_template: Update parameter version_added to 2.7

* Ensure that unset credentials aren't passed

Passing empty strings for unset credentials causes ValueErrors as
the API expects an integer. Don't pass unset credentials
2018-06-05 15:33:51 +10:00
Adrien Fleury
fc2c8a4ec8 Module: Tower inventory source module (#37110)
* tower_inventory_source: Add support for the inventory source via ansible-tower-cli.

* Add test coverage for tower_inventory_source.

* Update version_added to 2.7
2018-06-05 15:32:54 +10:00
saichint
6733bffd5d fix nxos_snapshot issues (#41034)
* fix nxos_snapshot issues

* review comments

* doc change
2018-06-05 10:56:32 +05:30
Deepak Agrawal
2db6a8c26a
iosxr_config crash if config has route-policy with multiple levels of 'ifelseif' and other caveats (#41091)
* diff in as-path-set or prefix-set

* fix caveat diff can not have last line with comma in prefix-set/as-path/community-set

* Simplify fix to include indentation before parse

* remove debugger

* route-policy diffs

* fix iosxr_config crash issue

* new changes in iosxr_config after git add

* end-policy-map and end-class-map are properly indented so match misplaced children only when end-* is at the beigining also fix pep8

* Remaining config blocks of route-policy which needs exclusion from diff. added new tests

* pylint/pep8 warnings

* Review comments , sanity test fix

* shbang warning

* remove unused import
2018-06-05 07:56:53 +05:30
Nathaniel Case
92a95368fe
Fixes to ios_logging (#41029)
* Logging size may not show up in config

* This is much simpler

* Avoid repetition in tests

* Both options of buffered are optional
2018-06-04 07:32:23 -04:00
Abhijeet Kasurde
4d200fb5ac
Use msg instead of var (#40810)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-06-04 12:46:23 +05:30
Zhikang Zhang
b578bf9e20 Fix test-module failing to validate args (#41004)
* Fix test-module failing to validate args

The test-module pass a wrong argument _ansible_tmp cause the validation failed.
Change the argument _ansible_tmp to _ansible_tmpdir to fix this.

* Add a integration test for test-module.

Prior to this change, we don't have a test for test-module.

This change ensure the correctness of test-module script.
2018-06-01 12:02:56 -07:00
Matt Martz
d4930e6692
Add requests.Session like class (#37622)
* Adds requests.Session like class

* py2 syntax fix

* Add a few examples to the Request docstrings

* Add helper methods and docs

* Fix test failures

* Switch tests to test Request instead of open_url, add simple open_url test to validate funcitonality

* Fix filename in replace-urlopen code smell test
2018-06-01 11:44:20 -05:00
Matt Martz
da4ff18406
Support 'apply' to apply attributes to included tasks - Impl 1 (#39236)
* Support 'apply' to apply attributes to included tasks

* Cannot validate args for task_include

* Only allow apply on include_

* Re-enable arg validation, but only for include_tasks and import_tasks

* s/task/ir/

* Add tests for include_ apply

* Include context with AnsibleParserError

* Add docs for apply

* version_added

* Add free-form documentation back

* Add example of free-form with apply
2018-05-31 12:08:38 -05:00
Matt Martz
961484e00d
Add src parameter for uri module that can be used in place of body. Supports binary files (#33689)
* First pass at a src parameter that can be used in place of body. Supports binary files

* Add test for uri src body

* Bump version_added to 2.6

* Close the open file handle

* Add uri action plugin that handles src/remote_src

* Document remote_src

* Remove duplicate info about remote_src

* Bump version_added to 2.7
2018-05-31 11:43:00 -05:00
Nathaniel Case
e7afd3d378
Search for macaddresses more stringently (#40901)
* Search for macaddresses more stringently

Fixes #40829
2018-05-31 10:45:17 -04:00
Nilashish Chakraborty
a013cdc747
Fixes ios_logging idempotency issues (#40701)
* Fixes ios_logging idempotency issues

* Added intergration tests & minor fixes

* Minor fixes in tests

* Minor fixes in tests #2

* eos_logging fixes after PR review
2018-05-31 20:07:24 +05:30
James Mighion
083ddb9bc2 Adding changed option to save_when for aireos (#40681)
* Adding changed option to save_when for aireos

* Deprecating save option for aireos_config.

* Updating version_added to 2.7 since the PR missed the window for 2.6
2018-05-31 10:35:12 -04:00
jctanner
a9e53cdb68 Allow config to enable native jinja types (#32738)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
2018-05-31 10:38:29 +02:00
Sumit Jaiswal
81510970ae
Fix for updating the name in case of host record and network view and also display meaningful error in case of connection timeout (#40597)
* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* To fix following github issues 35774, 36574 and 39494

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* removed old_name new entry to make ui cleaner

* to resolve the bug 40709

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* reslove shippable error

* to fix shippable nios automation error

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* modified the name input parsing method

* shippable error fix

* shippable error fix

* shippable error fix

* shippable error fix

* shippable error fix

* review comment fix

* shippable error fix

* shippable error fix
2018-05-31 12:25:15 +05:30
Matt Martz
ad7ba91f75 Use _remote_is_local=True for local connection in synchronize (#40833)
* All instances of local connection should use _remote_is_local=True. Fixes #40551

* Switch to instance attribute for synchronize

* Add test that shows that synchronize _remote_is_local addresses tmpdir building
2018-05-30 13:28:11 -07:00
Fabian von Feilitzsch
4d77878654 K8s dynamic collected changes (#40745)
* Move k8s modules to dynamic backend

* update required openshift version

* update -> patch

* use new dynamic client exceptions

* style

* guard urllib3 import

* guard ansibleerror import

* give more information about error cause

* format in variable

* style

* rename tests

* Search for provided kind in a few more places to match old behavior, properly handle failure

* make common code use fail instead of fail_json, to work for lookup plugins as well

* update docs

* move openshift_raw tests into k8s tests

* fix typo

* Use diff of response and resource to determine change, don't do any checking client-side before making requests

* remove duplicate yaml blocks

* Update porting guide for k8s module

* remove invalid doc refs

* If fuzzy searching finds a resource, update resource_definition to match proper kind and version

* remote unsupported openshift_raw variables

* properly check environment variables when determining auth method:
2018-05-30 12:04:48 -05:00
Nathaniel Case
82dfa542c2
Replace bogus (but routeable) ip addresses with RFC 5737 example addresses (#40554)
* Remove 1.1.1.1 from *_config tests

* remove from *_smoke and *_system

* Miscellaneous other tests

* Remove from module documentation as well

* Remove from unit tests as well

* Remove accidental duplication from rebase
2018-05-30 13:03:20 -04:00
Matt Clay
c3d3b6cedc Fix FreeBSD package install in test setup.sh. 2018-05-30 07:43:49 -07:00
Nilashish Chakraborty
b9ea646839
Fixes eos_logging idempotence issue #31862 (#40604)
* eos_logging idempotence fix

* fixed eos_logging idempotence issue

* Fixed pylint and pep8 errors

* Added tests for eos_logging & minor fix

* Removed q statements
2018-05-30 18:21:54 +05:30
Nathaniel Case
2272b6155c
Remove local from most eos tests now that provider is out (#40875) 2018-05-30 08:40:28 -04:00
Guillaume Grossetie
5ffa1a1b2a Add a module to create a java key store (jks) from a certificate (#35273)
* Add a module to create a java key store (jks) from a certificate
* Create a jks from a certificate and a private key (secured by a password)
* Add an option to recreate the jks (useful when you want to update the jks password)
* If the certificate changed, recreate the jks
* Version added is now 2.7
2018-05-30 13:53:09 +05:30
Sloane Hertel
7d2c71462d gluster_volume: add 'volume' alias to 'name' param (#40845)
* gluster_volume: add 'volume' alias to 'name' param

* remove gluster_volume from validate-modules/ignore.txt
2018-05-30 02:06:46 +02:00
Pilou
de385560a8 jenkins_jobs: fix typos (#40844)
* jenkins_job: fix typos

* jenkins_job: add type for 'enabled' parameter
2018-05-30 01:44:02 +02:00
Nathaniel Case
20f93816d6
Fix eapi tests to use become (#40838)
* Return the expected prompt character based on become status

* Update eos_banner tests for eapi

* Update eos_config tests for eapi

* Update eos_facts tests for eapi

* Update eos_interface tests for eapi

* Update eos_l3_interface tests for eapi

* Update eos_lldp tests for eapi

* Update eos_logging tests for eapi

* Update eos_smoke tests for eapi

* Update eos_system tests for eapi
2018-05-29 14:18:03 -04:00
Trishna Guha
17b6ecf101
nxos_vlan fix (#40822)
* nxos_vlan fix

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

* uncomment mode test as nxapi now has get_capabilities

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-29 21:44:19 +05:30
Matt Martz
36c8441c6d New module vmware_deploy_ovf (#30309)
* First pass at vmware_deploy_ovf functionality
* Add OVA file support, re-structure code
* Move some useful functions to module_utils.vmware, and perform a little DRY too
* Better handling of errors during spec validation and import
* Properly calculate the lease progress percentage for all vmdk files
* Make warnings and errors a little better
* Add an allow_duplicates argument, that defaults to true, to allow users to have name based idempotency
* Add fail_on_spec_warnings to cause the module to treat warnings as errors
* Support non-vmdk uploads
* Add ova alias for ovf
* Rename vmdk_post_url to device_upload_url so it does not sound to specific to VMDK files
* Safer handling of * hostname in urls
* Add default Content-Type, remove unused headers var
* Add deploymentOptions and propertyMapping functionalities
* Add basic check_mode support
* Add vmware_deploy_ovf to list of use-argspec-type-path ignores
* Update version_added and fix path for use-argspec-type-path
* Add configurable folder
* Doc changes
2018-05-29 21:38:43 +05:30
Mike Wiebe
9f026309a6 Update nxos_install_os module (#40102)
* Add nxos_install_os integration tests

* Update call to check timers

* Update check_ansible_timer method

* Modify network_cli integration tests

* Add timer check for nxos_install_os

* Add comments for clear_persistent_sockets

* Update connection info for tests

* More updates

* Restructure files for provider and non-provider testing

* Update env var name and add check for ISSU switchover
2018-05-29 21:07:57 +05:30
Matt Clay
45c6fa9784 Update gluster_volume path in ignore.txt. 2018-05-29 08:35:13 -07:00
Zim Kalinowski
726d7fe4c3 removing unstable from container instance (#40780) 2018-05-29 15:11:26 +08:00
Zim Kalinowski
8544bc5b2a fixing three unstable integration tests (#40804) 2018-05-29 14:22:59 +08:00
cosmix
4ae4e80cc3 Add support for mysqldump --ignore-table switch (#33065)
* Add support for `mysqldump`'s `--ignore_table` switch.
* Fix documentation and default linter warning re: default parameter
* Add number to replacement field in cmd string
* Bump version_added to 2.7
2018-05-28 17:31:55 +05:30
Matt Martz
b07f779296 Update dnf module argument_spec and docs to match (#39819)
* Update dnf module argument_spec and docs to match. Fixes #39800

* Always evaluate autoremove as boolean
2018-05-28 06:26:04 -04:00
Yuwei Zhou
7b9864776a Fixes #39648 azure_rm_virtualnetwork not handling DNS settings properly on existing virtual networks (#40646)
* check nullable

* add test

* fix

* fix
2018-05-28 15:45:01 +08:00
Zim Kalinowski
dde48560fb fixing container instance sanity & integration tests (#40774) 2018-05-28 12:59:26 +08:00
Sviatoslav Sydorenko
6cafa73441 Add is_iterable utility function 2018-05-27 02:23:57 +02:00
Sviatoslav Sydorenko
e6eec79bca Add tests for module_utils.common.collections 2018-05-27 02:23:57 +02:00
Kevin Breit
e16490c9c0 [WIP] New module - meraki_admin (#39837)
New module - meraki_admin
2018-05-26 02:30:21 +02:00
Kevin Breit
d5b3ffc51e New module - meraki_snmp (#39882)
* Initial commit for meraki_admin module

* Initial commit for meraki_snmp module

* Update code to be operational for SNMP settings
- Add optional_ignore value to is_update_required for one-time fields
- Write documentation
- Perform checks and execute changes

* Minor fixes and test improvements
- Fix some documentation errors
- Implement and test for idempotency

* Removed meraki_admin which shouldn't be there, ansibot changes

* Rename params to be lower case
- Updated integration tests
- Changed CamelCase to lowercase and underscore

* Code cleanup changes based on comments from Dag.
2018-05-26 02:22:38 +02:00
Matt Clay
5838e88fa0 Fix timezone tests to restore timezone. 2018-05-25 17:13:05 -07:00
Ed Costello
c4536bc827 Support check mode in aws_ses_identity module (#38422)
* Port aws_ses_identity module to use AnsibleAWSModule

* Support Check Mode in aws_ses_identity

* Add tests for check mode

* Move feedback forwarding parameter check to before any changes are made.
2018-05-25 18:46:25 -04:00
Strahinja Kustudic
0781a7f68c Fixed check_mode status to be the same as normal execution (#40721)
* Fixed check_mode status to be the same as normal execution

* Now when setting the status to `disabled` in check_mode it correctly
returns the state changed and prints a warning like it does in normal
model. Before it always returned changed even if everything was set
correctly and a reboot was required.

* Add changelog entry


Co-authored by: Strahinja Kustudic <kustodian@gmail.com>
2018-05-25 17:06:11 -04:00
tranceitionalMynd
04e3c964fb Added executable parameter to the script module (#36969)
* Added interpreter parameter to the script module

* Let required and default parameters get documented implicitly for binary parameter

* Renamed interpreter parameter to executable
2018-05-25 14:40:48 -05:00
Yanis Guenane
496d10f7a8 Remove support for SSLv2 in test suite when not defined. (#39183)
When running the test test/units/module_utils/urls/test_open_url.py
test_open_url_no_validate_certs, the test fails because of the SSLv2
check.

Test is run on a machine using openssl 1.1.0g. By reading the openssl
man page[1], one can see that support for SSLv2 has been removed.

> Support for SSLv2 and the corresponding SSLv2_method(),
> SSLv2_server_method() and SSLv2_client_method() functions where removed
> in OpenSSL 1.1.0.
>
> SSLv23_method(), SSLv23_server_method() and SSLv23_client_method() were
> deprecated and the preferred TLS_method(), TLS_server_method() and
> TLS_client_method() functions were introduced in OpenSSL 1.1.0.

Hence this commit remove the uses of this flag when it is not defined.

[1] https://www.openssl.org/docs/man1.1.0/ssl/SSLv23_method.html
2018-05-25 12:50:19 -05:00
Strahinja Kustudic
de57fa71c1 Improve timezone module for none systemd Linux distributions (#38032)
* The module now correctly sets the timezone in both the config file and
in /etc/localtime; while hwclock is set in both the config and
/etc/adjtime.
* Module checks if the timezone is actually set by checking
/etc/localtime. Before it only checked if it was set in the config file.
* Fixed module not setting the timezone on RedHat systems if
/etc/localtime was a symbolic link.
* Fixed module failures in case of missing config files or incorrect data
in them.
* Added a lot of integrations tests to cover most of these situations.
2018-05-25 12:01:03 -05:00
Sloane Hertel
6fb128b235
Add elb_application_lb tests for modifying listeners (#40716) 2018-05-25 11:16:29 -04:00
jctanner
1d5fe326e8 Add a cloud provider and a set of smoketests for the NIOS modules (#40573)
* Add a cloud provider and a set of smoketests for the NIOS modules
2018-05-25 13:50:45 +01:00
Alex Stephen
362e622a4b New module: GCP Compute Disks (#38612) 2018-05-25 07:48:01 -04:00
René Moser
5dd3aa26ea
cs_instance: implement host migration support (#40309)
* cs_instance: implement host migration support

* fix build

* fail fast on update if user is not admin

* improve tests a bit

* expunge it

* fix typo

* disable temporarly verify for host on starting instance.
2018-05-25 11:20:04 +02:00
Jiri Tyr
e6e5e45d7e Fixing choices for transport option in gluster_volume module (#38815) 2018-05-25 03:30:30 -04:00
Milan Ilic
14f0fd9ab3 Add mode, owner_id and group_id options to one_vm (#40217)
Add `mode` option which sets permission mode of a VM in octet format
Add `owner_id` and `group_id` which set the ownership of a VM
Move the waiting for state at the end of the module, so it could fail faster if there is some error
tagged_instances will only be returned only if count_attributes and/or count_labels are used, as specified in the documentation
Update relevant tests
Add tests for mode, owner_id, group_id
2018-05-25 08:00:26 +02:00
Felix Fontein
dec392793b Letsencrypt: add account management module (#37275)
* Removed superfluous space.

* Separating account init code from ACMEAccount constructor.

* Extracted module utils and docs fragment.

* Added new letsencrypt_account module.

* Ignore pre-1.0.0 versions of OpenSSL.

* Added account key rollover.

* Renaming letsencrypt_account -> acme_account

* Simplifying check for updating contact information.

* Rewriting docstring for ACMEDirectory.

* Changing license according to permissions given by individual authors in https://github.com/ansible/ansible/pull/37275.

* Updating BOTMETA.

* Preparing for change of ACME protocol currently discussed in ietf-wg-acme/acme.

* Updating documentation.
2018-05-25 01:55:24 -04:00
René Moser
e7709e169a
new module cloud_init_data_facts (#37932)
* add new module cloud_init_facts

* rename cloud-init facts

* simplify

* re-add tests

* make test run on ubuntu except 14.04
2018-05-25 07:44:24 +02:00
Rafael
c49b7d2a5d Fix opennebula test stub (#40436)
* Requesting fixture services from PYONE via environment varaibles

* moved all test functionality out of opennebula module utils
2018-05-25 07:42:14 +02:00
Peter Janes
67493ebdee Add a 'releasever' parameter for dnf. Fixes #33314. (#37493)
* Add a 'releasever' parameter for dnf. #33314

* Set a default value for releasever

* Fix a variable name typo
2018-05-24 23:22:53 -04:00
Adrian Likins
1613a739ad fix decrypted vault utf8 values (#37539)
* Fix errors decrypted non-ascii vault vars

AnsibleVaultEncryptedUnicode was just using b"".decode()
instead of to_text() on the bytestrings returned from
vault.decrypt() and could cause errors on python2
if non-ascii since decode() defaults to ascii.
Use to_text() to default to decoding utf-8.

add intg and unit tests for value of vaulted vars
being non-ascii utf8

based on https://github.com/ansible/ansible/issues/37258

Fixes #37258

* yamllint fixups
2018-05-24 23:22:46 -04:00
Simon
d95c572992 New Memset module to request DNS reloads (#40390) 2018-05-25 00:30:25 +02:00
Simon
08f670864a New Memset module to manage DNS zone domains (#40391) 2018-05-25 00:29:43 +02:00
Rob
858f0fc000 New module: AWS Network load balancer (#33808)
* New module - elb_network_lb

* Fix creating a load balancer without tags

* Linter

Fix purging tags

Remove extra imports

* add support for cross zone lb, doc update and fix tagging

* pep8 fixes

* Add integration tests for elb_network_lb module

* more pep8

* Remove non-applicable option for NLBs

* fix target protocol

* pep8
2018-05-24 16:38:34 -04:00
Sijis Aviles
529ef6446e fix: Ensure zip excluded files are not checked (#40120)
* fix: Ensure zip excluded files are not checked

Fixes #26279

* test: Verify unarchive excludes behaves as expected

* fix: Typos and whitespaces
2018-05-24 15:14:15 -05:00
Ryan Brown
046561bbb0 Split AWS Config modules (#40111)
* Adding module for AWS Config service

* adding integration tests

* Split resource types into their own modules

* Properly use resource_prefix and retry on IAM "eventual consistency"

* Add config aggregator module

* AWS config aggregator integration test fixes

* AWS config recorder module

* Config aggregation auth rule

* Use resource_prefix in IAM role name

* Disable config tests
2018-05-24 15:52:41 -04:00
Sloane Hertel
cba64f5869 Fix inventory plugin cache + add tests (#38229)
* Fix setting the cache when refresh_cache or --flush-cache are used

* Use jsonify function that handles datetime objects in jsonfile cache plugin

* Don't access self._options directly

* Add initial integration tests for aws_ec2 inventory plugin

* Add CI alias

* Fix and add a few more unit tests

* Add integration tests for constructed

* Fix typo

* Use inventory config templates

* Collect all instances that are not terminated by default

* Create separate playbook for setting up the VPC, subnet, security group, and finding an image for the host

Create a separate playbook for removing the resources

* Allow easier grouping by region and add an example

* use a unified json encode/decode that can handle unsafe and vault
2018-05-24 15:34:54 -04:00
James Mighion
d9533c3cbf Adding changed option to save_when (#40640)
* Adding changed option to save_when

* Fixing version when changed was added.
2018-05-24 22:18:59 +05:30
Ryan Brown
858a1b09bb EC2_group module refactor (formerly pr/37255) (#38678)
* Refactor ec2_group

Replace nested for loops with list comprehensions

Purge rules before adding new ones in case sg has maximum permitted rules

* Add check mode tests for ec2_group

* add tests

* Remove dead code

* Fix integration test assertions for old boto versions

* Add waiter for security group that is autocreated

* Add support for in-account group rules

* Add common util to get AWS account ID

Fixes #31383

* Fix protocol number and add separate tests for egress rule handling

* Return egress rule treatment to be backwards compatible

* Remove functions that were obsoleted by `Rule` namedtuple

* IP tests

* Move description updates to a function

* Fix string formatting missing index

* Add tests for auto-creation of the same group in quick succession

* Resolve use of brand-new group in a rule without a description

* Clean up duplicated get-security-group function

* Add reverse cleanup in case of dependency issues

* Add crossaccount ELB group support

* Deal with non-STS calls to account API

* Add filtering of owner IDs that match the current account
2018-05-24 11:53:21 -04:00
Rob
49f569d915 New module: AWS Glue connection (#39492)
* New module = AWS Glue connection

* Add a few initial integration tests

* Add alias for CI

* module rename

* finish module rename

* add loop when getting glue connection again so we dont get None

* Limit number of retries to get new glue connection info
2018-05-24 11:35:24 -04:00
Trishna Guha
c2f7f36fc5
nxos_file_copy network_cli and httpapi fix (#40592)
* Leverage action plugin to pass credentials to nxos_file_copy for network_cli, httpapi

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

* update integration test

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

* make sure local test uses provider

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

* update tests

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

* update doc

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

* clarify action plugin comment

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

* Add connection=local back to nxos_file_copy because that module is weird

Also blacklist it running on nxapi, because that is meaningless

* remove provider

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

* blacklist nxapi

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

* Address review comment

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-24 20:21:18 +05:30
Milan Ilic
18e7d814ef Add OpenNebula one_service module (#37829) 2018-05-24 13:32:45 +02:00
wiso
160bf82544 Add NETCONF support for SROS devices (#40330)
* added NETCONF support for SROS devices

* corrected alu mapping

* fix pep8 in sros.py

* BOT META file updated
2018-05-24 15:44:39 +05:30
wiso
387a23c3d1 New ansible module netconf_rpc (#40358)
* New ansible module netconf_rpc

* add integration test for module netconf_rpc

* pep8/meta-data corrections

* usage of jxmlease for all XML processing
separation of attributes "rpc" and "content"

* removed unused imports
improved error handling

* fixed pep8

* usage of ast.literal_eval instead of eval
added description to SROS integration test for cases commented out
2018-05-24 15:25:02 +05:30
Deepak Agrawal
ea4a78b2a1
iosxr_command does not work with prompt and answer arguments (#40475)
* mismatch type between function arguments

* add testcase for prompt

* yamllint issues

* remove overwriting response in case of connectionError exception

* remove import of ConnectionError as it is not required
2018-05-24 13:18:29 +05:30
Trishna Guha
3fd9c46828
fix nxos_system test (#40643)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-05-24 12:00:04 +05:30
Yuwei Zhou
c95724fb0a Fixes some NIC problems: create without nsg, support loadbalancer (#38643)
* add loadbalancer

* dict check nullable

* add default vallue when get list

* create backend addr pool

* fix the set

* fix to dict

* fix ideponement

* use param security group name when create

* nic can has no nsg

* add test

* fix

* fix

* fix

* add document

* add configuration

* fix

* fix

* remove all resources

* fix

* fix test

* add version added

* fix lint

* fix lint

* Fixes some NIC bugs (#39213)

* add loadbalancer

* dict check nullable

* add default vallue when get list

* create backend addr pool

* fix the set

* fix to dict

* fix ideponement

* use param security group name when create

* nic can has no nsg

* add test

* fix

* fix

* fix

* fix idemponet

* add document

* fix test

* add configuration

* fix

* fix

* remove all resources

* fix

* fix test

* add version added

* fix lint

* fix lint

* fix lint

* remove new feature and only submit bugfix

* remove useless test

* fix

* fix indent

* Update azure_rm_networkinterface.py

* fix comment

* support 3 types to specific name and resource group

* avoid test racing

* fix test

* add sample

* add resource id test
2018-05-24 14:32:03 +10:00
Martin Krizek
0eece38cdf Fix any_errors_fatal in meta tasks (#36870) 2018-05-23 21:03:31 -05:00