Commit graph

17318 commits

Author SHA1 Message Date
Tim Rupp
3af1d6ccae Adds file_common_args to f5 utils (#26618)
This is needed by a future module, so I wanted to make sure it's
available now.
2017-07-18 18:19:06 +01:00
Tim Rupp
ea14107a56 Fixes some bugs in yaml and code (#26627)
related to default values that were pointed out to me.
2017-07-18 18:18:32 +01:00
Tim Rupp
75e609c15e adds the bigip_ucs module (#26663)
This module allows you to load existing UCS files onto a BIG-IP
system

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_ucs.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_ucs/tasks
2017-07-18 18:17:56 +01:00
Tim Rupp
72f41148a0 Adds tcp_echo module for bigip (#26844)
This patch is part a refactor of TCP monitors for BIG-IP. This module
may file in testing without the base tcp module merged because it makes
use of similar fixtures.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp_echo.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp_echo/tasks
2017-07-18 18:04:36 +01:00
Tim Rupp
278fa552f8 Adds half-open tcp monitor module (#26920)
This is necessary as a part of refactoring the tcp monitor module.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp_half_open.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp_half_open/tasks
2017-07-18 17:59:17 +01:00
Brian Coca
5ffb40fcdb properly filter out noise from debug 2017-07-18 12:32:39 -04:00
Sloane Hertel
cdd1a147f1 [cloud] fix exception examples in AWS guidelines to be compatible with python3 (#26948) 2017-07-18 09:35:19 -04:00
Dag Wieers
3f567d5295 Added RETURN information
Just that.
2017-07-18 08:13:09 -04:00
Anil Kumar Muraleedharan
9258196184 Update cnos_devicerules.py to add 4 new device supports (#26745)
The devices are NE1072T, NE1032, NE1032T, NE10032, NE2572
2017-07-18 13:12:27 +01:00
Anil Kumar Muraleedharan
7098735fdf Checked again with YAML Checker and Pep8 checker (#26786) 2017-07-18 13:11:21 +01:00
Abhijeet Kasurde
f5e9d19af7 Correct usage of FindByUuid in vmware module util (#26040)
This fix corrects the usage of function FindByUuid by
specifying correct parameter 'uuid' and 'instanceUuid'
as documentation of VMWare's API.

Fixes: #24398, #24835, #25713

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-18 07:48:21 -04:00
Abdul Anshad A
c6d012a2eb fix issue #4755 (#19234) 2017-07-18 07:27:37 -04:00
Andreas Olsson
4e01397817 Add IPv6 support to module_utils.urls TLS validation (#26852)
socket.create_connection is a higher-level function, which tries to
establish a socket connection using both AF_INET and AF_INET6. It got
introduced in Python 2.6, which ought to be fine with Ansible 2.4.

Fixes #26740
2017-07-18 09:55:39 +02:00
Ganesh Nalawade
b8cd646afd net_lldp_interface module implementation for junos (#26915)
*  junos_lldp_interface module implementation
*  junos_lldp_interface integration test
*  net_lldp_interface module intgration test for junos
*  Add lldp configuration parameter in junos_lldp
*  Modify junos_lldp testcase as per above change
*  Add net_lldp_interface module documentation
2017-07-18 12:14:10 +05:30
Will Medlar
3f67d167fe [Fixes #26690] Supports Python 3 handling of base64 encoding (#26876)
* [Fixes #26690] Supports Python 3 handling of base64 encoding

* Set text auth to separate variable for reuse
2017-07-17 21:11:52 -07:00
Jimmy Conner
fbf68b5725 vmware_guest relative paths for folder (#26927)
* Re-introduce relative paths to vmware_guest folder:

Move compile_folder_path_for_object function from vmware_guest_find to
utilities
Allow full path or relative path to be specified for the folder
parameter.  We will build the full path to the new VM.

* Remove duplicate check

* PEP8 Fixes
2017-07-17 22:18:20 -04:00
Peter Sprygada
8e2dcaf9f6 update asa to use network_cli connection plugin (#26899)
* WIP update asa to use network_cli connection plugin

* add asa.py to cliconf plugins
* update asa.py terminal plugin to support regexp and events
* update constants to map asa modules to asa action handler
* update asa action handler to implement persistent connections
* update asa shared module to use persistent connections
* update asa_command module to use new connection

* fixed pep8 issues
2017-07-17 21:23:38 -04:00
Toshio Kuratomi
84fb9f032d Fix symlink handling (#26877)
* Fix symlink handling

On symlinks, make lnk_source return the absolute path of the target of the symlink.
Add a new return field lnk_target that returns the actual, unexpanded path to the target of the symlink.
2017-07-17 12:06:35 -07:00
Sloane Hertel
66f5a094bc [cloud] iam_cert: allow paths to be specified so slurp is not necessary for remote host… (#26097)
* allow paths to be specified so slurp is not necessary for remote hosts to use

* Make requested changes

remove unused parameters

* remove module used out of scope

check the potential filepath to be true before checking isfile

remove required: false

* rephrase documentation

* remove 'lookups' from example
2017-07-17 15:00:54 -04:00
Toshio Kuratomi
d64e291274 Fix modules' use of BOOLEANS*
* The canonical location of BOOLEANS has moved.  Switch imports to use that.
* clean up argument_spec use of booleans.
* Clean up imports to not use wildcards
* Remove usage of get_exception
2017-07-17 11:48:05 -07:00
Toshio Kuratomi
ff22528b07 Consolidate boolean/mk_boolean conversion functions into a single location
Consolidate the module_utils, constants, and config functions that
convert values into booleans into a single function in module_utils.

Port code to use the module_utils.validate.convert_bool.boolean function
isntead of mk_boolean.
2017-07-17 11:48:05 -07:00
Toshio Kuratomi
f9c60e1a82 Make the ConfigManager in constants private
All play focused code should access constants via ansible.constants, not
via the config API.  Even that API should only be used by
ansible-config.  It should be considered an internal implementation
detail to everything else
2017-07-17 11:48:05 -07:00
Abhijeet Kasurde
e979663dfe Add testcase for vmware_guest_facts (#26873)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-17 13:34:43 -04:00
Rob
efbc65bff0 New module: Add elb_application_lb_facts (cloud/amazon/elb_application_lb_facts) (#24584)
* New module - elb_application_lb_facts

* Make sure tags dont get snake cased

* Add listeners and listener rules to application facts

* python3 compat fix
2017-07-17 12:00:58 -04:00
Dag Wieers
e970237a2f New module: access Cisco ACI (network/aci/aci_rest) (#26029)
* aci_rest: New module to access Cisco ACI

This PR includes:
- Relicense as GPLv3+
- Check-mode support
- Cosmetic changes to documentation
- Examples in YAML format
- Removal of incorrect requirements (for this module)
- Do not log passwords
- Implement native fetch_url instead of requests
- Use standard hostname, username and password parameters
- Add alias src for parameter config_file
- Add mutual exclusive content option for inline data (and show some inline examples)
- Add timeout parameter
- Add validate_certs parameter
- Handling ACI result output (identical for JSON as XML input)
- Parse/expose ACI error output to user

* Lower case method, add use_ssl, Use python dicts

This commit includes:
- Use lowercase method names
- Add `use_ssl` parameter (not the `protocol` parameter)
- Use a python dict for the request data (not a JSON string)
- Documentation improvements

* Ensure one of 'content' or 'src' is provided

* Fix issue with totalCount being a string in JSON

This fixes the problem with JSON output where totalCount is a string and
not an integer.

This fixes jedelman8/aci-ansible#7

* Improve code documentation

* Improve error handling and module response

* Small typo

* Improve documentation and examples

* Keep protocol parameter, but deprecate it

* Extrude aci functions from module_utils

* aci_rest: Add unit tests
2017-07-17 16:32:12 +01:00
Nathaniel Case
a3aa5d799e Fix nxos_system name-server parsing (#25973)
* Fix nxos_system name-server parsing

* Introduce lookup_source as a noop, but don't advertise its use
2017-07-17 11:15:43 -04:00
Nathaniel Case
855544604a Fix nxos_bgp_neighbor_af advertise_map and advertise_map_non_exist (#26721) 2017-07-17 11:15:06 -04:00
Brian Coca
4d55148ab2 removed redundant loader 2017-07-17 09:03:39 -04:00
Trishna Guha
e5c2e1b7be iosxr_logging implementation module (#26886)
* iosxr_logging implementation module

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

* iosxr_logging integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-17 17:20:22 +05:30
Trishna Guha
c38bccb3c4 Add ios_logging implementation module (#26785)
* Add ios_logging implementation module

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

* fix doc

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

* integration test net_logging and ios_logging

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

* modify the module code

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

* modify the module code

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

* change collection to aggregate

* fix buffer size logic

* fix pep8 issues
2017-07-17 12:45:53 +05:30
apmits
033a68d453 pip: Add example for --user (#26856)
* state type of arguments explicitly

* add example for --user argument
2017-07-17 08:17:06 +02:00
Rob
d0d2beafba have elb_application_lb use modify_listeners to avoid removing/recreating them (#25650)
* Rework how listeners and rules and handled. Fixes #25270

* Tidy up, documentation and add rules to returned output

* Remove required=False from argument_spec

* Remove unused functions. Add or [] in case of no elb

* Handle when listners is None in ensure_listeners_default_action_has_arn
2017-07-17 14:33:04 +10:00
sramakr
b980a5c02a Use Boto3 for ec2_group Fixes #23507 (#25340)
* Use Boto3 for ec2_group

Currently boto doesn't support ipv6. To support ipv6 in ec2_group, we need boto3.
boto3 has significant API changes, which caused more re-factoring for ec2_group module.
Added additional integration test to test_ec2_group role.

* Follow the standard for boto3 ansible

Fixed imports. Use boto3 ansible exception with camel_dict_to_snake_dict.
Refactored the call to authorize/revoke  ingress and egress.

* Removed dependancy with module ipaddress

Added new parameter called cidr_ipv6 for specifying
ipv6 addresses inline with how boto3 handles ipv6 addresses.

* Updated integration test

* Added ipv6 integration test for ec2_group

* Set purge_rules to false for integration test

* Fixed import statements

Added example for ipv6.
Removed defining HAS_BOTO3 variable and import HAS_BOTO3 from ec2.
Cleaned up import statements.

* Fixed exception handling

* Add IAM permissions for ec2_group tests

Missing AuthorizeSecurityGroupEgress necessary for latest tests

* Wrapped botocore import in try/except block

Import just botocore to be more similar to other modules
2017-07-17 12:03:31 +10:00
Ganesh Nalawade
879acf378d junos implementation of net_lldp (#26872)
*  junos_lldp module
*  junos_lldp integration test
*  net_lldp integration test for junos
*  Other minor changes
2017-07-17 07:14:09 +05:30
René Moser
30ad30c470 cloudstack: remove CloudStackException dep for several modules (#26874)
* cloudstack: cs_affinitygroup: remove CloudStackException dependency

* cloudstack: cs_domain: remove CloudStackException dependency

* cloudstack: cs_firewall: remove CloudStackException dependency

* cloudstack: cs_host: remove CloudStackException dependency

* cloudstack: cs_instancegroup: remove CloudStackException dependency

* cloudstack: cs_pod: remove CloudStackException dependency

* cloudstack: cs_configuration: remove CloudStackException dependency, fix pep8

* cloudstack: cs_cluster: remove CloudStackException dependency

* cloudstack: cs_network_acl: remove CloudStackException dependency

* cloudstack: cs_network_acl_rule: remove CloudStackException dependency

* cloudstack: cs_zone_facts: remove CloudStackException dependency

* cloudstack: cs_zone: remove CloudStackException dependency

* cloudstack: cs_vpn_gateway: remove CloudStackException dependency

* cloudstack: cs_vpc: remove CloudStackException dependency

* cloudstack: cs_sshkeypair: remove CloudStackException dependency

* cloudstack: cs_role: remove CloudStackException dependency

* cloudstack: cs_ip_address: remove CloudStackException dependency

* cloudstack: cs_ip_staticnat: remove CloudStackException dependency

* cloudstack: cs_resourcelimit: remove CloudStackException dependency

* cloudstack: cs_region: remove CloudStackException dependency

* cloudstack: cs_project: remove CloudStackException dependency

* cloudstack: cs_network: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule_member: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule: remove CloudStackException dependency

* cloudstack: cs_iso: remove CloudStackException dependency
2017-07-16 22:05:14 +02:00
Patrick Marques
a59684fddd Created digital_ocean_floating_ip module (#18922)
* Created digital_ocean_floating_ip module
2017-07-16 11:01:04 -07:00
René Moser
8477525d2b cloudstack: cs_account: remove CloudStackException dependency (#26870) 2017-07-16 12:02:28 +02:00
Rene Moser
1a27546039 cloudstack: cs_router: use query_api, remove CloudStackException dependency 2017-07-16 11:46:10 +02:00
Rene Moser
9543025b91 cloudstack: cs_router: fix pep8 2017-07-16 11:46:10 +02:00
Rene Moser
d88e9ab869 cloudstack: cs_router: add zone param 2017-07-16 11:46:10 +02:00
Rene Moser
c896aab5e3 cloudstack: cs_router: fix router not found and async polling in reboot 2017-07-16 11:46:10 +02:00
René Moser
5979f2543f cloudstack: cs_instance_nic: remove duplicate code (#26869) 2017-07-16 11:41:36 +02:00
René Moser
1d907de966 cloudstack: cs_user: fix pep8 and minor restyling (#26849) 2017-07-15 19:16:53 +02:00
René Moser
2a751e1753 cloudstack: cs_instance_nic: remove CloudStackException dependency (#26860) 2017-07-15 19:12:32 +02:00
René Moser
8320071e81 cloudstack: utils: reduce cs lib dependency in modules (#26848)
Also improves error handling and reduces code duplication
2017-07-15 18:25:27 +02:00
ioggstream
dc408f9035 known_hosts: always use lowercase hostnames for host keys (#26850) 2017-07-15 17:51:19 +02:00
Pilou
d9265c7498 os_ironic: fix broken import (#26802) 2017-07-15 08:44:50 -05:00
Quentin Dawans
613690bd46 Proxmox set number of cores for vm/ct (#25901)
* Proxmox set number of cores for vm/ct

Argument to limit the number of assigned core to a vm/ct

* version_added & pep8

* default to 1
2017-07-15 10:51:13 +01:00
Ganesh Nalawade
bf48364c72 junos implementation for net_l3_interface module (#26829)
* junos implementation for net_l3_interface module

*  junos_l3_interface implementation
*  junos_l3_interface integration test
*  net_l3_interface integration test for junos

* Fix module name typo
2017-07-15 12:38:44 +05:30
Brian Coca
04868c22b7 fixed issue with null host vars 2017-07-15 00:20:08 -04:00
Adrian Moisey
6ba49f42c2 Allow creation of github release tags (#25338)
* Allow creation of github release tags

* Reword description

* Prefer to use required_if
2017-07-14 14:57:56 -04:00
Abhijeet Kasurde
6bc15d11b9 Remove unreachable code (#26820)
Break statement is unreachable in current for loop.
Safely remove break statement.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 14:52:30 -04:00
Abhijeet Kasurde
b6fdc904a9 Remove redundant switch_name param (#26817)
Class uses a redundant switch_name param, which can be
removed safely.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 14:49:48 -04:00
Peter Hoffmann
2f81a28414 use tenant in UserPassCredentials if set (#20751)
* use tenant in UserPassCredentials if set

If you have multiple Tenants you need to set the tenant in https://github.com/Azure/msrestazure-for-python/blob/master/msrestazure/azure_active_directory.py otherwise the azure_rm.py call will fail.

see: https://github.com/ansible/ansible/pull/20750

* fixed PEP8 failure
2017-07-14 11:01:43 -07:00
Jordan Borean
8e05d7d962 win_secedit: Added module with tests/diff mode (#26332)
* win_secedit: Added module with tests/diff mode

* fixed up test issues

* Added missing return value

* change for win_secedit based on review

* updated win_security_policy examples for rename
2017-07-14 11:00:29 -07:00
Dag Wieers
4a1864765b Windows: Path integration tests (#26490)
These integration tests were used for testing the exact behaviour of
Ansible for YAML-style syntax and key=value syntax.

This includes fixes to win_shortcut (as `src` can be a URL too)
2017-07-14 10:24:54 -07:00
Colin Heinzmann
1d14de1d8c fixed win_nssm escaping issue (#22512)
* bugfix: applicaiton setting was not properly escaped leading to issues
when picking application under C:\Program Files (x86)\...
2017-07-14 10:11:02 -07:00
Nathaniel Case
61249995a1 Update nxos_interface_ospf & add test (#26644)
* Update nxos_interface_ospf & add test
2017-07-14 12:31:36 -04:00
Jordan Borean
eb1ed6567c win_regedit: rewrite to support edge cases and fix issues (#26468)
* win_regedit: rewrite to support edge cases and fix issues

* fix up byte handling of single bytes and minor doc fix

* removed unused method

* updated with requested changes
2017-07-14 09:28:49 -07:00
Greg
3506febbb9 Fixing issue related to writing ini files
When the file is opened with rwa+ and the update file size is smaller than the original the ini file can become corrupt.  The issue was noticed when we had comments at the top of /etc/yum/pluginconf.d/rhnplugin.conf after using the rhn_register module the file became correct.

rwa+ also make no sense as the file is only written too and why would any appending need to happen?
2017-07-14 11:20:32 -04:00
Jonan
088b930808 Update service.py
Ensure "initctl status servicename" passes along arguments to check correct instance.
2017-07-14 10:57:10 -04:00
Arne de Laat
c536f7789b In cronvar only use '-u {user}' if self.user is not the current user
Use the same logic as in the cron module.
2017-07-14 10:44:31 -04:00
Brian Coca
c581ae4b8d corrected version 2017-07-14 10:25:40 -04:00
Peter Shrom
80e88a7d40 updated version added 2017-07-14 10:25:41 -04:00
Peter Shrom
de5fb8d98c adding ability to set openstack image ids 2017-07-14 10:25:41 -04:00
Gawain
6608629d25 Add 'mac_address' to the attributes returned from the vmware_vm_facts module (#26527)
* Add 'mac_address' to the attributes returned from the vmware_vm_facts module

* fix pep8 issue
2017-07-14 10:25:20 -04:00
Ganesh Nalawade
751ad7021c vyos implementation for net_interface module (#26799)
* vyos implementation for net_interface module

*  vyos_interface implementation module
*  vyos_interface integration test
*  net_interface integration test for vyos

* Change collection to aggregate
2017-07-14 19:39:21 +05:30
Abhijeet Kasurde
a1977d9654 Remove redundant get_obj method (#26324)
vmware_guest_facts has redundant get_obj method, this can
be removed safetly.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 10:04:10 -04:00
Toshio Kuratomi
e986e31a75 This function is for setting variables on hosts. So those two parts are always required.
Don't have to check for the existence of those in the function.  If they
aren't set to iterables then it should be up to the calling code to
handle it.
2017-07-14 07:03:26 -07:00
Abhijeet Kasurde
b4a58b65fb Add param for snapshot subtree removal (#26576)
Fix adds a parameter for removing snapshot subtree.

Fixes: #26522

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 10:00:37 -04:00
Peter Sprygada
b9a1998af5 changes changed to modified in save_when choices (#26801) 2017-07-14 15:08:19 +02:00
Peter Sprygada
3bbb32cac5 fixes error when trying to run show start over eapi (#26800) 2017-07-14 15:07:44 +02:00
Abhijeet Kasurde
156b29b26b Fix for check_mode in archive (#26788)
Fix adds check_mode fix for archive module. Also,
adds unit tests for archive module

Fixes: #26750

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 09:06:17 -04:00
Ricardo Carrillo Cruz
8333a8b908 Fix eos_config defaults logic (#26798)
Current code is bogus, it was passing flags all unconditionally.
2017-07-14 13:43:17 +02:00
Robin Roth
d4482761ba Make lujeni only maintainter of mongodb_user (#26789) 2017-07-14 11:16:26 +01:00
Lujeni
661791dcb7 Fix the editable condition into pip module (#19028) (#19688)
* Fix the editable condition into pip module (#19028)

* Add editable to tests

Default changed to False, so now editable: True is needed explicitly in
tests
2017-07-14 10:54:04 +01:00
Morgan Robertson
44730c28cc Allow creation of Mongo user via localhost exception (#22792)
* Allow creation of user with localhost exception.

Fixes #22791

When access control is enabled, Mongo allows a user to be created from
localhost (called the "localhost exception":
https://docs.mongodb.com/v3.2/core/security-users/#localhost-exception).
When the `update_password` parameter was added to this module in
Ansible 2.1, this functionality was broken due to a query performed
before `user_add()` is called. This fix only performs the query when
when `update_password` is set to `on-create`, allowing a user to be
created via the localhost exception.

* Only set `password = None` when user exists.
2017-07-14 10:52:19 +01:00
jctanner
245a4d30b9 vmware_guest: fix datastore selection on equal sized disks and add tests (#26774)
* Fix datastore selection on equal sized disks and add tests
2017-07-13 22:02:33 -04:00
Will Thames
df321e8579 [cloud] change iam_managed_policy return to snake_case (#26219)
* Change iam_managed_policy to return snake case

Import module_utils.ec2 methods explicitly

* iam_managed_policy: tidy argument spec

Remove unnecessary specifications (`default=None`, `required=False`)
Use `required_if` to check for `policy` when `state` is `present`

* Provide exception handling in iam_managed_policy

Pretty much all AWS API calls can go wrong, and we should handle them.

Update line wrapping to improve readability of method calls

* Improve error handling when policy version limit exceeded

Better document policy version limit exceeded, and check
the error code to see that that's actually what happened
(rather than e.g. no permissions to add a new version)

* iam_managed_policy: better handle pagination and retry
2017-07-13 21:30:41 -04:00
Takuya Sato
179e2882f7 ecs_taskdefinition module: containers.environment convert to string (fix #23297) (#23681)
It is to fix the failed comparison of containers.
2017-07-13 20:10:31 -04:00
Rene Moser
6d81c9670f cloudstack: cs_role: fix UnboundLocalError in check mode 2017-07-14 00:51:35 +02:00
Brian Coca
3a1b84153c ensure all groups inherit from 'all' 2017-07-13 18:38:39 -04:00
Brian Coca
84367eacef added ansible_remote_tmp inventory var (#26754)
* added ansible_remote_tmp inventory var

* fixed horrible crime of no space after #
2017-07-13 15:31:10 -07:00
Nathaniel Case
62e4353ba1 nxos_facts cleanup (#26192) 2017-07-13 16:56:04 -04:00
Nathaniel Case
f3acf9c929 Fix NX-API json handling (#26716) 2017-07-13 16:23:24 -04:00
Sloane Hertel
ed51380c2c [cloud] ec2_vol module snapshot and volume_size are not mutually exclusive (#26764) 2017-07-13 15:08:03 -04:00
Pilou
2a92120ffa INI inventory plugin: add documentation about variable types (#25798)
* INI inventory: check variable types
* INI inventory: add doc about variable types

Fixes #25784
2017-07-13 12:04:20 -07:00
Ricardo Carrillo Cruz
af4dc6d0eb Add vyos_lldp and vyos_lldp_interface modules (#26753)
* Add vyos_lldp and vyos_lldp_interface modules

* Fix module docstring issue

* Fix bogus aggregate reference

* Add vyos_lldp integration tests

* Add vyos_lldp_interface integration tests

* Remove unused import for run_commands

* Add VyOS net_lldp integration tests

* Remove junos and netconf from net_lldp integration tests

* Add net_lldp_interface integration tests

* Correct CLI filtering tests for VyOS

* Fix pep8 issues

* Fix more pep8 issues
2017-07-13 20:58:18 +02:00
Pilou
4b3d6dfa8a Use pycodestyle instead of pep8 (#25947) 2017-07-13 11:46:31 -07:00
William Leemans
267d0fb400 Update hpilo_boot.py (#24499)
* Update hpilo_boot.py

Add option to change the ssl version to connect to the remotr iLO

* Update hpilo_boot.py

added version_added

* Update hpilo_boot.py

fix lib/ansible/modules/remote_management/hpilo/hpilo_boot.py:83:25: W291 trailing whitespace

* Update hpilo_boot.py

nitpicking fixes :)
2017-07-13 13:48:03 -04:00
William Leemans
ae3a6cd931 Update hpilo_facts.py (#24503)
* Update hpilo_facts.py

Add option to change the ssl version used to connect to the remote iLO

* Update hpilo_facts.py

addition of spaces after commas in lists and replace()
2017-07-13 13:47:52 -04:00
Toshio Kuratomi
b49be56c5b Need regex and string types to match when cleaning arguments for logging
Fixes #25078
2017-07-13 12:24:18 -04:00
Ricardo Carrillo Cruz
5719687920 Split net_lldp into net_lldp (service) and net_lldp_interface (#26757) 2017-07-13 16:38:15 +02:00
Christian Pointner
34c0abd106 Openssl csr fixes (#26110)
* openssl_csr: fix for python3

* openssl_csr: actually check for existence of pyOpenSSL

* pep8 compliance

* fixes for python 2.6 and 3
2017-07-13 09:42:48 -04:00
Ricardo Carrillo Cruz
5a20095b04 Add missing __init__.py on network protocol folder (#26742) 2017-07-13 12:04:49 +02:00
Ricardo Carrillo Cruz
9e819eeee8 Add net_lldp platform agnostic module (#26738) 2017-07-13 12:02:45 +02:00
Peter Sprygada
41c1457823 adds put_file and fetch_file implementations for cliconf plugin (#26728) 2017-07-13 09:21:02 +05:30
Bartek Bielawski
374ea94dc3 Adding more explicit module syntax (#26722)
Removing module_version from Attributes, support for class based resouces that need version specified when multiple version are present, support for File resource that has blank output for ModuleName/Version in Get-DscResource
2017-07-12 19:50:29 -04:00
Brian Coca
a5007f2f88 Namespaced facts fixes (#26615)
* shorten warning on reservd fact collision

also remove ansible_ from namespaced facts for vars manager
handle str conversion errors
use tuple to avoid iterator errors
version added added

* only modify final one

* removed ansible_ removal
2017-07-12 19:27:05 -04:00
jctanner
df507ca9c4 vmware_guest: fixes for cache objects and datacenter association (#26719)
* vmware_guest: fixes for cache objects and datacenter association
* find_all_objs was only looking for datastores
* Clear the result if it's datacenter is not correct.
* Re-enable pyvmomi installation

Addresses #25011
Addresses #26511
2017-07-12 17:10:48 -04:00
evancarter-iex
c22ec81b99 gce_instance_template: Add ability to use disks_gce_struct (#25500)
* Add ability to use disks_gce_struct

* Fixed typos in the options section

* Spacing fixes
2017-07-12 16:36:05 -04:00
Nathaniel Case
5cfdd5df0f nxos_pim_interface (#26367)
* Add unit tests to nxos_pim_interface

* Update tests to match module

* Update nxos_pim_interface

* Address pep8 issues
2017-07-12 15:39:43 -04:00
Matt Davis
c711754924 fix win_chocolatey syntax errors 2017-07-12 11:49:56 -07:00
Brian Coca
c2326aef01 dont show failed key on debug 2017-07-12 14:26:32 -04:00
tdtrask
c24398cfd9 apk: Fix failure when both install and upgrade in same command (#26666)
* apk: Fix failure when both install and upgrade in same command

If name list contains an installed package that needs upgrade plus a new package, apk command would fail due to missing space character.

* Simplify fix by concatenating lists
2017-07-12 12:26:30 -04:00
Ken Celenza
31b6ac896d Kc update ip filter (#26566)
* add first, last and next usable

* add usable ip filters

* add size usable, range usable and wildcard

* add ip prefix and netmask filter

* add network formatting and check if ip in subnet

* clean up order, add comments

* fix pep8

* update format by index

* clean up and updates from jmcgill298
2017-07-12 17:17:58 +01:00
Ken Evensen
8a5490ea5f Fix for #26633 (#26653) 2017-07-12 09:01:05 -06:00
Craig R Webster
c197a68508 Clarify behaviour for unmounted state (#26646)
Unmounting does not modify fstab.
2017-07-12 14:01:47 +01:00
Michael Scherer
1e5cfd16fc Fix typo in documentation for inventory ini plugin (#26643) 2017-07-12 14:00:40 +01:00
Dag Wieers
d4c0124d04 wakeonlan: coverage near 100% and check_mode++ (#26683)
This makes check_mode run more code (without sending out a packet.

And should get coverage to 98%.
2017-07-12 13:48:17 +01:00
Ganesh Nalawade
112cae73df Minor py3 compliance change for network module (#26695)
*  Convert return value of `execute_command` to appropriate type
2017-07-12 18:09:25 +05:30
Trishna Guha
2f60f97ee3 vyos_logging implementation module (#26654)
* vyos_logging implementation module

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

* vyos_logging integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-12 15:54:19 +05:30
Ricardo Carrillo Cruz
3f5736e14e Add vyos_l3_interface module (#26610)
* Add vyos_l3_interface module

* Add integration tests for vyos_l3_interface

* Add more corner cases in tests and fix multiple IPs logic
2017-07-12 08:40:26 +02:00
jctanner
10fc4417f7 vmware_guest: use the datacenter as a context for clone specs (#26511)
* Slight refactor on vmware_guest to fix path searching and vcsim compatibility.
* Clean up pep8 errors
* Fix more pep8 issues
* Add assertions
* Remove debug failure
* Update docsting for folder with examples
* Revise _get_vm_prop based on suggestions
* Implement folder walker to find a folder path
* More enhancements for datacenter->datacenter cloning
* Fix a few pep8 issues
* Remove useless check for subclass of None
* Fix a few suggestions
* Move serialize_spec to a util function
* Group exceptions together

Fixes #25011
2017-07-11 23:07:00 -04:00
Tomas Tomecek
5b898a7732 add connection plugin for buildah (#26170)
* add connection plugin for buildah

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fixup

 * create a method to invoke buildah
 * mount container filesystem persistently so we can access it
   during put and fetch
 * use copyfile function for copying files

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* revert tests

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fixup

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* progress

(this will be squashed into a single commit before merge)

 * add docs for the conn plugin
 * fix issue invoking the integration tests
 * add a way to invoke commands inside the container as a different user

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>

* fix shellcheck warning

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2017-07-11 22:36:25 -04:00
Peter Sprygada
63fe40c691 fixes issue when creating instance of NetworkConfig (#26665) 2017-07-11 21:28:35 -04:00
Hagai Kariti
a2d4e083f1 ec2_vpc_route_table doc fix: 'subnets' isn't required (#26656) 2017-07-12 10:39:11 +10:00
Peter Sprygada
0b6f0e6c0d adds more intelligent save logic and diff to network config modules (#26565)
* adds more intelligent save logic and diff to network config modules

* adds sha1 property to NetworkConfig
* adds new argument save_when to argument_spec
* adds new argument diff_against to argument_spec
* adds new argument intended_config to argument_spec
* renames config argument to running_config with alias to config
* deprecates the use of the save argument
* before and after now work with src argument
* misc module clean

Modules updated
* nxos_config
* ios_config
* eos_config

Most notably this makes the save mechanism more intelligent for config
modules for devices that need to copy the ephemeral config to
non-volatile storage.

The diff_against argument allows the playbook task to control what the
device's running-config is diff'ed against. By default it will return
the diff of the startup-config.

* removes ios_config from pep8/legacy_files.txt

* extends the ignore lines argument to the module

* clean up CI errors

* add missing list brackets

* fixes typo

* fixes unit test cases

* remove last line break when returning config contents

* encode config string to bytes before hashing

* fix typo

* addresses feedback in PR

* update unit test cases
2017-07-11 20:34:20 -04:00
Brian Coca
dc4037e5a7 more documented settings 2017-07-11 19:43:59 -04:00
Rene Moser
dd9e6e9623 cloudstack: cs_iso: extend returns 2017-07-12 00:49:37 +02:00
Rene Moser
64643c4e7d cloudstack: cs_iso: add cross_zone param 2017-07-12 00:49:37 +02:00
Rene Moser
31d530d6af cloudstack: cs_iso: add display_text param 2017-07-12 00:49:37 +02:00
Rene Moser
3dc379c89d cloudstack: cs_iso: add update support, fixes pep8 2017-07-12 00:49:37 +02:00
René Moser
0391ac6ece fix pep8, fixes build (#26660) 2017-07-12 00:26:59 +02:00
Toshio Kuratomi
da540b5c48 Properly export the public portions of module_utils.aws.core 2017-07-11 14:07:06 -07:00
mikedlr
07a4079a81 aws.core in new aws dir in module utils - module with AnsibleAWSModule class and fail_json_aws (#25780)
* aws module utils including AnsibleAWSModule
* fail_json_aws method on AnsibleAWSModule to do fail_json nicely with AWS exceptions
* aws module util - feedback - rename to aws/core.py & improve doc strings
2017-07-11 14:01:35 -07:00
Dag Wieers
8a1ad92cb8 command: Remove executable parameter when using command
This was discussed with the core team and removing this option was preferred.
For backward compatibility we accept the parameter, but warn the user instead.
2017-07-11 13:34:46 -07:00
Brian Coca
661b2c5beb allow implicit host to be grouped (#26614)
* allow implicit host to be grouped

also optimized patternmatching

fixes #24156

* resolved a great crime
2017-07-11 15:51:39 -04:00
Jason DeTiberus
d173217833 cloud: gce: Allow specifying scopes by URI (#25074)
Previously the gce module would only allow scopes to be specified by
alias, this adds support for specifying scopes by full URI, however
validation is limited to just ensuring the URI begins with:
https://www.googleapis.com/auth
2017-07-11 15:12:10 -04:00
Adrian Likins
06d70ad95a Include found python and version in SSL_CONTEXT warning. (#24252)
Based on issue 23642, add some info about the used python
executable and version to the error message when ssl connection
fail in a way that may be related to the version.
2017-07-11 14:29:01 -04:00
Adrian Likins
261c40bac7 Fix azure module use of module_utils.facts (#25318)
Module was importing '*' from facts to get to TimeoutError
but that has moved to facts.timeout, so import is updated.

Also rm old style imports to new style imports at the start
of the module.

'signal' py module was used and referenced but never imported,
presumably it was using the 'signal' previously imported into
module_utils.facts. Now imported directly.

'AnsibleModule' was also from a * import, so now imported directly.

A ref to 'module' was in _delete_disks_when_detached(), so now it
is updated to raise an AzureException() with its message, and
let its caller catch it and call module.fail_json()
2017-07-11 14:07:20 -04:00
Adrian Likins
dc75bc06d9 Fix for linode module requiring name for state=restarted (untested, rebased, migrated) (#24827)
* Rm check for unused 'name' arg for restarted.

The module docs claim 'name' is not required for
restarted state, and the code doesn't seem to use
it is.

* Better error msg for linode 'restarted' state.

* Remove the eval() and loop over args.

* Fix use of eval(args), and cleanups.

* linode 'stopped' state doesnt need name either

Fixes #3873
2017-07-11 14:05:07 -04:00
Ricardo Carrillo Cruz
b81209c187 Fix multiple EOS EAPI code and test issues (#26651) 2017-07-11 19:28:33 +02:00
Brian Coca
035b4b95b0 booleanize value for ternary 2017-07-11 13:05:27 -04:00
Manuvaldi
3ff67fc217 hashi_vault module - Add verify param to support ssl Vault (#25159)
* Fix conflic with HVAC library check

* Fix pep8 error

* hashi_vault add validate_certs parameter
2017-07-11 12:17:04 -04:00
Adrian Likins
0fc0b6f059 Mv AnsibleFactCollector back to module_utils (#26150)
It was in lib/ansible/modules/system/setup.py since it
was the only thing using it, but move it back to module_utils
and add a ansible_collector.get_ansible_collector() to build
a facts collector just like the one used by setup.py

mv test_setup.py -> test_ansible_collector.py
All the code it was testing is now in ansible_collector

rm code to create 'ansible_facts' subkey from namespace

Just leave it up to the caller to do, and just return a
flat dictionary from AnsibleFactCollector.collect()
2017-07-11 10:44:22 -04:00
Michael De La Rue
43989d35b7 Mdd utils ec2 no profile fix (#26528)
* Handle boto.provider.ProfileNotFoundError when doing connect_to_aws
2017-07-11 14:41:02 +10:00
Ganesh Nalawade
be89ef3eb6 junos_linkagg implementation and junos modules refactor (#26587)
* junos_linkagg implementation and junos modules refactor

*  junos_linkagg implementation
*  junos_linkagg integration test
*  net_linkagg integration test for junos
*  decouple `load_config` and `commit` operations,
   to allow single commit (in case on confirm commit) and
   to perform batch commit (multiple `load_config` followed by single
   `commit`)
*  Other related refactor

* Fix CI issues

* Fix unit test failure
2017-07-11 09:52:53 +05:30
Jordan Borean
81c22522a5 win_acl: registry support for special service accounts (#26629)
* Fixes #22968
* `APPLICATION PACKAGE AUTHORITY` ACLs also apply to the registry

* fixed nested for loop
2017-07-11 10:01:55 +10:00
Ryan Brown
aa3975e084 [cloud] Stop CloudFormation module from always making changesets (#26619)
In Python a function is always truthy, and the name of the
`create_changeset` function was being accidentally used instead of
`module.params['changeset']`.
2017-07-10 16:57:37 -04:00
Anders Ingemann
f018851303 sensu_subscription: Fix return type for 2 cases (#26546)
state=absent would cause errors in 2 cases resulting in the error:
"TypeError: 'bool' object is not iterable"
2017-07-10 15:07:25 -04:00
James Andrewartha
2e6ff97d06 Detect UEFI VMware guests (#26590)
VMware provides a different DMI product name for VMs booted via UEFI vs BIOS.

VMware provides a different DMI product name for VMs booted via UEFI ('VMware7,1') vs BIOS ('VMware Virtual Platform')

Fixes #26517
2017-07-10 14:08:59 -04:00
Dag Wieers
05e5698472 powershell.ps1: Validate Windows paths (#26488)
During the writing of Windows path integration tests we discovered that
incorrect paths (including escape sequences) cause very cryptic error
messages.

This fix ensures that invalid paths cause a proper error message.

We also had to fix the following modules:
- win_shortcut: `src` can be a URL
2017-07-10 10:45:16 -07:00
Tim Rupp
c0fc79647a Fixes variable usage for api reconnect method. (#26553) 2017-07-10 18:41:07 +01:00
Thomas Stringer
8026ef57fe remove option checking for azure vm sizes (enum will not contain all) as well as default and start requiring the vm_size param (#24406) 2017-07-10 12:54:39 -04:00
Ganesh Nalawade
8c7a6cb8ac Add transformed json output in junos_command (#26382)
* Add transformed json output in junos_command

Fixes #26363
If the display is in `xml` format for command responses
add th transformed `json` output in the result.

* Fix CI issue
2017-07-10 10:35:28 -06:00
James Mighion
58ade65ea6 Adding admin option for iosxr_config (#26509)
* Adding admin option for iosxr_config. Adding unit test for new admin option for iosxr_config. Fixes #24308

* Removing space on empty line.
2017-07-10 10:22:45 -06:00
Ken Evensen
f31d3ddeb7 Pamd Updates (#25817)
* Fix for #25522
Fix for #25855
Fix for #23963

* Minor fix

* Updates per bcoca.  Fix in regex for silvinux.
2017-07-10 11:41:01 -04:00
Trishna Guha
07498ebed3 fix nxos_overlay_global (#26422)
* fix nxos_overlay_global

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

* swap check_mode with candidate

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-10 18:53:52 +05:30
Trishna Guha
b81882e2a8 vyos_static_route implementation module (#26426)
* vyos_static_route implementation module

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

* Add vyos_static_route implementation module

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

* unit test

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

* modify vyos_static_route

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

* integration test vyos_static and net_static_route

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

* fix typo integration test

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

* modify vyos_static_route

* modify integration test

* vyos_static_route doc build fix

* fix integration test data

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

* update net_static_route cli test set

* minor fix
2017-07-10 16:34:56 +05:30
Josh Moore
d5ae6cc585 postgres_db: add dump and restore support (#20627)
* Feature #2731: added postgres import and dump

* Feature #2731: be more permissive of arguments

```
hacking/test-module -m ./ppostgresql_db.py -a "db=example state=dump target=/tmp/out"`
```

failed previously since host, user, and port were required as keywords
in the pg_dump / pg_import methods.

* Feature #2731: fixed doc string for validate-modules

```
$ ansible-validate-modules database/postgresql/
```

now passes.

* Feature #2731: disable 'password' for dump/restore

* Feature #2731: bump added version to 2.3

* Feature #2731: replace db_import with db_restore

* Feature #2731: add missing version description

* Feature #2731: fix 'state' description

* Feature #2731: fix pep8 issues

* Feature #2731: put state documentation in a single string

* Bump added version from 2.3 to 2.4

* Fix pep8 and pylint errors

* Attempt yaml formatting of documentation string

* Add integration tests for postgres_db:dump/restore

* Update dump/restore logic to support new kw-args

Also attempt to support password; integration tests are
still failing.

* Revert to postgres user for dump/restore

Passing PGPASSWORD is not working for subprocesses. For the
moment, reverting to the strategy of failing if login_password
is set and using `postgres` for all testing of dump/restore.

* Various cleanups to have tests passing

* Working tests for {sql,tar} x {,bz2,gz,xz}

* Use pg_user to support FreeBSD

* Revert login_ prefixes and re-enable password support

All `login_` keywords are mapped to their non-prefix versions
so the previous changes were effectively using `postgres` for
all actions. With the proper keywords, PGPASSWORD-passing to
the subprocess is now working.

* Optionally add password

environ_update doesn't handle None values in the
dictionary to be added to the environment. Adding
check.

* Quick fixes

* Refactor login arguments after fixes from pchauncey

The fixes introduced by pchaunchy pointed to further issues
(like no --dbname on PG<=9.2) with the login parameters. This
refactors them and adds further tests.

Note: this will still not pass integration tests due to a further
      issue with pg_dump as a non-admin user:

      pg_restore: [archiver (db)] Error while PROCESSING TOC:
      pg_restore: [archiver (db)] Error from TOC entry 1925; 0 0 COMMENT EXTENSION plpgsql
      pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql

* Introduce target_opts for passing limiting dumped/restored schemas

The current integration tests (PG version and template DBs) don't
permit a regular user (`{{ db_user1 }}`) access to plpgsql causing
restores to fail. By adding an option for passing arbitrary args to
pg_dump and pg_restore, testing is made easier. This also paves the
way for `-j` usage, once the PG version is bumped.
2017-07-10 08:05:42 +01:00
Alex
2eee5b2291 New module: gunicorn (#26206)
* add gunicorn module

* fixed types in docs

* Removed unsuported type from documentation
2017-07-10 07:36:43 +01:00
Jonathan Davila
e96f8f2a0b fix issue with nmcli not parsing vars properly (#22095) 2017-07-10 07:30:02 +01:00
Tim Rupp
37ca55bf71 Adds missing fields for iapp service (#26507)
The iApp service module worked fine previously, but this patch
adds enhancements to it to include more fields that can be
specified when creating iapp services.
2017-07-10 07:27:49 +01:00
jhawkesworth
deae1499ed win_get_url improvements; allow dir for dest and helpful error if dest parent dir doesn't exist (#25453)
* win_get_url now allows dir for destination and gives helpful message if download parent dir does not exist

* fix yaml lint failure
2017-07-10 14:30:55 +10:00
Dag Wieers
e6ecc1285c win_chocolatey: Add -skip-scripts support (#26523)
This PR includes:
- A new parameter `skip_scripts` to disable running scripts
- Documentation fixes (wrt. booleans)
2017-07-10 14:20:06 +10:00
Andrew Saraceni
7d3951d065 win_scheduled_task: Add enhanced run option support (#24174)
* add enhanced run option support for win_scheduled_task

* changed run_level option to runlevel

* correct merge conflicts since task path fix

* changed run_level option to runlevel

* changed do_not_store_password to store_password, and other minor fixes

* conditional logic swap, and documentation change for password
2017-07-10 14:18:17 +10:00
Dag Wieers
52c1a1936d win_wakeonlan: New module to send Wake-On-Lan packets (#26232)
This is the Windows implementation of the **wakeonlan** module.
Useful if you want to wake up systems in a remote network with only
Windows systems.
2017-07-10 07:15:22 +10:00
René Moser
3050856f2a cloudstack: cs_instancegroup: fix pep8 (#26534) 2017-07-07 19:08:39 +02:00
Karim BEN YOUSSEF
804f40f7a5 script: Add support for chdir argument 2017-07-07 09:40:02 -07:00
Michael De La Rue
3c4db1e8dd Mdd psql user aws fix (#23988)
* postgresql_user module - transaction logic hacks to allow recovery from failed select

* postgresql_user - PEP8 and style fixes to make debugging easier

* postgresql_user - move password changing logic to separate function

* postgresql_user - trap failure in case where there is no access to pg_authid

* postgresql_user - further PEP8 fixes

* postgresql_user - Simplify password change logic and improve imports according to suggestions from PR review

* postgresql_user - Eliminate pep8/blank line errors introduced in merge

* Check behaviour when pg_authid relation isn't readable

TASK [postgresql : Normal user isn't allowed to access pg_authid relation:
      password comparison will fail, password will be updated] ***
An exception occurred during task execution. To see the full traceback,
use -vvv. The error was: psycopg2.ProgrammingError: permission denied
for relation pg_authid

* Don't reintroduce passlib, remove useless query
2017-07-07 09:28:31 -07:00
Daniel Parker
800de2b0ce [cloud] Adds custom serverless binary path option to the serverless module (#26304) 2017-07-07 11:08:26 -04:00
Rene Moser
4183d77c70 cloudstack: cs_instance_nic: add ip_address param 2017-07-07 16:50:57 +02:00
Adrian Likins
1cad0074f5 code cleanup and error improvement for hashi_vault (#17824)
Use standard import error handling.
Make error messages more specific.
Use more python idiomatic code.
2017-07-07 10:17:18 -04:00
Marc-Aurèle Brothier
ee8ce99bed cloudstack: add nic operation (#26168)
* CloudStack: Remove networkid parameter in global list

* New module for CloudStack VM's Nic

Closes #25911

* Review changes
2017-07-07 13:41:59 +02:00
Dag Wieers
f8982dcbd0 wakeonlan: Add integration tests and improvements (#26254)
This PR includes:
- Checkmode improvements
- Integration tests
- A fix for python3
- PEP8 fixes

This backports improvements from the win_wakeonlan module.
2017-07-07 10:52:02 +01:00
Ganesh Nalawade
ba60ac04fc Implementation of junos_static_route module (#26501)
* Implementation of junos_static_route module

*  junos implementation of net_static_route
*  integration test for junos_static_route
*  integration test for junos net_static_route

* Minor change

* Doc change

* Fix CI issue
2017-07-07 13:25:14 +05:30
René Moser
63f4aa3069 cloudstack: cs_host: add state maintenance (#26502) 2017-07-07 08:33:26 +02:00
Toshio Kuratomi
5ceabe939d Fix the pause module for python3
* On python3, stdin goes through a buffer that translates from raw bytes
  to text.  this interferes with pause as it (1) performs universal
  newline conversion and therefore '\r' is turned into '\n' and (2) the
  buffering prevents us from getting the typed characters immediately
  (possibly a python3 bug?)  Using the raw byte stream that's behind the
  text decoder fixes these problems.

Unrelated cleanups:
* Use to_text instead of str for conversion into strings to avoid possible tracebacks
* Use either \r or \n as the end of a line.

Fixes #26278
Resolves #26446
2017-07-06 19:21:42 -07:00
Brian Coca
9fc6f85473 added some docs to config entries 2017-07-06 20:22:05 -04:00
Hari Krishna Dara
fb7ef488f5 Clarify how formatting would be done. (#26474)
The current description doesn't say this, so there a chance for the user to think that Jinja formatting is what can be used.
2017-07-06 22:41:08 +02:00
champtar
f25637e07a openwrt_init / opkg: clearly state that python is required (#26471)
* openwrt_init: clearly state that python is required

As python isn't installed by default on OpenWrt/LEDE,
clearly state that python is required

Signed-off-by: Etienne CHAMPETIER <echampetier@anevia.com>

* opkg: clearly state that python is required

As python isn't installed by default on OpenWrt/LEDE,
clearly state that python is required

Signed-off-by: Etienne CHAMPETIER <echampetier@anevia.com>
2017-07-06 16:30:06 -04:00
Ricardo Carrillo Cruz
83253cd8f0 Add net_l3_interface vendor neutral module (#26484)
* Add net_l3_interface vendor neutral module

* Fix pep8 issue
2017-07-06 21:02:25 +02:00
Ganesh Nalawade
10233ef3b5 junos_user declarative module changes (#26475)
* junos_user declarative module changes

*  Active/Deactivate support
*  junos_user integration test
*  net_user intergration test for junos

* Add version_added for active param
2017-07-06 21:57:12 +05:30
Trishna Guha
c5fb4bbcc0 Fix nxos_switchport and unit test (#26131)
* fix nxos_switchport

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

* nxos_switchport unit test

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

* legacy file

* update unit test

* handle exception
2017-07-06 18:58:36 +05:30
Chris Houseknecht
6af53cf0ef Adds docker_secret module (#26469) 2017-07-06 09:22:04 -04:00
Ricardo Carrillo Cruz
5acebc124a Add vendor neutral parameter fail_on_missing_module (#26482)
By default, the vendor neutral modules will just go on if no
implementation module is found.
If user specifies the task argument fail_on_missing_module and
sets it to True, then we bail out the play early and report that
to the user.
2017-07-06 14:10:29 +02:00
Ricardo Carrillo Cruz
8b0e052b88 Add missing net_linkagg action plugin (#26477) 2017-07-06 11:12:05 +02:00
Abhijeet Kasurde
3004c913e6 Pep8 fixes for opendj_backendprop_* (#24587)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-06 09:50:26 +01:00
Ricardo Carrillo Cruz
c73275b4b8 Add vyos_linkagg module (#26418)
* Add vyos_linkagg module

* Add vyos_linkagg integration tests

* Fix pep8 issue

* Address several review comments
2017-07-06 10:07:48 +02:00
James Mighion
e785cc53db Adding stderr regex catch for iosxr commit failures. Adding error handling after executing commit command. (#26462) 2017-07-06 09:19:24 +05:30
Matt Clay
895e6c5d06 Fix wait_for with newer versions of psutil. (#26455)
* Add support for newer psutil versions.
* Fix psutil install in wait_for integration test.
* Fix test requirements for wait_for elapsed.
2017-07-05 19:00:13 -07:00
Brian Coca
2a041d10d2 better backwards compat handling of status
restored 'rc' inspection but only when failed is not specified
removed redundant changed from basic.py as task_executor already adds
removed redundant filters, they are tests
added aliases to tests removed from filters
fixed test to new rc handling
2017-07-05 21:44:00 -04:00
Dag Wieers
37508fde5f win_get_url: Replace skip_certificate_validation with validate_certs (#26464)
This is part of the effort to make win_get_url parameters conform to
other modules. The option `validate_certs` is the common option for
this.

See also #20160
2017-07-05 16:56:43 -07:00
Chris Houseknecht
e2b340dfe0 Adds search in template/files/vars relative to the playbook path (#26460) 2017-07-05 19:45:09 -04:00
Toshio Kuratomi
cf5fb0acdf Do not escape backslashes when using the template lookup plugin
This brings the lookup plugin inline with what the template module does.

Fixes #26397
2017-07-05 16:39:20 -07:00
Jean-Frédéric
23041c3b6c Fix error with meta: clear_facts (#26406)
Using `meta: clear_facts` was failing with
`coercing to Unicode: need string or buffer, Host found`

This applies the same fix as 3101e24.

Fixes #26405
2017-07-05 19:20:18 -04:00
Brian Coca
02311604c9 removed logger from paramiko
(cherry picked from commit 9b7dfd5945ec1ab329e288493b6962d4e8c33fa0)
2017-07-05 18:09:40 -04:00
Nathaniel Case
28c6b226c7 ansible-connection Python3 fix (#26441)
* Fix a number of unicode <-> bytes mismatches

* Return socket_path as text, not bytes

* Docstring run()
2017-07-05 14:07:26 -04:00
Matt Davis
08af853ee9 fix win_shell/win_command nonzero RC failure setting (#26443)
* as a result of recent core engine changes to ignore rc, modules are responsible to set `failed` on nonzero RC if they want that behavior
* the `failed` filter currently triggers on nonzero RC, which caused the tests to false-pass
* updated tests to explicitly check both rc and failed keys, as well as using the failed filter.
2017-07-05 10:05:07 -07:00
James Mighion
1d62283796 Making iosxr check_args call module_util/iosxr check_args. Fixes #25501 (#26261) 2017-07-05 22:20:53 +05:30
saichint
5229370364 fix for nxos_acl_interface idempotency (#26156)
* fix for nxos_acl_interface idempotency

* shippable error fix

* fix issues with python3.x
2017-07-05 12:05:47 -04:00
Dag Wieers
f2ce2d2199 imc_xml: Use the correct response in error message (#26435) 2017-07-05 16:12:21 +01:00
Abhijeet Kasurde
613327d47a Add missing keyword args in aix_inittab (#26423)
fail_json fails if msg is not provided.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-05 16:02:53 +01:00
James Cammarata
95a0fe37da UserKnownHostsFile=/dev/null when verify_host: false
This is a new fix to replace #20361 due to the synchronize module changing
sufficiently to make that commit no longer merge cleanly.

Fixes #20361
Related to #20311
2017-07-05 09:42:04 -05:00
Will Thames
f8d522de69 Support check mode for efs_facts (#26273)
Facts modules support check mode by default

Fix pep8 compliance
2017-07-05 15:06:08 +02:00
Ganesh Nalawade
e612d0be12 Add net_l2_interface platform agnostic module (#26410)
* Add net_l2_interface platform agnostic module

*  net_l2_interface module definition
*  net_l2_interface action plugin

* Fix CI issue
2017-07-05 11:15:19 +05:30
Dag Wieers
b9d018885a win_chocolatey: Ensure chocolatey to fail (#26416)
Currently chocolatey is not failing when the user requests version X,
but version X is not available in the repository.

Obviously the module should fail in this case.

This fixes #25393
2017-07-05 08:20:20 +10:00
Jordan Borean
8e9d04043a win_regedit: fix for same dword value (#26415) 2017-07-05 08:17:49 +10:00
Dag Wieers
69ade22243 win_chocolatey: Fix updating 'all' packages (#26417)
This fixes #15018
2017-07-05 08:04:30 +10:00
Ganesh Nalawade
1a9b0ae731 Remove xml return for junos declarative modules (#26400)
*  Remove xml return
*  Add diff return
*  Related doc changes
2017-07-04 21:49:26 +05:30
René Moser
c1ac55147f haproxy: docs: add version added for state=drain (#26396) 2017-07-04 16:26:18 +02:00
Rene Moser
37b22673fb cloudstack: cs_instance: fix KeyError: 'sshkeypair' 2017-07-04 15:58:21 +02:00
Jakub Jursa
5fafe4c672 openstack: os_volume: add optional scheduler_hints param (#26090)
* openstack: os_volume: add optional scheduler_hints param

* openstack: os_volume: scheduler_hints version_added fix

* openstack: os_volume: fixed codestyle
2017-07-04 11:51:07 +02:00
Trishna Guha
ad3fe08aae fix vyos_banner multiline string issue (#26383)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-04 14:31:18 +05:30
zzaa
df0864d801 haproxy: Add new drained state (#25115) 2017-07-04 10:33:32 +02:00
Toshio Kuratomi
996281d748 Remove metadata from docstring parsing as per last week's meeting decision 2017-07-04 01:12:43 -07:00
Toshio Kuratomi
3ee997b720 metadata and doc generator optimization and fixes
* Fix ansible-doc traceback when a plugin doesn't parse correctly
* Change extract_metadata ivocation to take either an ast or source
  code.  When given source code, it can find file offsets for the start
  and end of dict.  When given the ast, it is quicker as it doesn't have
  to reparse the source.  Requires changing the call to the function to
  use a keyword arg.
* Fix reading of metadata to find the last occurrence of
  ANSIBLE_METADATA instead of the first.
* Add some more unittests to get closer to complete coverage
2017-07-04 01:12:43 -07:00
Abhijeet Kasurde
785ed2cfc0 Multiple fixes in digital_ocean_tag module (#24361)
* Pep8 fixes
* Removed redundant check for name
* Check validity of api_token
* Don't report changed when tag is already present

Fixes #24265

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-04 08:04:49 +02:00
R. Soto
5c0c985547 update auth_flag variable after STARTTLS connection is established, fixes #26376 2017-07-03 23:07:47 -04:00
Matt Davis
0ee46cb0df converted become runas to explicit CreateProcessWithLogonW (#26378)
* fixes become_method: runas for unprivileged users
* sets permissions on tempdir appropriately
* allows automatic system environment generation for new token (old Process.Start way prevents this)
* add basic become runas tests
2017-07-03 17:46:27 -07:00
Brian Coca
1b727c372e igaffneypellz 2017-07-03 17:05:44 -04:00
Brian Coca
32fa4db232 add any_errors_fatal global config 2017-07-03 17:05:44 -04:00
Todd Hertel
e9447e9481 ec2_group fix TypeError bug #26291 2017-07-03 16:59:43 -04:00
Andreas Olsson
42408a97ea Correct doc about the Git module verify_commit param
All that is required to verify the signature is that the matching
public key is present in the remote user's keyring. There is no need
for GnuPG to explicitly trust the authenticity of the key.

Not Ansible specific, but rather the behavior of the `git verify-commit`
and the `git verify-tag` command line invocations.
2017-07-03 16:45:05 -04:00
Michael Scherer
bda066f6f6 Fix exception when using masquerade
The following snippet:

  - name: Let the DMZ connect to internet
  firewalld:
    zone: dmz
    masquerade: True
    permanent: True
    immediate: True
    state: enabled

will fail with this error message:

  Exception caught: set_masquerade_enabled() takes 1 positional argument but 3 were given

It turn out that it treat 'zone' as a array of string instead of 1 string.
I only tested on Python 3 with a Fedora 25.
2017-07-03 16:43:44 -04:00
Yanis Guenane
88099e2acb openssl_privatekey: Add publickey fingerprint (#22202)
This commit adds the fingerprint of the public key in openssl_privatekey
and openssl_publickey returned values.

```
{
  "changed": false,
  "filename": "/tmp/cert.pem",
  "fingerprint": {
    "md5": "31:22:14:58:c6:b1:7b:2a:48:89:b5:02:43:0a:d7:88",
    "sha1": "ed:e5:59:ba:9b:98:5b:e1:01:ef:4b:eb:f0:d1:1d:ee:84:88:c7:78",
    "sha224": "e1:c0:a6:bd:20:30:40:5b:c0:32:14:4a:01:3c:4b:c3:8a:49:a5:1f:ed:39:75:a4:57:e6:93:87",
    "sha256": "8a:18:86:88:79:e5:57:ca:c3:3c:89:92:ae:54:7f:ac:94:12:e2:c7:aa:c2:7c:97:77:cb:e7:8b:5e:1f:af:28",
    "sha384": "7a:5d:c2:49:cc:84:f4:74:ed:76:c7:03:e5:8d:aa:3b:31:b0:ba:0e:29:d2:76:3c:0e:3c:e5:d2:fd:b4:36:b1:70:b5:a6:bb:17:f4:db:ac:d6:75:81:36:42:dd:61:0c",
    "sha512": "da:0a:14:52:c6:c0:ab:fa:52:55:2a:85:65:35:7a:f6:5d:95:1d:d3:95:ae:bd:b9:d8:e0:75:dd:4f:0c:c9:3c:59:82:64:fa:d8:50:26:4f:b7:3a:5d:e8:6f:5d:de:9a:fe:ef:c2:c8:57:9d:e3:c0:c9:dd:4a:a9:bd:7a:77:f3"
  },
  "size": 4096,
  "type": "RSA"
}
```
2017-07-03 20:46:45 +01:00
Brian Coca
8f758204cf correct, cleanup & simplify dwim stack (#25956)
* correct, cleanup & simplify dwim stack

latlh chIS logh HeS qar wej chel laD
better errors
update find_file to new exception

* addressed latest comments

* test should not use realpath as it follows symlink

this fails when on OS X as /var is now a symlink to /private/var
but first_found was not supposed to follow symlinks
2017-07-03 15:27:53 -04:00
Abhijeet Kasurde
ec6e3b0e32 Handle errors gracefully in vmware_guest_snapshot (#25727)
CreateSnapshot may fail with several exceptions. This
fix generically handles these exceptions.

Fixes #21121

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-03 13:39:29 -04:00
Abhijeet Kasurde
29f5fe3ddd Resolve module correctly (#25658)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-03 11:36:42 -04:00
Yanis Guenane
ed15a0e9a7 Remove get_exception from crypto namespace
Fix removes get_exception in favor of native Python exception
handling. Also, added to_native to manage exception message.
2017-07-03 08:30:36 -07:00
jctanner
db5c0b3b2b Use the new file content function post facts refactoring. (#26353)
* Use the new file content function post facts refactoring.

Fixes #26339

* Do not make new abstraction ... use the real function

* Fix pep8 error
2017-07-03 10:35:17 -04:00
Ganesh Nalawade
11e72d495d Add net_logging platform agnostic module and junos implementation (#26316)
* Add net_logging platform agnostic module and junos implemenatation

*  net_logging platform agnostic module
*  junos implemenatation of logging module
*  net_logging integration test
*  junos_logging integration test
2017-07-03 15:31:59 +05:30
Ricardo Carrillo Cruz
4869a7b0ac Add net_linkagg platform agnostic module (#26341) 2017-07-03 11:50:14 +02:00
Trishna Guha
1b427aa419 Fix vyos banner idempotent (#26338)
* fix vyos_banner idempotent

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

* fix vyos_banner unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-03 13:08:08 +05:30
Wil Tan
483346d94b Fix win_nssm credentials quoting (#26226) (#26228)
Quote password to avoid Powershell special characters being interpreted.
2017-07-03 09:06:23 +10:00
dupondje
46514de5e6 Fix version_added for new option in template introduced in #21846 (#26302) 2017-06-30 22:58:56 +02:00
Brian Coca
4361659bee correctly deal with encoding in errors
fixes #26256
2017-06-30 14:40:38 -04:00
Denis Afonso
c9b00d2f02 Fixed the exception handling logic for the delete_group function. (#26109)
* Fixed he exception handling logic for the delete_group function.

fixes issue #26100

* Removed the unnecessary del_meta variables and made some other adjustments to the delete_user function
2017-06-30 14:12:50 -04:00
Abhijeet Kasurde
611fbea8ea Support quiesce, memory in vmware guest snapshot (#26275)
Fix adds support for quiesce and memory options while taking
snapshot of virtual machine. Update documentation and examples
for reflecting this change.

Fixes #26270

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 12:34:37 -04:00
Abhijeet Kasurde
f0a5854e39 Fix unresolved import in vmware module_utils (#25288)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 10:28:08 -04:00
Abhijeet Kasurde
5c374cd1ae Add Test Suite for vmware_vswitch (#26076)
Fix adds test suite for vwmare_switch

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 10:18:20 -04:00
Trishna Guha
93bbcd8a32 vyos_user fix idempotent (#26289)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-30 19:44:08 +05:30
Toshio Kuratomi
34589cee6d Unittests for extracting metadata from plugins (#26218)
* Unittests for extracting metadata from plugins
* Port plugin_docs to use the generic extract_metadata function
* Make the helper functions seek_end_of{string,dict} private
2017-06-30 06:48:32 -07:00
Will Thames
7ae4027c58 Improve ec2_vpc_subnet check mode (#23108)
check_mode should behave pretty similarly to non-check mode -
just don't actually create or delete subnets or change tags.

Using DryRun for check_mode behaves very differently and results
in the following module failure:

```
"msg": "Unable to update tags for subnet-abcd1234,
error: EC2ResponseError: 412 Precondition Failed
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Response><Errors><Error><Code>DryRunOperation</Code>
<Message>Request would have succeeded, but DryRun flag
is set.</Message></Error></Errors>
<RequestID>12345678-abcd-1234-abcd-abcd1234abcd</RequestID></Response>"
```
2017-06-30 08:04:48 -04:00
Vinay Dandekar
c884d4ab7f Add support for EC2 dynamic data in ec2_facts (#21532)
* Add support for EC2 dynamic data in ec2_facts

- Flattens out JSON in the instance identity document and IAM info/credentials for easy access to facts
- This changes region fact from ‘ansible_ec2_placement_region’ to ’ansible_ec2_instance_identity_document_region’

* Maintain backwards compatibility by putting the region into the old key

* Improve JSON parsing logic and split security group IDs

* Add documentation, backwards compatibility, fix bug and formatting

- Update documentation for ec2_facts with return values
- Preserve JSON value from the metadata service for backwards compatibility
- Fix bug in fix_invalid_varnames
  - The keys in the dict were being modified in place; new dict now created to hold the sanitized keys
  - Consolidate two replace calls with a regex substitution
- Move imports for ec2_facts to the top

* Add support for parsing the IAM instance profile role
2017-06-30 16:27:49 +10:00
Rob
d1652aecf0 Upgrade ec2_remote_facts to use boto3 (#22937)
* Deprecate ec2_remote_facts in favor of ec2_instance_facts which uses boto3

* Update legacy-files.txt with deprecated file name change
2017-06-30 14:19:08 +10:00
Deepakkothandan
a396c18a61 composer: add param for custom PHP Executable path (#26107) 2017-06-29 23:08:30 +02:00
Sam Doran
6b49fca7e5 Clarify docs for set_stats module (#26250)
Fixes #26191
2017-06-29 13:29:12 -07:00
Mike Wiebe
240de965ee Fix nxos_acl module and add IT tests (#25966)
* Fix nxos_acl module and add IT tests

* Add nxos_acl test

* Add additional properties to test
2017-06-29 14:55:08 -04:00
Duncan Lock
6d7647be54 yum: added example for exclude parameter. (#26216)
* Added example for `exclude` parameter.

* Remove trailing whitespace
2017-06-29 11:21:49 -07:00
René Moser
363761fc16 cloudstack: cs_template: default is_routing=None, fixes template upload for users (#26248) 2017-06-29 17:43:31 +02:00
Raja
171d903d04 Fix Python3 Errors in Azure Cloud Module
When using Python3, the exec_module function errors out with a
unsupported operand type(s) for +: 'dict_keys' and 'list'
error when adding the .keys() to a static list. Use the explicit
list function to make a list of keys and then add to the ['tags'] list.
2017-06-29 08:30:26 -07:00
Nathaniel Case
3102746ebe nxos_pim_rp_address fixes (#26119)
* nxos_pim_rp_address tests

* nxos_pim_rp_address changes

* Address issues with idempotence
2017-06-29 10:22:26 -04:00
Julien Vey
7f6c7c6334 parted: Add missing LC_TYPE override for env vars (#26242) 2017-06-29 15:55:03 +02:00
Brandon Davidson
7bb3467db9 Convert ec2_vpc_subnet module to boto3 and add map_public option. (#23783) 2017-06-29 23:39:21 +10:00
Sloane Hertel
338bf0fd3f ec2_vpc_dhcp_options_facts: if tags don't exist set them to default list instead of crashing - fixes #23825 (#23967)
* if tags don't exist set them to an empty list

* dhcp_option will always have a name tag

* make requested change
2017-06-29 22:47:05 +10:00
Ondra Machacek
0154f32fbd cloud: ovirt_disks: Fix download of the qcow disk (#26179)
Fixes: #26177
2017-06-29 08:15:26 -04:00
John R Barker
1b00f4193b Move net_* modules into specific sub-topics (#26234)
As we continue to expand the number of modules we must ensure they are
sensibly grouped.
2017-06-29 13:04:33 +01:00
Ricardo Carrillo Cruz
c8ba8bdd6d Add ios_static_route module (#25527)
* Add ios_static_route module

* Add ios_static_route integration tests

* Add platform agnostic integration tests for IOS

* Replace unicode function to ansible module_utils to_text

* Add collections handling logic

* Add integration tests for collections

* Make collections and prefix mutually exclusive

* Add net_static_route integration tests for collections

* Do not store load_config return value, as it returns nothing
2017-06-29 12:05:20 +02:00
Ganesh Nalawade
911a7e085e Add active param to junos declarative modules (#26222)
*  active/deactivate configuration capability
*  integration test refactor
2017-06-29 10:18:35 +05:30
Daniel Kozlowski
dcd1ff2809 Initial commit of iam_managed_policy file (#22097)
This module can add, remove, update versions, and set default versions
of managed policies. It will cycle out old versions of policies if too
many are present. It will check and set the version of the policy that
matches the pased in policy document if one already exists.

Incorporating changes from PR

Descriptions now have full stops, and pep8 error has been
addressed. Also added requirements, author, and updated interface to
"preview"

Additional change to pass CI

Previous commit added in some whitespace errors. Additinoally added
correct value for version_added, added in a RETURN block for
documentation, and moved import to top of file

Fixed error detaching policy from users

Updates to pass 2.4 CI

Updating iam_managed_policy supporting feedback
2017-06-29 12:08:27 +10:00
rip777
4e54df71a2 Further iam_group improvements
added `purge_users` and `purge_policy` option
added `convert_friendly_names_to_arns` function
flake8 fixes
2017-06-29 11:38:49 +10:00
Nick Aslanidis
dc8a05dfe2 New AWS module for managing IAM groups 2017-06-29 11:38:48 +10:00
Toshio Kuratomi
e27c2860e7 Move metadata extraction into a library function (#26198)
* Move metadata extraction into a library function
* fix the string cases to throw NotImplementedError
* Some python3 fixes
2017-06-28 18:10:26 -07:00
Toshio Kuratomi
6908038036 Fix synchronize setting user variable
The user variable stores whether we need to set user@ in our connection
string.  It's now being used at the toplevel of the run() method so the
default needs to be calculated further up the stack

Fixes #24910
2017-06-28 17:41:01 -07:00
Nathaniel Case
ad6c4a544e nxos_pim updates (#26145)
* nxos_pim tests

* Cleanup nxos_pim
2017-06-28 19:40:19 -04:00
Nathaniel Case
eea18e9875 nxos_vxlan_vtep_vni fixes (#25913)
* nxos_vxlan_vtep_vni first pass
* nxos_vxlan_vtep_vni tests
2017-06-28 19:38:31 -04:00
Matt Davis
69de9d86bd fix win_updates failure with dict-typed args (#26208)
Switch to dicts in common code caused silent failures during arg translation, so default values and non-check-mode were always used.
* fixes #23653
* fixes #24062
* fixes #22938
* fixes #25156
2017-06-28 16:36:53 -07:00
Phillip Thurston
a2f38de173 Corrected the examples in find module to make sure the commands are accurate to what is being described. 2017-06-28 18:17:22 -04:00
James Cammarata
4c72e98262 Squashed commit of the following:
commit f79beaa3b3b642c370552d63b0848195358bccd0
Author: James Cammarata <jimi@sngx.net>
Date:   Wed Jun 28 17:00:57 2017 -0500

    Add example for iptables using the policy option

commit 1a0f9debdb526bef9d8d469a84a8cc55ef68da03
Author: James Cammarata <jimi@sngx.net>
Date:   Wed Jun 28 16:59:52 2017 -0500

    Fix missing re import for iptables after merging #19476

commit 084479d21d
Author: Alexey Solodkiy <work@x1.by>
Date:   Sun Dec 18 12:07:05 2016 +0300

    fix #19476
2017-06-28 17:02:13 -05:00
Jordan Borean
98fc54f02d win_find: fix for empty nested directories (#26164) 2017-06-29 07:06:10 +10:00
Dag Wieers
0a15ab7ce9 win_say: Fix issue, add integration tests (#26089)
* win_say: Fix issue, add integration test

This PR includes:
- Make speed_speech an integer parameter
- Test for empty parameters too
- Add integration tests

* Improve the $speech_speed parameter handling

As requested
2017-06-29 06:28:44 +10:00
Tomas Tomecek
2683c36a01 plugins,action: log stderr output if verbose (#25734)
otherwise ansible eats out important error messages

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2017-06-28 15:55:39 -04:00
David Moreau-Simard
9fdd07fba8 Provide the list of files that were included by include_vars
include_vars will now also return a key 'ansible_included_var_files'
which contains the list of files that were successfully loaded.
This is useful information and, amongst other things, a way for users
to know exactly what files were included when debugging their
playbooks.
This also allows us to improve the integration tests around
include_vars.
2017-06-28 15:25:45 -04:00
Brian Coca
44bef1dc6b corrected supported_by key 2017-06-28 15:12:42 -04:00
Abhijeet Kasurde
bb847e332d Check if SELinux is installed on system (#24437)
* Refactor code
* PEP8 fixes
* Check if /etc/selinux/config file exists before
  proceeding any other operations

Fixes #21622

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-28 19:39:52 +01:00
Dag Wieers
5be32aa5af Move ping and win_ping closer together (#26028)
So in an effort to verify if Windows modules are feature complete
compared to the python equivalent, I stumbled upon these differences.

This PR includes:
- Add missing 'data' option from documentation
- Simplify ping module
- Update integration tests to test exception
2017-06-28 11:08:04 -07:00
Tim Rupp
e7402e3d5b Support full path templates (#26121)
This patch allows the iapp service module to support full path
templates instead of only relative templates
2017-06-28 17:35:00 +01:00
Tim Rupp
04ac15f241 Adds bigip_qkview module (#25980)
This module can be used to generate qkviews on a bigip and
save them to a location on the ansible controller.
This module is primarily used for diagnostics.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_qkview.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_qkview/tasks
2017-06-28 17:31:17 +01:00
Tim Rupp
16bd93a14e Refactors bigip ssl cert module (#25882)
Includes unit tests and a refactor of the module to make code
more easily supported. Also fixes an issue where the extension of
the cert name was not appended if not provided. This problem was
causing certs to not be editable in the UI. Also deprecates params.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_ssl_certificate.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_ssl_certificate/tasks
2017-06-28 17:26:39 +01:00
Brian Coca
7870000f71 updated docs to clarify default change 2017-06-28 12:13:25 -04:00
Pete Travis
147b342553 device path is optional for cbs
per
https://developer.rackspace.com/docs/cloud-servers/v2/api-reference/svr-basic-operations/#post-attach-volume-to-server-servers-server-id-os-volume-attachments
, device is "The name of the device, such as /dev/xvdb. Specify null for
auto- assignment."
2017-06-28 12:12:46 -04:00
Abdul Anshad A
61b18cc355 fixes issue #5633 (#19716) 2017-06-28 10:47:53 -05:00
Abdul-Anshad-A
36975c50ef test fix for thin disk type issue 2017-06-28 11:45:45 -04:00
ppanczyk
6d0f61b656 Fixed expiredate parameter in user module
Changed "--expiredate" to "-e", as on older systems "--expiredate" is not present.
2017-06-28 11:36:34 -04:00
MaciejCetler
0d179c77a7 fix for iam (#23347)
* fix for iam

* Update iam.py

removed extra space
2017-06-28 11:11:19 -04:00
Brian Coca
d5f4c2a54b auto tb on vvv+ or debug (#26106)
* auto tb on vvv+ or debug

* updated as per feedback
2017-06-28 10:08:38 -04:00
George Nikolopoulos
11836a0296 Add module netscaler_cs_action (#26147) 2017-06-28 19:16:46 +05:30
Trishna Guha
a5b905c941 Workaround to deprecation warning when password is used as arg for *_user (#26169)
* Avoid deprecation warning for password for vyos_user argspec

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

* Avoid Password deprecation for ios_user

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

* Avoid Password deprecation for iosxr_user

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-28 15:11:27 +05:30
Trishna Guha
34eca3816d fix vyos_user configuration (#26166)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-28 12:13:27 +05:30
Virgil Dupras
9474f20f2d letsencrypt: FIX CN parsing to work with OpenSSL 1.1 (#25935)
As we can see in
9537453586
:

CN used to be without whitespaces around the `=` but OpenSSL 1.1 introduced
whitespaces:
1.0.1: subject=/CN=example.com
1.1.0: subject=CN = example.com

This commit makes them optional.

OpenSSL 1.1 is present on the newly-released Debian Stretch, so absence
of this fix makes us not being able to use this module on this distro.
2017-06-28 07:39:53 +02:00
Ganesh Nalawade
3bd8dbb53d Add support for netconf network discovery (#25435)
* Add support for netconf network discovery

* Fix unit test failure
2017-06-28 11:07:38 +05:30
Dag Wieers
b1e608811b win_iis_webapplication: Parameter fixes and check-mode (#26082)
This PR includes:
- General cleanup of parameters
- Added check-mode support
- Cleanup of return values
2017-06-28 12:16:06 +10:00
Dag Wieers
58b348ddf5 win_msi: Add check_mode and removes options (#26086)
This PR includes:
- Add support for the removes option
- Add check_mode support (which does test MSI file, creates, removes)
- Simplify code
2017-06-28 10:47:30 +10:00
Dag Wieers
bb7ebc6a55 win_msg: Added integration tests, parameter fixes (#26126) 2017-06-28 10:35:38 +10:00
Sloane Hertel
3ba4fc2d54 boto only returns tags in the described security group if they exist (#26053) 2017-06-28 09:14:38 +10:00
Will Thames
0e0b91534a [cloud] Return target_group_names where sensible in ec2_asg_facts module (#26078)
If target_group_arns is an empty list, then return
an empty target_group_names list.

If a connection to elbv2 is not obtainable, then it is
not possible to return target_group_names
2017-06-27 17:04:15 -04:00
Josh Souza
e49f15d6e4 [cloud] Fix logical flaw in route53_health_check, use string ports everywhere (#25706)
* Fix logical flaw (update when diff), use string ports everywhere

* Change port comparison to integer vs. string

The comparison works either way as long as it's consistent. Boto docs
state that it takes in an integer, but if given a string apparently
keeps it as such. This change just ensures that when we compare, we
specifically deal with integers.
2017-06-27 15:58:21 -04:00
Dag Wieers
fceb71128e Return code is not very useful to assume a task failed
So I thought I fixed it before, but there's still one location where
the `rc` value is influential to decide whether a task failed or not.

We already established in #24867 that it is up to the module to decide
what the return code actually means, not the task executor. We modified
the existing modules to move that logic into the module (eg. for
command, shell, etc.)

This relates to the integration tests of win_robocopy, where different
return codes have different meanings:

  - 0  --  No files copied.
  - 1  --  Files copied successfully! (changed)
  - 2  --  Some Extra files or directories were detected. No files were copied. (warning)
  - 3  --  (2+1) Some files were copied. Additional files were present. (changed)
  - 4  --  Some mismatched files or directories were detected. Housekeeping might be required!  (changed + warning)
  - 5  --  (4+1) Some files were copied. Some files were mismatched.  (changed + warning)
  - 6  --  (4+2) Additional files and mismatched files exist.  No files were copied. (warning)
  - 7  --  (4+1+2) Files were copied, a file mismatch was present, and additional files were present. (changed + warning)
  - 8  --  Some files or directories could not be copied! (changed + failed)
  - 9 - 15  --  Fatal error. Check log message! (failed)
  - 16  --  Serious Error! No files were copied! Do you have permissions to access $src and $dest? (failed)

This also fixes #24652
2017-06-27 15:40:27 -04:00
George Nikolopoulos
6bed831f8c Add netscaler_server module (#25537) 2017-06-27 23:08:00 +05:30
Abhijeet Kasurde
79b2897462 Update vmware_guest_find module (#26066)
Fix updated following:
* Update Documentation
* Update Examples
* Find VM's folder using VM's UUID
* Make name as optional parameter

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-27 11:58:57 -04:00
Toshio Kuratomi
e238ae999b Cyptography pr 20566 rebase (#25560)
Make pyca/cryptography the preferred backend for cryptographic needs (mainly vault) falling back to pycrypto

pyca/cryptography is already implicitly a dependency in many cases
through paramiko (2.0+) as well as the new openssl_publickey module,
which requires pyOpenSSL 16.0+. Additionally, pyca/cryptography is
an optional dep for better performance with vault already.

This commit leverages cryptography's padding, constant time comparisons,
and CBC/CTR modes to reduce the amount of code ansible needs to
maintain.

* Handle wrong password given for VaultAES format

* Do not display deprecation warning for cryptography on python-2.6

* Namespace all of the pycrypto imports and always import them

  Makes unittests better and the code less likely to get stupid mistakes
  (like using HMAC from cryptogrpahy when the one from pycrypto is needed)

* Add back in atfork since we need pycrypto to reinitialize its RNG just in case we're being used with old paramiko

* contrib/inventory/gce: Remove spurious require on pycrypto

(cherry picked from commit 9e16b9db275263b3ea8d1b124966fdebfc9ab271)

* Add cryptography to ec2_win_password module requirements
  * Fix python3 bug which would pass text strings to a function which
    requires byte strings.

* Attempt to add pycrypto version to setup deps

* Change hacking README for dual pycrypto/cryptography

* update dependencies for various CI scripts

* additional CI dockerfile/script updates

* add paramiko to the windows and sanity requirement set

  This is needed because ansible lists it as a requirement. Previously
  the missing dep wasn't enforced, but cryptography imports pkg_resources
  so you can't ignore a requirement any more

* Add integration test cases for old vault and for wrong passwords

* helper script for manual testing of pycrypto/cryptography

* Skip the pycrypto tests so that users without it installed can still run the unittests

* Run unittests for vault with both cryptography and pycrypto backend
2017-06-27 06:00:15 -07:00
Matt Davis
36ad934156 re-enable non-pipelined mode for Powershell (#25012)
* fixes #23986
* fixes 3rd-party Windows connection plugins that don't support pipelining (eg awsrun)
2017-06-26 22:58:09 -07:00
Jordan Borean
b41c42cf0d win_share: Add integration tests and various fixes (#25691)
* win_share: Add integration tests and various fixes

* docs and comments updates based on PR review

* fixed up documentation issue with URL
2017-06-27 12:07:22 +10:00
Jordan Borean
2f3a1c7a28 win_service: Updated return values and use the list parameter type (#25385)
* win_service: Updated return values and use the list parameter type

* minor fix to handle the list parameter return value
2017-06-27 10:11:43 +10:00
jhawkesworth
1ec115d830 win_regedit: Make the string comparison case sensitive when comparing string values (#25536)
* Make the string comparison case sensitive when comparing string values

* Added documentation note about change detection now being case-sensitive
2017-06-27 09:51:50 +10:00
Dag Wieers
74efda65cd windows: Two simple errors using Add-Warning (#25955) 2017-06-27 09:40:16 +10:00
Dag Wieers
0dddae7ffa Add warning message when Chocolatey was installed (#25918) 2017-06-27 08:58:52 +10:00
Trond Hindenes
7cc38e1b32 Fixes win_dsc docs (#26122)
* hacking dsc docs

* remove code snippet

* again...

* more testing

* trying a short version

* moar text
2017-06-27 08:42:31 +10:00
Daniele Lazzari
9d932b64f0 New module: Add module to install/remove/register/unregiser windows powershell modules (windows/win_psmodule) (#23604)
* Add new windows module win_psmodule

* Add checkmode, allow_clobber parameter, integration tests

* Add aliases, replace win_raw with win_shell

* restore original test_win_group1.yml, add powershel version test

* fix var type

* add conditional on assert

* integration tests conditional tasks review

* documentation fix, test fix, adds result.change

* fix yml

* fix railing whitespace

* add nuget_changed and repository_changed in result
2017-06-26 23:01:38 +02:00
Tim Rupp
1e8c58519e Removes unused f5 module utils
The CLI utils are no longer used by any F5 modules and may therefore
be removed.
2017-06-26 13:14:10 -07:00
Eugen C
6d59160744 Fix ansible ad-hoc to respect ANSIBLE_STDOUT_CALLBACK (#26098)
* Fix ansible ad-hoc to respect ANSIBLE_STDOUT_CALLBACK

* Ansible ad-hoc 'stdout_callback' should work only with 'bin_ansible_callbacks'
2017-06-26 16:01:06 -04:00
Sloane Hertel
dc2d9a2134 [cloud] Python3 fixes: use string_types instead of basestring (#26102)
Don't modify a dict while iterating over it
2017-06-26 15:06:53 -04:00
Andreas Olsson
05dc76f3b2 In the git module let ssh do its own host checking
There are too many possible special cases for Ansible to be able to
precheck known_hosts files without introducing all kinds of false
failures.

* Alternative known_hosts paths
* Alternative host name aliases
* ssh host certificates
* SSHFP + DNSSEC

Fixes #24860
2017-06-26 10:45:19 -07:00
Abhijeet Kasurde
d63cdcacc3 Make nic_name as optional parameter (#25990)
Fix adds support for adding VMWare vSwitch without
any physical NICs (uplinks). This makes nic_name as
an optional parameter. Also, updated documentation and
examples to reflect these changes.

Fixes #25632

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-26 12:47:10 -04:00
Mark Szymanski
91c1d8d8e2 Fixing bug introduced in 20622 2017-06-26 11:38:47 -04:00
Dag Wieers
7d7051fc54 Mutually reference Windows and non-Windows modules (#25482)
* Mutually reference Windows and non-Windows modules

To make it easier for Windows or non-Windows users to find the relevant
module information, we are mutually referencing both variants in their
documentation.

We are also adding a special note if a module works on both Windows and
non-Windows targets.

* Mutually reference Windows and non-Windows modules

To make it easier for Windows or non-Windows users to find the relevant
module information, we are mutually referencing both variants in their
documentation.

We are also adding a special note if a module works on both Windows and
non-Windows targets.

* Replace 'look at' with 'use', as requested

ci_complete
2017-06-26 16:26:53 +01:00
Chris Houseknecht
8765eadb30 Fixes list comparison (#26042) 2017-06-26 11:06:57 -04:00
Abhijeet Kasurde
1f8575ec97 Remove get_exception from zypper (#25890)
Fix removes get_exception in favor of native Python exception
handling. Also, added to_native to manage exception message.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-26 14:30:51 +01:00
George Nikolopoulos
0bf64aa241 Add netscaler_save_config module (#25614) 2017-06-26 18:46:52 +05:30
mihu
6b76bc924f [cloud] New feature for ec2_group: allow deleting groups by id (#26022) 2017-06-26 09:07:29 -04:00
Rene Moser
1f5839777b cloudstack: cs_host: revamp fixes several issues 2017-06-26 14:40:09 +02:00
Ricardo Carrillo Cruz
ffaf6c4a86 Add new net_static_route platform agnostic module (#25455)
* Add new net_static_route platform agnostic module

* Add mask parameter and according examples

* Add required true to required params

* Add static routes collections example
2017-06-26 11:23:33 +02:00
Peter Sprygada
b12ca95824 renames dict_combine to dict_merge in network_common (#26073) 2017-06-25 18:46:41 -04:00
Dag Wieers
014bcad35b Small fix in the error output (#26004)
So I noticed this when doing integration tests:

    Failed to copy file Could not find a part of the path

and this change turns it into:

    Failed to copy file: Could not find a part of the path

I also moved something out of the exception handling.
2017-06-24 21:07:23 +02:00
Nathaniel Case
21c7fcf9c0 nxos_vxlan_vtep (#25971)
* nxos_vxlan_vtep tests

* Fix issues with nxos_vxlan_vtep
2017-06-24 14:09:11 -04:00
Trishna Guha
3482a6326b Fixes nxos_vpc_interface (#25907)
* nxos_vpc_interface fix

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

* nxos_vpc_interface unit test

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

* fix state_present

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

* add state_present unit test

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

* make ansibot happy

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

* teardown get_config

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-24 18:05:07 +05:30
Brian Coca
0209685f8d check options exist before forcing assignment 2017-06-23 15:56:43 -04:00
Ryan Fitzpatrick
3e52f47b51 [cloud] Fixes #26045 Ensure instance.instance_profile is not None before casting to dict (#26047) 2017-06-23 12:33:55 -04:00
Patrik Lundin
a439f45a18 openbsd_pkg: Handle versionless names with branch. (#26016)
* openbsd_pkg: Handle versionless names with branch.

This makes package names such as "openldap-server--%openldap" work.
Problem reported by Landry Breuil.

While here fix cornercase check for versionless packages and add some
more debug output to packet parsing.

Fixes #25910.

* openbsd_pkg: Split up lines to pass build checks.

===
The test ansible-test sanity --test pep8 failed with the following errors:
lib/ansible/modules/packaging/os/openbsd_pkg.py:383:161: E501 line too long (292 > 160 characters)
lib/ansible/modules/packaging/os/openbsd_pkg.py:398:161: E501 line too long (198 > 160 characters)
===
2017-06-23 12:25:41 -04:00
Will Rouesnel
42b608db0c Add support for tmpfs to docker_container. (#25747) 2017-06-23 08:03:28 -04:00
loqutus
f6e4019804 fix networkdid->networkid in cs_nic.py (#25914) 2017-06-23 07:15:03 +01:00
Mark Szymanski
1703db4211 Allow iam_cert to be renamed or moved without needing to specify cert or key data (#20622)
Generally Pep8 and flake8 compliant so removing from legacy-files.txt
2017-06-23 15:32:15 +10:00
GennadySpb
26fec4f107 Fix type for 'attributes' field 2017-06-22 15:41:05 -04:00
Matt Clay
e747650543 Add missing __init__.py for modules. 2017-06-22 11:41:53 -07:00
Troy Sampson
e391206acc Missing Else statement (#25457)
Missing the final Else statement in the conditional statement
2017-06-22 17:47:58 +01:00
Dag Wieers
33a6150393 imc_xml: New module to manage Cisco IMC hardware (#25529)
* cisco_imc_xml: New module to manage Cisco IMC hardware

This module provides direct access to the Cisco IMC API.
See the included examples for a glimpse of what it can do.

* Rename cisco_imc_xml to imc_xml

After discussion with Peter Sprygada renamed from cisco_imc to imc.
As Cisco ACI is named aci as well.
2017-06-22 17:40:37 +01:00
Kassian Sun
de4a8b83df Fix up integer type detection on python3 (#25985) 2017-06-22 08:48:22 -04:00
Andrea Tartaglia
921bc0599b Fixed modules using Popen (#24558)
* Fixed modules using Popen

* Reverted change in mysql_db, Popen is required to pipe compressed archives to mysql
2017-06-22 05:22:34 -07:00
James Cammarata
495a809f46 Don't include dependent roles in the dep chain for include_role
The dependency chain should not include roles below the parent, as it
can introduce very weird things like conditionals from child deps impacting
non-related roles.

Fixes #25136
2017-06-22 13:16:29 +01:00
Constantin
9cc35b094f Fix of argument error in #25940 (#25979) 2017-06-22 16:59:36 +10:00
mihu
60afe93521 amazon: allow NACL to be removed by its id (#25925) 2017-06-22 16:46:46 +10:00
Ganesh Nalawade
b2f46753ec Add junos_system declartive module and other related change (#25859)
* Add junos_system declartive module and other related change

*  junos_system declartive module
*  integration test for junos_system
*  integration test for net_system (junos platform)
*  pep8 fixes for junos modules
*  move to lxml from elementree for xml parsing as it support
   complete set of xpath api's
*  other minor changes

* Fix CI and doc changes

* Fix unit test failures

* Fix typo in import

* Fix import issue for py2.6

* Add missed Element in import
2017-06-22 09:34:50 +05:30
Wouter de Geus
dd07d11ae5 [cloud] Add ChangeSet support to cloudformation module (#23490) (#24497)
*  * Implements Change Sets on updating a cloudformation stack when create_changeset=true (#23490)

*  * Silence test complaints ;)

*  * Added optional changeset_name parameter.
 * Check if changeset with the requested name already exist.
 * Documentation fix

*  * Added warning when cloudformation stack has pending changesets.
 * Fix documentation
2017-06-21 16:05:17 -04:00
Andrade
7bed60ba5f Fix docs typo in java_cert function docstring (#25942) 2017-06-21 15:47:33 -04:00
Tom Paine
f831be680e [cloud] Update ec2.py default for public IP assignment (#25896)
* Update ec2.py

Update docs to reflect default.

* Update ec2.py

Further default update.
2017-06-21 14:58:26 -04:00
Abhijeet Kasurde
e8072ee616 Misc typo for Ansible
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-21 11:19:41 -04:00
Ryan S. Brown
2a7e586801 Move helm module to subdirectory 2017-06-21 07:45:41 -04:00
Flavio Percoco Premoli
02cd72857e New module: helm (#24883)
This PR adds a new module, helm, which can be used to manage Kubernetes Helm, the package manager for k8s.
2017-06-21 07:43:02 -04:00
Ondra Machacek
5f1da6809a cloud: ovirt: support add/remove tag from vms/hosts (#25900) 2017-06-21 07:11:10 -04:00
Christopher Galtenberg
170fc42e80 Improve help text for extra-vars requiring @ for filename
(cherry picked from commit 1b34de89ee)
2017-06-21 07:08:35 -04:00
Brian Coca
d79315e19e avoid winrm errors when not connecting to winrm (#25921) 2017-06-21 01:13:06 -07:00
Sloane Hertel
04e93e22cb add traceback and more helpful errors for ec2_vpc_route_table (#25704) 2017-06-21 12:01:52 +10:00
Yang Liu
b41b4fe2fd use proper pagination variable (#25838) 2017-06-21 12:00:41 +10:00
Trond Hindenes
911f4d3eb1 A few win_dsc bugfixes (#25852) 2017-06-20 22:12:53 +01:00
Damir Suleymanov
74f6b64fb0 Handle rate limits on every iteration (#23726) 2017-06-20 16:49:05 -04:00
Brian Coca
a457c2af59 correctly set delegated host name in results 2017-06-20 14:58:43 -04:00
Brian Coca
0bbf0e8d19 adjust script caching to processed data
also added filename to loading for better errors
2017-06-20 14:27:53 -04:00
Nathaniel Case
0296c2285b nxos_vrf fix (#25812)
* Fixes #25031

* Slight cleanup and add tests
2017-06-20 10:59:03 -04:00
Abhijeet Kasurde
aa32f4e80c Add support for Red Hat Atomic Host (#25906)
Fix adds support for Red Hat Enterprise Linux Atomic Host.
RHEL Atomic host uses same RHEL Server strategy for
modifying hostname.

Fixes #25903

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-20 10:30:53 -04:00
Will Thames
f3c98f482a [cloud] New module ec2_vpc_endpoint_facts for AWS EC2 VPC Endpoints (#20211)
* New facts module for AWS EC2 VPC Endpoints

* ec2_vpc_endpoint_facts - meet latest Ansible standards

Fix exception syntax and use of `iteritems` for python3

Fix undefined `ec2` variable (should have been `connection`
Address various flake8 issues

Use `ansible_dict_to_boto3_filter_list` rather than
duplicating its implementation

* Remove max_items and next_token from vpc_endpoint_facts

max_items and next_token should be a module concern, not
a caller concern. It would be very difficult for a module
consumer to use next_token properly, whereas it's easy for
the module to handle it.

* ec2_vpc_endpoint_facts trivially supports check mode

Add supports_check_mode=True to the argument spec.

* Improve RETURN documentation for ec2_vpc_endpoint_facts

Fix bug in EXAMPLE documentation too

* fix return type for validate-modules
2017-06-20 08:31:31 -04:00
Will Rouesnel
3adf08e10f [cloud] iam_cert return arn and allow use with ansible vault (#20787)
* iam_cert.py Fix duplicate certificate detection with included chains.

The iam_cert module would fail to detect certificates as duplicates
if the certificate body included the authority chain directly.

This commit fixes the problem by checking if a given certificate
matches the start of the data returned by AWS, since in all cases
where they would match the certificate will come first.

* iam_cert.py Return certificate ARN in all success cases.

When uploading certificates or interacting with IAM, the certificate ARN
is needed for other operations with AWS such as provisioning elastic load
balancers.

This commit returns the certificate ARN in all success cases, which allows
it to be used to idempotently provision other Amazon services depending on
it (ELBs being an immediate example).
2017-06-20 08:01:56 -04:00
Trishna Guha
947e9aba45 Add vyos_banner implementation module (#25862)
* Add vyos_banner implementation module

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

* vyos_banne integration test

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

* vyos_banner unit test

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

* minor fix on banner text

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-20 08:53:03 +05:30
Brian Coca
e2cf3b6e7a fixed cg signature 2017-06-19 19:08:36 -04:00
Brian Coca
9d37b0c8aa 01110000 01100101 01110000 00111000 00100000
01101100 01101001 01101110 01110100 01101001 01101110 01100111 00100000 01110011 01110101 01100011 01101011 01110011
2017-06-19 17:50:52 -04:00
Brian Coca
9d8721dbde properly track delegated host in loops
ansible_host can be pulled from inventory and not match inventory_hostname,
this can "loose" vars to a new host named by ansible_host vs the delegated host
fixes #25770
2017-06-19 17:50:52 -04:00
Matt Martz
b6ee9163e3 Ensure hosts aren't duplicated in groups 2017-06-19 17:38:43 -04:00
Brian Coca
e08f068dca ensure proper typing of path, cause py3 listdir
since now output is based on input, we need to make sure its always same
fixes #25856
2017-06-19 16:35:50 -04:00
Sloane Hertel
06c21b4bec [cloud] fix dynamodb_ttl exception handling for ParamValidationError (#25870)
Also adds tracebacks to exceptions and imports `HAS_BOTO3` instead of checking directly.
2017-06-19 15:29:14 -04:00
Sloane Hertel
e079498485 [cloud] document route53 state choices added in 2.4 (#25866) 2017-06-19 15:16:58 -04:00
Steffen Neubauer
759750e661 Consul: make service_port optional in service definition, like specified in Consul docs (#21737)
* Consul: make service_port optional in service definition, Fixes #21727

* Remove consul module from legacy-files.txt

* consul: Pep8 fixes
2017-06-19 19:29:40 +01:00
Jordan Borean
6d01168238 win_acl_inheritance: Added tests and formatting improvements (#25382) 2017-06-19 17:47:35 +01:00
Jordan Borean
c05d3c3821 win_owner: added tests and fixed up bool handling (#25088)
* win_owner: added tests and fixed up bool handling

* explicitly gathering facts in test

* Removed manualy entry in test group
2017-06-19 17:43:44 +01:00
Dag Wieers
0aba04fdad win_uri: Add integration tests, new functionality... (#25373)
This is a cleanup of the win_uri module to make it feature-complete.

This PR includes:
- Added check-mode support
- Add as many options from the uri module as possible
  - Added creates
  - Added follow_redirects
  - Added maximum_redirection
  - Added password
  - Added removes
  - Added return_content
  - Added status_code
  - Added timeout
  - Added user
  - Added validate_certs
- Fixed list-handling for comma-separated strings
- Added basic integration tests (should come from uri module)
2017-06-19 17:30:08 +01:00
Abhijeet Kasurde
a4ebde1516 Correct failure message in flowdock (#25844)
As per documentation and code, external_user_name is
required parameter is case of type 'chat'.
Fix corrects error message displayed to user.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-19 17:08:08 +01:00
Ted Timmons
346cbf7d7a [cloud] New module: Add module to set Amazon AWS DynamoDB TTL (cloud/amazon/dynamodb_ttl) (#22588)
* add aws dynamo_ttl module, small parameter setter

 - New Module Pull Request

`dynamodb_ttl`

2.3.0/devel

Very self-contained TTL setter. This is independent of the dynamodb_table module
as it's really designed to be a helper for tables that may be created in other
ways (say, CloudFormation, which doesn't support setting TTL).

* committer is no longer a valid value

* bump version_added, catch common exceptions

* pep8 fixes

* one more pep8
2017-06-19 09:57:04 -04:00
James Braid
0be0aa5f10 htpasswd: fix passlib module version comparison (#20202)
Previously, we used StrictVersion which failed to parse some passlib
version strings. For example, Debian currently ship passlib with a
__version__ of '1.7.0.post20161128115349'

StrictVersion throws an exception when parsing this version string.

Change to using LooseVersion which successfully parses version strings
such as this.

Fixes #20199
2017-06-19 12:02:06 +01:00
Matthew Schick
846174b4ba Update nocache to be the proper bool type instead of string (#24358)
* Update nocache to be the proper bool type instead of string

* Add proper bool type for params
2017-06-19 11:24:19 +01:00
Ali
484252b90f New Module: Add github_deploy_key module (source_control/github_deploy_key) (#24364)
* Added new module: github_deploy_key

added a new module for managing deploy keys for GitHub repositories

* Updated github_deploy_key module based on feedback

- added GPL header
- switched to using fetch_url instead of requests
- changed version to 2.4
- set no_log for otp and token arguments
- implemented check mode

* made github_deploy_key module PEP8 compliant
2017-06-19 11:13:27 +01:00
Krzysztof Magosa
4522a53acf fix false positive changed flag in rabbitmq_user module (#22507) 2017-06-19 05:10:23 -04:00
Abhijeet Kasurde
7348a613bb Correct usage of fail_json in hg module (#25847)
Fix adds correct usage for fail_json and also adds
testcases to verify this.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-18 22:28:33 +02:00
Abhijeet Kasurde
561d678f52 Fix module params assignment in jabber module (#25850)
Fix corrects variable assignment from module params

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-18 22:22:27 +02:00
Andrew Makousky
f2abc4cf43 Improve documentation of 'remote_src' in the file copy module. (#23946)
Now that remote-to-remote copies are supported in the copy module,
the module documentation has been updated to indicate this in the
synopsis and examples to make the capability obvious for someone
skimming the documentation.
2017-06-18 08:38:17 +01:00
Tim Rupp
0854c0ed88 Adds refactored bigip_hostname (#25841)
This adds a refactored bigip_hostname with unit tests and code
conventions that are common across other modules.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_hostname.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_hostname/tasks
2017-06-18 07:56:00 +01:00
Peter Sprygada
3f17e87c5a pulls the jsonrpc request builder code into top level function (#25833)
refactors the Connection class to use the top level function.  This will
make the request_builder() function useful for other components such as
action handlers.
2017-06-17 16:14:48 -04:00
Ganesh Nalawade
450263e934 Add junos_banner declartive module (#25826)
* Add junos_banner declartive module

*  junos_banner implementation
*  Integration test for junos_banner
*  Integration test for net_banner (junos)
*  Minor fixes

* Minor doc change
2017-06-18 01:32:48 +05:30
Peter Sprygada
97e24dc317 fixes issue with SIGALARM call in network_cli (#25832)
The alarm_handler method was calling a method close_shell() that doesn't
exist.  This updates the alarm handler to call the current method
close()
2017-06-17 15:48:30 -04:00
Tim Rupp
59d470ae84 Adds bigip_iapp_service module (#25808)
This module allows a user to manage the iApp services on a bigip
that they created using the bigip_iapp_template module.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_iapp_service.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_iapp_service/tasks
2017-06-17 12:47:13 +01:00
Jim Rubenstein
26b8f90c9a Adds ANAME support for DNSMadeEasy module (#21030) 2017-06-17 07:27:00 +01:00
Gaurav Rastogi
5f23aa69c6 New Avi Module for Auth Profile objects (#24842) 2017-06-16 20:24:00 +01:00
Tim Rupp
9c849d5c94 Corrects method name (#25568)
The method name was missing a 'd'. The method was not used anywhere
however, so no other code needs to be changed. Neither 'has_chilren'
nor 'has_children' are used in the codebase.
2017-06-16 19:54:53 +01:00
René Moser
4ffc4b6748 cloudstack: add missing zone name to result (#25806) 2017-06-16 20:30:25 +02:00
René Moser
6feee18292 host_group_vars: skip files having blacklisted ending (#25730)
* vars: skip backup files

* vars: extend doc for ignored files
2017-06-16 18:45:58 +02:00
Ganesh Nalawade
2ff464c949 Add net_interface declarative module (#25766)
* Add net_interface declartive module

*  Add net_interface module
*  Add junos_interface implementation module
*  Other minor changes

* Add integration test

*  Integration test for net_interface
*  Integration test for junos_interface

* Fix CI failures

* Documentation changes
2017-06-16 22:12:50 +05:30
Tomas Dobrovolny
e7deb07a87 facts: Add linux virtio module detection (#25578)
Detect as kvm guest if virtio linux kernel module is loaded
2017-06-16 12:06:56 -04:00
Abhijeet Kasurde
6bc1e802e3 Rectify traceback.format_exc() call (#25773)
Fix adds correct call to traceback.format_exc method

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-16 11:38:36 -04:00
Rene Moser
46c6eb37d0 vars: fix typo s/path/spath 2017-06-16 17:17:38 +02:00
Peter Sprygada
3aa41eda0b adds new common functions for declarative intent modules (#25210)
* adds new common functions for declarative intent modules

* adds Entity and EntityCollection
* adds dict_diff and dict_combine

* update for CI  PEP8 compliance

* more CI PEP8 fixes

* more PEP8 CI clean up

* refactors the lambda assignments into top level classes

this is to be in compliant the PEP8 CI sanity checks

* one last pep8 ci fix
2017-06-16 10:16:20 -04:00
Rene Moser
43468b825d vars: fixed missing path in splitext() 2017-06-16 10:08:14 -04:00
Nathaniel Case
a38e727380 nxos_nxapi fix (#25306)
* Add nxos_nxapi tests

* Simple changes to nxos_nxapi

* Move validation to check_args

* Don't mark protocol change unless change is requested

* Add different regex to handle HTTP{,S} ports on a different version of nxos
2017-06-16 07:15:08 -06:00
Christopher Gadd
2edd5da2c5 Update system/ufw.py for ufw v0.35 (#21604)
* Updating ufw.py to support comments

* Revert "Updating ufw.py to support comments"

This reverts commit 54a42de97c77004d4755543bf310f0ec6e1b4d14.

* Support ufw v0.35 in ufw.py

* Add ufw version check to ufw module
2017-06-16 08:08:09 -04:00
Simon Dodsley
937d7993cc Initial commit for Pure Storage Ansible module (#25386)
* Initial commit for Pure Storage Ansible module

* Initial commit for Pure Storage Ansible module

* Initial commit for Pure Storage Ansible module

* Fix import issues as required by post-2.2

* Move last import to top

* Follow suggestions and only implement one module per PR
Fix documentation changes requested

* Documentation and formatting changes
2017-06-16 11:28:50 +01:00
Trishna Guha
98269888a9 iosxr_banner Implementation module (#25744)
* Add iosxr_banner implementation module

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

* Integration test for iosxr_banner

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

* Unit test for iosxr_banner

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

* remove blank line pep8

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-16 11:56:47 +05:30
James Cammarata
c5b8196ff1 Do not set default value for any_errors_fatal in Base
Setting default values for FieldAttribute values created in the Base class
prevents the _get_parent_attribute() code from working correctly, as the value
is always non-None.

Related to #22924
2017-06-16 00:56:06 -05:00
Matt Clay
3eea649cbb PEP 8 fixes. 2017-06-15 15:54:05 -07:00
Sloane Hertel
938d60472a [cloud] ec2.py: add region to the aws_connect_kwargs before creating vpc connection Fixes #25673 (#25749)
* add region to the aws_connect_kwargs before creating vpc connection

* remove unused import
2017-06-15 15:52:56 -04:00
Robin Miller
540e1bbd69 [cloud] Route53 Avoid throttling errors and unnecessary processing when checking rrsets. (#22104)
The boto Route53 get_all_rrsets method will return the record set
matching the name, type, and identifier specified, followed by ALL
subsequent sets in alphabetical order based on name. If the specified
set does not exist, the method will still return all the sets that
_would_ have come after it. Searching through sets we know will not
match is not just a waste of resources but, more importantly, often
triggers AWS API throttling when used on zones with large numbers of
records.
2017-06-15 15:06:16 -04:00
Brian Coca
fedbf3666b fixed issue with paths separator and others
finished  normalizing of path handling
removed overloaded '-p' from init_paths option, it is for role_paths
removed expand_tilde and get_opt methods as both were redundant, adjusted rest of code
updated tests to match
2017-06-15 14:53:54 -04:00
Abhijeet Kasurde
c426481b33 Add command variable in failure message (#25674)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-15 10:45:40 -07:00
Rob
6d34ce3f2a [cloud] elb_target_group_facts.pyFix tags being snaked (#25742) 2017-06-15 13:19:28 -04:00
Trishna Guha
44687bb917 Add iosxr_user implementation module (#25615)
* Add iosxr_user implementation module

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

* iosxr_user Integration test

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

* iosxr_user Unit test

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

* Modify integration test with idempotent case

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-15 22:07:03 +05:30
Trishna Guha
b3c22a96bd Add vyos_user implementation module (#25677)
* Add vyos_user implementation module

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

* Integration test for vyos_user

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

* Make state absent work

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

* Unit test for vyos_user

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

* Standardize user names

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

* Modify integration test with idempotent case

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

* Add role as alias to level

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-15 22:06:18 +05:30
Brian Coca
13a1111dde tighter host/group_var discovery
now only loads nonext or valid yaml extensions
only first file gets loaded
directories must match name (initially) so no name.yml is loaded anymore
2017-06-15 12:35:18 -04:00
Trishna Guha
9c6ee8d0bb Add nxos_banner implementation module (#25695)
* Add nxos_banner implementation module

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

* nxos_banner integration test

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

* nxos_banner unit test

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

* doc update

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-15 22:05:38 +05:30
Pierre-Louis Bonicoli
571e93f882 Fix a typo in assert message 2017-06-15 11:22:57 -04:00
Brian Coca
df2fcecd62 pager should not log
fixes #25719
2017-06-15 10:47:11 -04:00
Abhijeet Kasurde
8ad04d6348 Move redudant check_ip_addr method to common ce (#25575)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-15 13:21:18 +01:00
René Moser
a51d64dfe3 constants: pep8 fix (#25735) 2017-06-15 13:40:06 +02:00
Gaurav Rastogi
8ad464c4f5 New Avi Module for Backup objects (#24843) 2017-06-15 11:50:35 +01:00
Gaurav Rastogi
6c3eace794 Minor Updates to the module descriptions and field options (#25430) 2017-06-15 11:46:07 +01:00
Tim Rupp
8e3ef4b052 Adds virtual_address module (#25728)
This module lets users manage a number of different config options
for Virtual Addresses on a BIG-IP.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_virtual_address.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_virtual_address/tasks
2017-06-15 11:18:23 +01:00
Ganesh Nalawade
12493707a7 Add persistent connection control path dir constant (#25736) 2017-06-15 11:14:43 +01:00
Brian Coca
5e4b8d04d7 readded missing become configs 2017-06-14 17:36:46 -04:00
Brian Coca
a54666d31e now host list removes trailing/leading spaces
othewise hostnames were just 'fun'
2017-06-14 16:57:00 -04:00
Brian Coca
077ca3e07d skip hidden files for {host,group}_vars
fixes #25712
2017-06-14 15:48:42 -04:00
Tim Rupp
b85785bf07 Refactors irule module to conform to recent standards (#25709)
Also includes unit tests for the code
2017-06-14 19:03:17 +01:00
Tim Rupp
ba12ce64b0 Adds the bigip_snmp module (#25668)
This patch adds a module for managing several snmp related settings
on a BIG-IP that are required when configuring the range of SNMP
settings on a device.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_snmp.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_snmp/tasks
2017-06-14 18:29:41 +01:00
Tim Rupp
478d364f4d Adds bigip_iapp_template module (#25630)
This module can be used to upload and manage TCL iApps on a BIG-IP.
iApps can be added, removed and updated in place as needed. iApp
files should be provided to the module via Ansible lookups.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_iapp_template.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_iapp_template/tasks
2017-06-14 18:29:10 +01:00
Tim Rupp
0c68e200d5 Adds the bigip_provision module to Ansible (#25558)
This module allows an administrator to provision new module functionality
on a BIG-IP. BIG-IP modules provide enhanced ADC and security features that
are commonly used by customers such as GTM, ASM, and AFM.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_provision.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_provision/tasks
2017-06-14 18:28:12 +01:00
Dag Wieers
1c9a570ffe win_timezone: Add diff support, integration tests (#25284)
* win_timezone: Add diff support, integration tests

This PR includes:

- Diff support
- Returns both previous_timezone and timezone
- Adds integration tests
- More examples
- Improved documentation

* Merged the changes from jborean93's PR
2017-06-14 17:34:46 +01:00
Rob
f8d027b1ba [cloud] New module elb_target_group_facts (#24583) 2017-06-14 12:22:50 -04:00
Tim Rupp
db834cafaa Adds a reconnect method (#25625)
This is being made available so that module developers do not
need to use the gnarly long-form version to get a similar
result
2017-06-14 17:09:48 +01:00
Brian Coca
6b99f0d65c account for absense of config file 2017-06-14 11:38:35 -04:00
Sloane Hertel
dfcf43efa9 ec2: Allow EC2-VPC instances to modify security groups - fixes #18928 (#23831)
* Allow EC2-VPC instances to update SG

make ec2 pep8

* use sets instead of loop and a break

* bring things in an indentation level

* Use to_text instead of str, text_type instead of basestring, - instead of difference

* basestrings not unicode

* simplifying syntax
2017-06-14 11:10:29 -04:00
Brian Coca
74842adc07 1st part of ansible config, adds ansible-config to view/manage configs (#12797)
* Start of ansible config project

moved configuration definitions to external yaml file vs hardcoded
 * updated constants to be a data strcutures that are looped over and also return origin of setting
changed to manager/data scheme for base classes
new cli ansible-config to view/manage ansible configuration settings
 * prints green for default/unchanged and yellow for those that have been overriden
 * added list action to show all configurable settings and their associated ini and env var names
 * allows specifying config file to see what result would look like
 * TBD update, edit and view options

removed test for functions that have been removed

env_Vars are now list of dicts
allows for version_added and deprecation in future
added a couple of descriptions for future doc autogeneration
ensure test does not fail if delete_me exists
normalized 'path expansion'
added yaml config to setup packaging
removed unused imports
better encoding handling

updated as per feedback

* pep8
2017-06-14 11:08:34 -04:00
Nathaniel Case
4344132a7d nxos_vpc updates (#25452)
* Add nxos_vpc tests

* Split execute-show between get_config and run_commands
2017-06-14 11:06:49 -04:00
jhawkesworth
ccb5756d1f Added requires WMF5 note to win_firewall module documentations (#25676) 2017-06-14 15:10:17 +01:00
Ganesh Nalawade
b69c7f50d0 Add junos_vlan platform agnostic module (#25652)
* Add junos_vlan platform agnostic module

*  junos_vlan implementation

*  integration test for junos_vlan

* Minor fixes

* Fix Integration test failure
2017-06-14 14:23:52 +05:30
Andrew Saraceni
91e995d691 Allow win_scheduled_task to support adding and removing task paths (#24025)
* allows win_scheduled_task to support adding and removing task paths

* fix line length for documentation

* added integration tests for path creation and removal

* removing ability to remove TaskPath if a task isn't removed.  also removed superfluous line of code in Invoke-TaskPathCheck function
2017-06-14 08:02:36 +01:00
Dag Wieers
cf30b162a9 vmware_guest: Various fixes to VM customizations (from template) (#24768)
* Various fixes to VM customizations (from template)

This patch implements:
- New find_obj() function from vmware.py replacing get_obj()
- Implement proper resource_pool selection
- Fix productId implementation (was not working)
- Ensure that we are not changing anything that is not mandatory (hostName, orgName, fullName)


This is an alternative proposal to #24283
This does not fix #19860 yet though.

For our use-case, we do not want to customize the network information (or any information in fact).
What is used in the template should remain intact.

* Added find_obj() function

* Fix the returned object-list (unused yet)

* Small improvement

* Support DHCP type and fix customizations

* Small fix

* Support resource_pool also for reconfiguring VM

* Remove redundant

* Fix short hostname, specific resource_pool, PEP8

* Improve docs and examples

* Fix missing hostsystem

* Make folder absolute path

* Improve docs, add missing 'mac'
2017-06-13 17:50:55 -04:00
Sloane Hertel
bd4f08d434 [cloud] Fix Route53 module value option, defaulting to empty list (#24555) 2017-06-13 15:55:19 -04:00
Adrian Likins
d46dd99f47 Add UUID, label and id links to devices when building facts (#25448)
At present, the available facts around block devices are not sufficient to be able to find stable names guaranteed to work across reboots, or to identify block devices by label (UUID, etc).

This patch provides a list of observed links for each device. It relies on functionality specific to Linux (as does the existing sysfs-based code which it extends), but should not cause issues on other platforms.

Moreover, it prevents virtual devices from being excluded, and links such devices to the physical devices to which they are attached.
2017-06-13 15:33:13 -04:00
Adrian Likins
56b7483b85 More statvfs info for mount facts rebase 12073 (#25454)
* Add more mount point statvfs info including sizes

Based on https://github.com/ansible/ansible/pull/12073

facts.utils.get_mount_size() now returns a dict of most
of the posix statvfs data, including block_size and inode
counts.

Update the facts.hardware classes that use get_mount_size() to
use the new info by mount_info.update(mount_statvfs_inof) to merge.

* add back unit tests for LinuxHardware mount/fs facts

* add test cases for facts.utils.get_mount_size
2017-06-13 15:31:41 -04:00
Sloane Hertel
3bba43a487 [cloud] ec2.py: region is documented as optional; allow endpoints to be used - fixes #24382 (#24470)
* region isn't required for ec2.py; allow endpoints to be used

* move where aws_connect_kwargs is set

* remove camel_dict_to_snake_dict and display error message
2017-06-13 15:12:47 -04:00
jctanner
58db0da5a5 Fix pep8 extra lines error (#25666) 2017-06-13 13:59:23 -04:00
Dag Wieers
bf43eb92f5 win_firewall: check-mode support, integration tests (#25127)
* win_firewall: check-mode support, integration tests

This PR includes:
- Check-mode implementation
- Documentation improvements
- Ensure module output is consistent (no matter what profiles are provided)
- Fixed indentation
- Cosmetic changes
- Integration tests

* win_firewall: check-mode support, integration tests

This PR includes:
- Check-mode implementation
- Documentation improvements
- Ensure module output is consistent (no matter what profiles are provided)
- Fixed indentation
- Cosmetic changes
- Integration tests
2017-06-13 17:32:22 +01:00
Brian Coca
4ee348e564 draft constructed groups plugin (#23374)
* draft constructed groups plugin

can use fact cache as vars source

* pw4er5e
2017-06-13 10:46:40 -04:00
Brian Coca
37acb7423b add deprecation notice for sudo/su cli options (#23983)
* add deprecation notice for sudo/su cli options

* updated as per feedback
2017-06-13 10:46:09 -04:00
Brian Coca
c4169d93e8 add validation to fetch for source/dest
also added missing display
2017-06-13 10:37:14 -04:00
Brian Coca
13d3b27a0a Get warnings/deprecations per item in loop
warnings and deprecations were only returned for the top level of a task, this now deals with them in loop
deduplication still occurs so only unique ones will be shown to user.

fixes #25258
2017-06-13 09:54:00 -04:00
Toshio Kuratomi
90b1d780eb Fix redis cache for python3
According to the redis-py docs, zrank will return the 0 based index for
the value in the sorted set.  So the logic here wasn't right to begin
with (It just means that a value at the 0-th position would never show
up as cached).  Need to compare against None to know if the value
exists in the cache.

https://redis-py.readthedocs.io/en/latest/#redis.StrictRedis.zrank

Fixes #25590
2017-06-13 09:50:46 -04:00
Brian Coca
498aea8acc Revert "Add log_only to debug messages (#25545)"
This reverts commit 9e8cc26720.
2017-06-13 09:29:18 -04:00
Sloane Hertel
00d5de3dec fix return value (#25611)
document the returned
2017-06-13 09:18:58 -04:00
Ganesh Nalawade
9e8cc26720 Add log_only to debug messages (#25545)
Fixes #25544
When `debug` is enabled the debug messages triggered
from `bin/ansible-connection` should be logged only to file
and not on stdout.
2017-06-13 18:41:33 +05:30
Abhijeet Kasurde
f65ced0438 cloudstack: Use errortext from router in cs_router (#25634)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-13 11:11:53 +02:00
Abhijeet Kasurde
b7558f5018 Add missing msg keyword in fail_json (#25635)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-13 11:11:11 +02:00
jhawkesworth
e017bf964e Small improvement to the way the powershell code lines render in win_say module (html rendering only, still does not break lines properly in ansible-doc) (#25624) 2017-06-13 08:18:32 +01:00
netservers
d5becd728e Have cs_host search both name and ipaddress fields when fetching the host from listHosts. (#25628)
Make ip_address an alias of name to allow playbooks to more clearly make
use of IP addreses.
2017-06-13 07:30:59 +02:00
Simon Staszkiewicz
eb7530df95 Correct link to DescribeInternetGateway docs (#25622)
Old link pointed to DescribeRoutingTable documentation instead of DescribeInternetGateway documentation.
2017-06-12 20:30:30 -04:00