Commit graph

14803 commits

Author SHA1 Message Date
Toshio Kuratomi
f75ffe46db Make configparser imports python3 ready
the ConfigParser module was renamed to configparser in Python3.  Use
six.moves to import it so that the modules will function on Python3.
2017-02-03 21:15:34 -08:00
Ryan S. Brown
bb9ee0cf6f [cloud][aws] Make s3_object_version truly optional in lambda module 2017-02-03 16:22:54 -05:00
Brian Coca
a2c38c47aa added docs for vault and made trigger shorter: !vault (#20985)
* added docs for vault and made trigger shorter: !vault

* added single var valuting

* Update playbooks_vault.rst

Edit pass for spelling and grammar. Ship it!

* Update playbooks_vault.rst

Typo fixes.
2017-02-03 15:28:50 -05:00
Davis Phillips
00fdec1d60 closes #21011 (#21015) 2017-02-03 13:57:19 -05:00
Toshio Kuratomi
d1a6b07fe1 Move ssh and local connection plugins from using raw select to selectors
At the moment, this change will use EPoll on Linux, KQueue on *BSDs,
etc, so it should alleviate problems with too many open file
descriptors.

* Bundle a copy of selectors2 so that we have the selectors API everywhere.
* Add licensing information to selectors2 file so it's clear what the
  licensing terms and conditions are.
* Exclude the bundled copy of selectors2 from our boilerplate code-smell test
* Rewrite ssh_run tests to attempt to work around problem with mocking
  select on shippable

Fixes #14143
2017-02-03 08:23:50 -08:00
jhawkesworth
2c70450e23 Fix 'touch' mode so it creates zero size files. (#20876) 2017-02-03 13:36:47 +01:00
Peter Sprygada
289fb8e895 remove unneeded eos_cli shared module (#20999) 2017-02-02 22:36:52 -05:00
Peter Sprygada
d226f31a0f fixes ios and eos command modules (#20989)
* returns support for prompt/response over cli
* now sends native dict instead of str command
* fixes issue with run_commands() in ios to jsonify request
* updates unit test cases
2017-02-02 22:10:14 -05:00
René Moser
62c97cdd3e ios_cli: fix load_config exec_command (#20994)
fixes AttributeError: 'AnsibleModule' object has no attribute 'exec_command'
2017-02-02 21:13:03 -05:00
Toshio Kuratomi
1df7d95cec Module utils default path (#20913)
* Make the module_utils path configurable
* Add a config value to define the path site module_utils files
* Handle module_utils that do not have source as an error
* Make an integration test for module_utils envvar working
* Add documentation for the ANSIBLE_MODULE_UTILS config option/envvar
* Add it to the sample ansible.cfg
* Add it to intro_configuration.
* Also modify intro_configuration to place envvars on equal footing with
  the config options (will need to document the envvar names in the
  future)
* Also add the ANSIBLE_LIBRARY use case from
  https://github.com/ansible/ansible/issues/15432 so we can close out
  that bug.
2017-02-02 17:48:53 -08:00
Peter Sprygada
bce0bd401e bug fixes for shell exec command (#20988)
* fixes up eos_local to call appropriate method
* fixes up ios_cli to call appropriate method
* moves json conversion to eos
2017-02-02 18:32:36 -05:00
Toshio Kuratomi
fee6e2953b Split on newlines when checking for prompt matches (#20945)
* Check for the prompt as a substring of the output

sudo sometimes spits out warnings to stdout before getting to the
password prompt.  Account for that when trying to match a password
prompt.

Fixes #20858
2017-02-02 14:31:11 -08:00
Toshio Kuratomi
62ba084003 Do not substitute ssh_exeuctable until we need to
We need to use ssh_executable instead of hardcoding ssh in the command
we run but we need to use "ssh" when we lookup the value of the
{command}_extra_args variable.  Do this by leaving binary as "ssh" and
only expanding when we place it into b_command.

Fixes #20862
2017-02-02 13:43:39 -08:00
Ondra Machacek
de2b6469e9 [cloud][ovirt] new module ovirt_snapshots & ovirt_snapshots_facts (#20936)
* cloud: ovirt: add snapshots module

* Move imports in ovirt_snapshots module to match style & pass CI

* Move ovirt_snapshot_facts imports to comply w/ CI
2017-02-02 16:34:54 -05:00
Ondra Machacek
684c766e20 cloud: ovirt: add host engine options to ovirt_hosts (#20967) 2017-02-02 16:24:24 -05:00
Matt Martz
829c0b8f62 Update validate-modules (#20932)
* Update validate-modules

* Validates ANSIBLE_METADATA
* Ensures imports happen after documentation vars
* Some pep8 cleanup

* Clean up some left over unneeded code

* Update modules for new module guidelines and validate-modules checks

* Update imports for ec2_vpc_route_table and ec2_vpc_nat_gateway
2017-02-02 11:45:22 -08:00
Nathaniel Case
1718719d77 vyos_facts 2.3 (#20939)
* Update vyos_facts documentation

* Replace runner for run_commands

* vyos_facts tests

* Update documentation

* vyos_facts is supported by core
2017-02-02 14:45:06 -05:00
Peter Sprygada
76ccfe4627 fixes handle_prompt in shell module (#20982)
* transforms command objects to dict
* transforms string commands to dict
2017-02-02 14:27:55 -05:00
Tobias Rüetschi
4f117df6ec univention udm_user: add parameter to control password update (#20699)
* univention udm_user: added support to set the password always

* module udm_user: added version 2.3 to update_password
2017-02-02 14:10:32 -05:00
Ondra Machacek
4269b12c9d Ovirt vms improve (#20882)
* cloud: ovirt: add function to get id by name

* cloud: ovirt: add instance type parameter

* cloud: ovirt: use param method instead of module.params

* cloud: ovirt: use 'and' at begging of next line

* cloud: ovirt: add description parameter to vms module

* cloud: ovirt: add comment parameter to vms module

* cloud: ovirt: add timezone parameter to vms module

* cloud: ovirt: add serial_policy parameter to vms module
2017-02-02 13:51:26 -05:00
Ondra Machacek
ee7f1cde0e ovirt: Add support to diff (#20698)
* cloud: ovirt: Add diff support to

* cloud: ovirt: Add ability to print nested list of objects

* cloud: ovirt: Fix waiting while reinstalling host

* cloud: ovirt: fix ovirt_vms 404 error

* cloud: ovirt: add check_mode support to ovirt_auth module
2017-02-02 13:50:52 -05:00
Brian Coca
6ca5fb49c3 allow debug to be 'changed' (#20957)
* allow debug to be 'changed'

fixes #14430

* removed test that checked against this
2017-02-02 13:46:16 -05:00
Nathaniel Case
d87fc9605f vyos_config 2.3 (#20577)
* Rename vyos2 over vyos

* Update vyos_config to LocalAnsibleModule

Change result key 'updates' -> 'commands'

vyos_config is supported by core

* vyos_config tests

* Enable bracket config use

* Sanitize config before use
2017-02-02 13:12:26 -05:00
Peter Sprygada
1e2afd57ae fix up eos doc frags (#20981)
* fix modules with invalid doc frags
* remove unneeded doc frags
2017-02-02 12:15:23 -05:00
s-hertel
0ed1e6a1f3 [cloud] rds module: handle parameters that are False, but also not the default value. Fixes #20370 (#20646)
Boolean options that default as `None` but are set to `False` by the user were ignored on update. This change checks to distinguish None & False so that options like multi_az can be turned off during an update. 

* Modifying how optional parameters are handled in rds.py. Fixes #20370

Allowing options to be set to false/no. Previously ignored unless set to true/yes.

Added a conditional for invalid parameters since the default is false instead of null for some options (e.g. force_failover, apply_immediately, upgrade).

* Making requested revision.
2017-02-02 09:49:19 -05:00
Stephane Maarek
c33812450e fixed type mapper and added tests (#20963) 2017-02-02 09:46:17 -05:00
Dag Wieers
3dbce15ccb win_shortcut: Add missing $check_mode definition + bugfix + tests (#20911)
* win_shortcut: Add missing $check_mode definition

For some reason this entry was missing, possible a merge-conflict gone
wrong :-(

* Added integration tests and bugfix

Add missing changes.
2017-02-02 10:29:56 +01:00
Will Thames
afe29977cb Revert "clean up unused doc fragments"
Those "unused" doc fragments are still referenced

lib/ansible/modules/network/eos/eos_config.py:extends_documentation_fragment: eapi
lib/ansible/modules/network/eos/eos_facts.py:extends_documentation_fragment: eos

This reverts commit 246cd041d8.
2017-02-01 23:40:35 -08:00
Peter Sprygada
e19c2f6a6d adds the cli transport back to the ios modules (#20949)
the cli transport was initially removed to aid in the transition to
network_cli.  This adds the function back to the provider can be
specified.
2017-02-01 23:06:42 -05:00
Peter Sprygada
246cd041d8 clean up unused doc fragments 2017-02-01 22:43:24 -05:00
Peter Sprygada
d8d0b007e3 adds support for eos_local connections to eos modules (#20961)
* updates modules to use eos_local
2017-02-01 22:37:57 -05:00
Peter Sprygada
1d7c71ce50 adds eos_local shared module to handle local connections (#20960)
* adds support for eapi
* adds support for cli
* adds doc fragement
2017-02-01 22:21:18 -05:00
Peter Sprygada
67646a0771 fixes exec_command in shell (#20948)
transforms command to dict for processing by instance of Shell
2017-02-01 18:14:53 -05:00
Brian Coca
d4a8816f48 added back return false for when not debian 2017-02-01 15:58:32 -05:00
Will Thames
da1c13705d Disassociate EC2 VPC subnets from route tables before deletion (#20114)
* Disassociate subnets from route tables before deletion

If a route table still has subnets associated with it, it will fail
to delete:

```
"msg": "The routeTable 'rtb-abcd1234' has dependencies and cannot be deleted."
```

Avoid this by disassociating subnets before route table deletion

* Fix ec2_vpc_route_table flake8 complaints
2017-02-01 15:36:51 -05:00
Will Thames
950ff3f24a Fix EIP release in ec2_vpc_nat_gateway (#20167)
* Check if EIP exists before deleting it

After deleting the NAT gateway, the EIP sometimes seems to
cease to exist afterwards. Check if it exists before deleting it.

Otherwise you get:
```
Failed to release EIP eipalloc-abdc1234: An error occurred (InvalidAllocationID.NotFound) \
when calling the ReleaseAddress operation: The allocation ID 'eipalloc-abcd1234' does not \
exist", "success": false}
```

* Fix flake8 errors with ec2_vpc_nat_gateway
2017-02-01 15:32:03 -05:00
Maxime Deravet
0d2d25b515 Fix for #20473 - If there is no instance in the ASG, we initialize an empty array for properties['instances'] (#20475) 2017-02-01 15:29:18 -05:00
Brian Coca
86db15b105 last ditch debian release data (#20571)
fixes #10445
2017-02-01 13:15:02 -05:00
Brian Coca
91b363ea9e allow device to be list for multidev fs (#20655)
* allow device to be list for multidev fs

fixes #20551

* reverted command to string
2017-02-01 13:13:12 -05:00
René Moser
541a51ddf7 module_utils: implement deprecation warning for params (#20884)
* module_utils: implement deprecation warning for params

* rename deprecated_version to removed_in_version

* fix pep8 E121
2017-02-01 13:00:22 -05:00
Ganesh Nalawade
511f2b7907 Fix update check issue (#20915)
Add one of condition in required_if
to ensure configuration statements are
present if update value in provided in
playbook.
2017-02-01 10:48:17 -05:00
jctanner
ac78347f2b Use a -short- custom hash for controlpersist path by default (#20843)
* A method to validate and alter the ssh control path automatically.
* First tries %C to use the shortened hash
* On further failure, it removes section by section from the original path
* Fix hostname
* Implement bcoca's suggested changes
* Remove unused option
* Remove unused class var
* Use to_string to avoid unicode error
* Switch from to_text to to_bytes
* Update the example config for the new controlpath feature
2017-02-01 10:39:40 -05:00
Tom Melendez
237b39556c [GCE] External IP Address Module. (#20779)
* [GCE] External IP Address Module.

This module allows users to create and delete External IP Addresses. Both Regional and Global Addresses are supported.

* Removed whitespace causing pep8 issue
2017-02-01 10:08:02 -05:00
naslanidis
c29f52897b [cloud] New module ec2_vpc_igw_facts (#19787)
* added ec2_vpc_igw_facts module

* added cr at end of file

* corrected import json in wrong location

* corrected version added

* added snake_case conversion

* updated documentation and fixed for python 3'

* ec2_vpc_igw_facts: simplify logic

Make module arguments more 'Ansiblish'
Remove unnecessary intermediate variables in results generation
Use `ansible_dict_to_boto3_filter_list` rather than duplicating logic
Use `check_mode` rather than pass a `dryrun` argument
Update for flake8 improvements

* updated documentation
2017-02-01 09:47:47 -05:00
Peter Sprygada
406c9e01a2 moves the module utils network cli transport into a separate module (#20921)
This move will allow for the cli transport to go through a deprecation
process as we transition to network_cli plugin
2017-02-01 08:19:55 -05:00
Peter Sprygada
9ab0a49ef2 removes assert and uses to_list common function (#20866)
non impacting change to refactor assert statement out of ios shared
module
2017-02-01 08:19:15 -05:00
Ivan Bojer
327ad42ff2 new panos module to import software or configuration file into firewall (#19901)
* # This is a combination of 6 commits.
# The first commit's message is:
new module to import software or configuration file onto firewall

# This is the 2nd commit message:

changes based on the review comments; remove unecessary if statements; change returned value docstring

# This is the 3rd commit message:

empty checkin to trigger ANSIBLEbot

# This is the 4th commit message:

added additional exception handling

# This is the 5th commit message:

- added new module info to the changelog as requested

# This is the 6th commit message:

removed blank space as tox checks were failing

* new module to import software or configuration file onto firewall
2017-02-01 12:41:52 +00:00
Ganesh Nalawade
01f4d4a666 module_utils/basic.py: Support logical or condition in required_if (#20220)
* Support logical or condition in required_if

Add logical 'or' condition support in 'required_if'
for requirements.
* If requirements is a list all parameters within it should
  be present.
* If requirements is a set atleast one parameter should
  be present

* Fix review comment
2017-01-31 20:01:29 -08:00
Matt Clay
cdc56afe01 PEP 8 fixes. 2017-01-31 15:18:24 -08:00
Brian Coca
16615811b4 clean up empty warnings/deprecations from modules 2017-01-31 18:13:26 -05:00