Commit graph

2606 commits

Author SHA1 Message Date
René Moser
0a972ea6bf wait_for: add some integration tests (#25553) 2017-06-09 21:35:10 +02:00
René Moser
29817ab115 cloudstack: add tests, fix pep8 (#25518)
* cloudstack: cs_zone: fix pep8

* cloudstack: cs_zone: add tests
2017-06-09 18:48:53 +02:00
Sloane Hertel
b376bde4d7 [cloud] ec2_eni module - allow attaching a new instance - fixes #19452 (#22377)
* fix bug attaching instances

* pep8
2017-06-09 11:31:42 -04:00
Tim Rupp
61684f7313 Updates gtm wide ip module to be feature complete (#25502)
This module is used to manage GTM wide ips on a bigip.
Previously, this module only included a small subset of functionality
primarily related to editing a wide ip that already existed. Additionally
it used the SOAP api for its communication. this patch completes the
feature set of wide ips and refactors the code to use the F5 python SDK
and the REST API.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_gtm_wide_ip.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_gtm_wide_ip/tasks
2017-06-09 16:07:14 +01:00
Ricardo Carrillo Cruz
72e65e4290 Platform agnostic module for VRFs (#25383)
* WIP VRF platform agnostic module

* Fixed examples refering vlans instead of vrfs

* Add integration tests
2017-06-09 13:33:11 +02:00
Ricardo Carrillo Cruz
d83f254bb6 New eos_vrf module (#25427)
* New eos_vrf module

* Add CLI integration tests

* Check rd only if not None
2017-06-09 13:24:28 +02:00
Trishna Guha
91e5fce90f Add ios_user implementation module (#25413)
* Add ios_user module

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

* Integration test for ios_user

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

* Add unit test for ios_user

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-09 13:50:57 +05:30
Adrian Likins
dde3dac9f8 Support NetBSD 7.1+ style ifconfig -a output (#25442)
* Support NetBSD 7.1+ style ifconfig -a output

network facts on NetBSD after 7.1 cvs would fail
because of format changes in 'ifconfig -a' output.

update code to support new and old format.

add unit tests for both based on
examples from Bruce V Chiarelli.

* wrap use of interfaces.keys() in list() for py3 compat
* sort interface ids for stability
2017-06-08 17:09:22 -04:00
Adrian Likins
f4128746d3 Cmdline fact uefi 23647 (#25446)
* Fix ansible_cmdline initrd fact for UEFI

UEFI cmdline paths use \ path sep which would
get munged by cmdline fact collection.

* Make CmdLineFactCollector easier to test

extract the parsing of the /proc/cmdline content to
_parse_proc_cmdline()

add a wrapper method for get_file_content _get_proc_cmdline()

Add unit tests of _parse_proc_cmdline based on examples
from issue #23647

Fixes #23647
2017-06-08 16:03:29 -04:00
Jordan Borean
89caef8fb6 win_environment: Added tests and return info in document (#25064)
* win_environment: Added tests and return info in document

* fixing up some yaml issues

* some more things I should have detected

* fixing up test tag name
2017-06-08 17:39:10 +01:00
George Nikolopoulos
a00089c341 New module: manage Citrix Netscaler service configuration (network/netscaler/netscaler_service) (#25129)
* netscaler_service initial implementation

* Changes as requested by reviewers

* Skip some tests if under python2.6 and importing requests library

* Change option "operation" to "state"

* Remove print statements from netscaler module utils

* Catch all exceptions during login

* Fix fail message

* Add common option save_config
2017-06-08 08:33:32 -06:00
Dag Wieers
6e98dbbfd7 wait_for: PEP8, imports, cosmetics (#24634)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)

This fixes #19781
2017-06-08 11:06:11 +02:00
Trishna Guha
36082e32b4 Add integration test for nxos_user (#25464)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-08 13:32:49 +05:30
Trishna Guha
b1b68840be Add missing integration test for eos_user (#25463)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-08 12:28:29 +05:30
Chris Houseknecht
20bddde669 docker_service: Forward stderr-based output from docker-compose (#25456)
PR #5165 at https://github.com/ansible/ansible-modules-core/pull/5165
adds redirection and capture of stdout during execution of
docker-compose.

This doesn't necessarily catch all errors, since some are printed to
stderr and lost.

This extends the redirection to include stderr, and does minor string
processing to attempt to find a 'useful' message to present as the
final Ansible error.
2017-06-07 23:30:26 -04:00
Ricardo Carrillo Cruz
b3e8c48d4b New module: Add support for Arista EOS vlan (network/eos/eos_vlan) (#25355)
* WIP Add eos_vlan module

* Fix docstrings

* Fix pep8 issues

* Add active/suspend states logic

* Add integration tests for eos_vlan

* Fix map_config_to_obj on EAPI

* Sixify iteritems

* Add platform agnostic net_vlan integration tests
2017-06-07 23:47:28 +02:00
Brian Coca
745f72916f bigip tests now skipped if missing lib 2017-06-07 17:24:51 -04:00
Matt Martz
e86b00b917 Make validate-modules a .py file, and symlink back to validate-modules (#25227)
* Make validate-modules a .py file, and symlink back to validate-modules

* Set prog for argparse in valdiate-modules
2017-06-07 14:44:33 -05:00
Matt Martz
004e99316c Allow template files to be vaulted (#22951)
* Allow template files to be vaulted

* Make sure to import exceptions we need

* get_real_file can't take bytes, since it looks specifically for string_types

* Now that we aren't using open() we don't need b_source

* Expand playbooks_vault docs to include modules that support vaulted src files

* Add vaulted template test
2017-06-07 14:16:03 -04:00
Daniele Lazzari
eda6a6baee New module: Add module to add/remove a network static route on windows (windows/win_route) (#23405)
* adds win_route windows module

* fix documentation indent

* fix documentation pep8 issues

* fix documentation issues

* genaral code review

* changed 'supported_by' in doc, supports_check_mode removed

* use of powershell cmdlet instead of route command, destnation in CIDR format, adds check mode support

* adds win_psmodule module

* documentation review

* documentation review

* removed files accidentatlly pushed

* add integration tests, add return in documentation

* add conditional statement in test, add os requirementes in documentation

* fix documentation

* fix os check in tests
2017-06-07 10:25:50 -07:00
Dag Wieers
4307733e6e Revert the accidental addition of python-lxml (#25432)
I inadvertedly added python-lxml to the cloudstack-simulator Dockerfile.

This PR reverts this specific change.

This relates to PR #25324
2017-06-07 15:59:28 +01:00
John R Barker
a6c078c7fb Add tzdata back (#25433)
It appears that the base Docker images have removed tzdata.
We use tzdata in the debconf tests, so add it back.
2017-06-07 15:54:01 +01:00
Mike Wiebe
b76acc8ce8 Fix nxos_vpc idempotence issues (#25219)
* Fix nxos_vpc idempotence issues

* Remove legacy-file pep8 now passing
2017-06-07 10:35:08 -04:00
Dag Wieers
966b5fd1a0 Add python-lxml to docker images (#25324) 2017-06-07 12:48:16 +01:00
Abhijeet Kasurde
5bd4e01533 Update documentation of pamd module (#24712)
Updated explanation and documentation of new_module*
in pamd documentation

Fixes #24516

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-07 08:48:42 +01:00
Abhijeet Kasurde
65bd5c4d56 Refactor github_hook module (#24391)
* PEP8 fixes
* Refactoring for fetch_url call
* Removed un-used code

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-07 07:52:03 +02:00
Abhijeet Kasurde
677a6c2982 Pep8 fixes for ejabberd_user and jboss (#24586)
* PEP* Fixes
* Refactor code

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-07 07:35:22 +02:00
René Moser
894b86a467 cloudstack: cs_zone_facts: add tests and fix pep8 (#25407) 2017-06-07 00:35:24 +02:00
Tim Rupp
6f2c543a33 Updates and refactors the bigip pool module to use REST (#25234)
This patch updates the bigip_pool module to use F5's REST API
as well as includes unit tests.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_pool.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_pool/tasks
2017-06-06 18:54:02 +01:00
Tim Rupp
855fd98be6 Adds the bigip_config module to Ansible (#25191)
This patch adds the bigip_config module to Ansible to support
merging SCF files, saving running configs, resetting config
and validating SCF configs
2017-06-06 18:52:33 +01:00
Trishna Guha
f6a4803669 New module: platform agnostic way to manage local users on network devices (network/net_user.) (#25259)
* Add net_user platform agnostic module

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

* Integration test for net_user

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

* modify eos_user module to support name param as alias to username

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

* Test collection of users

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-06 20:05:08 +05:30
Toshio Kuratomi
be4e7a05fa remove_values could hit the recursion limit
When operating on arbitrary return data from modules, it is possible to
hit the recursion limit when cleaning out no_log values from the data.
To fix this, we have to switch from recursion to iteration.

Unittest for remove_values recursion limit

Fixes #24560
2017-06-06 07:15:39 -07:00
Nathaniel Case
f52dcef7ba Actually check for equality on empty commands array (#25308) 2017-06-06 09:56:44 -04:00
Tim Rupp
0133a5a763 Adds the bigip_gtm_pool module (#25275)
This module is used to manage GTM(DNS) pools in a BIG-IP.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_gtm_pool.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_gtm_pool/tasks
2017-06-06 11:25:55 +01:00
Ganesh Nalawade
6215922889 Add support for cliconf and netconf plugin (#25093)
* ansible-connection refactor and action plugin changes
* Add cliconf plugin for eos, ios, iosxr, junos, nxos, vyos
* Add netconf plugin for junos
* Add jsonrpc support
* Modify network_cli and netconf connection plugin
* Fix py3 unit test failure
* Fix review comment
* Minor fixes
* Fix ansible-connection review comments
* Fix CI issue
* platform_agnostic related changes
2017-06-06 13:56:25 +05:30
Sloane Hertel
c20285782d test conditionals work for invalid elements in list and undefined keys in dicts (#23875) 2017-06-05 23:48:18 -07:00
Michael De La Rue
e28845018d [cloud] New module: AWS API Gageway module (#20230)
* Ultra basic api-gateway module based of lambda.py

* Ultra basic deployment added to api-gateway module

* ApiGateway module Allow creation of APIs, more documentation and better return value

* ApiGateway module incorporate review feedback

* ApiGateway module flake8 cleanup

* APIGateway module - more review fixes.

* slightly better messages in api_gateway module

* AWS api_gateway module - try to improve messages in case of exceptions

* rename api_gateway module to aws_api_gateway as discussed in PR 20230

* aws_api_gateway - Allow delivery of swagger either as text or dictionary.

* aws_api_gateway module - introduce 'unit' tests, improve imports using them and small fixes

* aws_api_gateway module - move path expand_user to avoid early typecheck

* aws_api_gateway - version means version of metadata not module - fix to 1.0

* aws_api_gateway module - Rely on module_utils.ec2 for imports & path type for expanduser / cleanups

* aws_api_gateway module - heavy cleanup and refactor of code + cloud retry functionality.

* api_gateway_module - failing test case for handling more than one deployment in succession and API deletion

* add TooManyRequestsException to AWSRetry exception list - makes API deployment work.

* api_gateway_module - Fixes for various review comments + errors from various linters

* api_gateway_module - Fixes for more review comments + linter error

* api_gateway_module - Major refactor into sensible functions - create_response becomes configure_response

* api_gateway_module - should be working under python3; remove test exclusion

* api_gateway_module - finish off remaining review fixes - use ansible defaults and fix mutually exclusive

* api_gateway_module - attempt to improve handling of botocore errors in python3

* api_gateway_module - implement state=absent / API deletion
2017-06-05 10:25:56 -04:00
Robin Roth
8f7c8ef3a5 Reenable git tests (#25341)
* Revert "Temporarily disable failing git test."
* Use correct hash for depth=1 test
2017-06-05 12:10:22 +08:00
Matt Clay
dab1b1fe5b Temporarily disable failing git test. 2017-06-04 20:39:38 +08:00
René Moser
53c46df323 cloudstack: new module cs_network_acl_rule (#25325)
* cloudstack: new module cs_network_acl_rule
* fix doc errors
2017-06-03 14:34:09 +02:00
René Moser
3e02b19b98 cloudstack: fix pep8 cs_project (#25322) 2017-06-03 01:42:03 +02:00
Will Thames
84eea2a7e3 Support check_mode in ec2_vpc_nacl (#23112)
* Support check_mode in ec2_vpc_nacl

Ensure that all API calls that make changes are guarded by
`if not module.check_mode`.

* Update ec2_vpc_nacl_facts to latest pep8 standards
2017-06-02 13:15:38 -04:00
Trishna Guha
e90f1d6449 net_command platform agnostic module (#25249)
* net_command platform agnostic implementation

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

* Add net_command platform agnostic module

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

* Add integration test for net_command module

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

* fix yaml issue
2017-06-02 22:03:27 +05:30
Dag Wieers
8cbed3c534 unarchive: PEP8, imports, cosmetics (#24654)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-06-02 16:22:52 +01:00
Ricardo Carrillo Cruz
955dc6e250 Add net_banner platform agnostic module (#25245)
* Add net_banner platform agnostic module

* Add integration tests for net_banner

* Remove default from required param

* Remove skip/python3 from net_banner aliases
2017-06-02 17:01:08 +02:00
Ricardo Carrillo Cruz
ffc74fdca2 Add missing provider on basic-motd IOS test (#25307)
Without this it fails, as it needs elevated privs.
2017-06-02 16:58:45 +02:00
Ricardo Carrillo Cruz
64add28657 Platform agnostic net_system module (#24953)
* Platform agnostic net_system module

Also refactor the action network plugins for better code re-use

Still more refactoring to do once the connection plugin work is complete

* Replace importlib for imp

importlib is not available on 2.6, so we need to stick to imp

* Load action plugin via module metadata

* Better error message if no implementation is found

Now the plugin will show the module name and the network OS in the
error message

* Fix typo on documentation author line

* Fix pep8 issues

* Add missing options key on doc string and stringify version

* Return None in case module has no metadata

* Read module metadata only if it's a python module

Check for module suffix, if it's .py then read metadata.
Otherwise this fails on non-python modules, like Windows PS for example.

* Read metadata variable only if it's a python module

Fix referencing a variable before assignment

* Add action_handler to validate_modules metadata schema

* Pull metadata with plugin_docs get_docstring

Using load_source from PluginLoader is troublesome, it is not guaranteed
a module may be importable at the controller, e.g. if a module depends
on module_utils functions it won't work, because module_utils is not
in the sys path.
Rather than putting that module dependencies introspection, just
use plain parsing like plugin_docs get_docstring does as we only care
about reading ANSIBLE_METADATA.

* Add platform agnostic group of groups for integration tests

This will be the target for platform agnostic integration tests.

* Add integration tests for net_system

* Switch to action plugin inheritance from metadata driven action handler

As the metadata action driven action handler work is being worked on
on its standalone proposal+PR, let's just go back to have one
action handler per platform agnostic module.
Those action plugins will inherit from net_base.

* Add blank line to fix pep8

* Add aliases file to net_system integration test

This will avoid CI failure

* Fix integration tests for net_system

* Give more precedence to task network_os over inventory network_os
2017-06-02 14:06:38 +02:00
Brandon Davidson
0e0c5328fa amazon/ec2_vpc_igw: Allow internet gateways to be tagged (#23782) 2017-06-02 07:38:50 -04:00
Dag Wieers
5553b20828 Collated PEP8 fixes (#25293)
- Make PEP8 compliant
2017-06-02 12:14:11 +01:00
Dag Wieers
2f33c1a1a1 find: PEP8, imports, cosmetics (#24646)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
2017-06-02 08:43:40 +01:00