Commit graph

14838 commits

Author SHA1 Message Date
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
Samuel Boucher
488acc750f Feature/lookup keyring (#18379)
* Add keyring lookup

* Better error control

* Update keyring.py

* Update keyring.py

typo
2017-01-31 17:26:19 -05:00
Matt Clay
2adc71fabc PEP 8 fix. 2017-01-31 13:38:05 -08:00
Brian Coca
f4b6b72c5b Warn reserved (#20567)
* removed unused vars

* added warning when using reserved vars

fixes #4816

* cleanup
2017-01-31 15:35:28 -05:00
Adrian Likins
b3b598c835 Rhn register misc fixes (#20724)
* Remove monkeypatching of rhn config in rhn_register

rhn_register.Rhn() was doing some complicated monkeypatching of
the up2date_client.config.Config() class to add a default config
value. Since that was only used in one place, remove the monkeypatch
and handle the single default case.

That case was 'server_url' option, so replace it with a Rhn.server_url
property. Also handle the error case when no server url is provided.

* refactoring
* flatten some indention levels
* add 'enable_eus' to module doc
* set enable_eus var and use it directly
* style/pep8/etc cleanups
* some import cleanups

types was unused, os/re were from module_utils * import

* remove * import from module_utils.redhat
* remove * imports from module_utils.base
* remove unused Rhn._subscribe method
* cleanup pep8 style stuff
* remove a unused default mutable arg from Rhn.subscribe

Rhn.subscribe() only gets called in one place, and thats
with channels from module_params which default to [] and
are typed as a list.
2017-01-31 15:23:27 -05:00
Will Thames
38ff9b735e Fix python3, fix flake8, use common code
Update exception handling, remove use of iteritems
Update for better flake8 compliance

Use ansible_dict_to_boto3_filter_list rather than
duplicating its implementation
2017-01-31 14:49:50 -05:00
Etherdaemon
2e35d5716b Remove camel_dict_to_snake_dict as this was breaking the module itself - the result is a list 2017-01-31 14:49:50 -05:00
Etherdaemon
b0c49c7141 Update typo for connection to the get_nat_gateways function 2017-01-31 14:49:50 -05:00
Etherdaemon
e6821b3472 New facts module for ec2 nat gateway facts module 2017-01-31 14:49:50 -05:00
Brian Coca
e6f92bc3a9 reworded conditional skipping to not imply error
fixes #19068
2017-01-31 13:33:29 -05:00
Vlad Glagolev
039d207d24 Add Source Mage GNU/Linux facts (#19671)
* Add Source Mage GNU/Linux facts

* Add unit test for OS-detection
2017-01-31 13:25:36 -05:00
Matt Clay
524e5d2c39 PEP 8 cleanup. 2017-01-31 10:16:59 -08:00
Toshio Kuratomi
5c38f3cea2 Combine jimi-c and bcoca's ideas and work on hooking module-utils into PluginLoader.
This version just gets the relevant paths from PluginLoader and then
uses the existing imp.find_plugin() calls in the AnsiballZ code to load
the proper module_utils.

Modify PluginLoader to optionally omit subdirectories (module_utils
needs to operate on top level dirs, not on subdirs because it has
a hierarchical namespace whereas all other plugins use a flat
namespace).

Rename snippet* variables to module_utils*

Add a small number of unittests for recursive_finder

Add a larger number of integration tests to demonstrate that
module_utils is working.

Whitelist module-style shebang in test target library dirs

Prefix module_data variable with b_ to be clear that it holds bytes data
2017-01-31 09:41:24 -08:00
sebastianneubauer
3f14061584 s3 module: fix urlparse invocation and netloc mixup on Python 3 (#20836) 2017-01-31 11:54:29 -05:00
Doug Bridgens
65f561e496 added ldap auth capability to hashi_vault plugin (#20244)
* added ldap authentication capability
2017-01-31 11:25:50 -05:00
Adrian Likins
ee9ab6c665 Show valid bool symbols in error for invalid bool symbol 2017-01-31 10:39:16 -05:00
Eugene Krokhalev
eb7495efaf unicode is absent in case of python3 - fix it (#20861) 2017-01-31 10:17:04 -05:00
Brian Coca
7e6758873c added warnings list to module and autoadd
added better way of adding warnings to return data
backwards compatible if warnings key already exists
added deprecations made iface more generic
changed to enforce type per item
added logging of warnings/deprecations
also display deprecations by default
2017-01-31 10:03:09 -05:00
Matt Clay
503e85ed0e PEP 8 E111 cleanup. 2017-01-30 20:33:31 -08:00
Matt Clay
85300883ef PEP 8 E111 cleanup. 2017-01-30 20:17:35 -08:00
Matt Clay
5f89fc4a68 PEP 8 E111 cleanup. 2017-01-30 20:08:33 -08:00
Matt Clay
23f2efbc8d PEP 8 E111 cleanup. (#20841) 2017-01-30 18:03:13 -08:00
Matt Clay
462ab6b1db PEP 8 E111 cleanup for nxos modules. 2017-01-30 15:45:05 -08:00
Steve Kuznetsov
4a57cba86d ec2_group_facts: Fail correctly when boto3 is not installed
Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
2017-01-30 15:03:56 -08:00
Matt Clay
cb76200c7d PEP 8 E111 & E114 cleanup. (#20838) 2017-01-30 15:01:47 -08:00
David Shrewsbury
83d767ca37 Merge pull request #20832 from Logan2211/os-network-provider-types
os_network: Allow freeform provider_network_type string
2017-01-30 15:34:13 -05:00
Brian Coca
a26c771bd9 fix cowsay for py3 2017-01-30 15:16:15 -05:00
Brian Coca
9ac9d42030 allow empty whitelist 2017-01-30 15:13:44 -05:00
Brian Coca
8030f6fd45 removed module merged by mistake with facts change
should be it's own PR
2017-01-30 15:11:15 -05:00
Toshio Kuratomi
1434d5f11f Fix for swupd documentation 2017-01-30 11:58:53 -08:00
Logan V
7ef92e4c7a os_network: Allow freeform provider_network_type string
Prescribing types is not necessary as the underlying shade library
does not do so, and the Neutron API will inform us if a disallowed
or non existent type is used.

Fixes #20830
2017-01-30 13:58:41 -06:00
Andreas Mosti
bc432b4001 Example of usage in znode documentation #20816 2017-01-30 14:41:44 -05:00
Jasper Lievisse Adriaanse
7156ad7153 Add support for additional properties when creating new VMs. (#20792)
* Add support for additional properties when creating new VMs.

All vmadm(1M) options except those specific to SDC(-docker)
are now supported.

* Mark password options as no_log

Change-Id: I9dfd80e7ba5ecfc8f45ecfbe9ec098e66647e9a4
2017-01-30 14:22:54 -05:00
Alberto Murillo Silva
108b5fc502 Add support for ClearLinux
* Set ansible_os_family to 'ClearLinux'
* Set ansible_distribution to 'ClearLinux'
* Add swupd.py plugin

Fixes #20824

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2017-01-30 14:12:20 -05:00
Nathaniel Nutter
5aac2a4240 fix exception when an image has no name
This prevents an exception from occurring when an image has no name.  While images normally have names it is possible, at least on older versions of Docker, for an image to "lose" its name during a failed `docker rm`.
2017-01-30 14:09:10 -05:00
Brian Coca
53cf229fb7 updated friendlier description 2017-01-30 13:42:58 -05:00
Wayne Witzel III
0e72f3bd71 Ansible Tower organization module (#20355)
* add Ansible Tower organization module

* skip Python 2.4 check for ansible_tower module

* make spec and doc match, extract tower auth helper method

* added auth params at module level

* support check mode

* extract check mode check to ansible_tower utils, add utils to 2.4 skip

* update interpreter shebang

* remove colon from docs

* no log for password, verify_ssl default to true
2017-01-30 13:42:32 -05:00
Toshio Kuratomi
61ccc847d7 Fix service's exec_command() for python3 (#20826)
* Fix service's exec_command() for python3

exec_command() was mixing text and bytes in several places on python3.
Made changes so that we explicitly convert between the two.

Fixes #20818

* Also handle basestring and shlex.split in a python2/python3 compatible fashion
2017-01-30 13:08:31 -05:00
Toshio Kuratomi
4f960a4f42 Fix import of urlparse on python3
Should fix the error reported here:
https://github.com/ansible/ansible/issues/17495#issuecomment-267921719
2017-01-30 09:41:01 -08:00
Ricardo Carrillo Cruz
e70bc06ea1 Refactor iosxr_command to make use of network_connection plugin (#20772) 2017-01-30 17:52:19 +01:00
Dag Wieers
bbaab6ee5b Show remote host in error message. (#20823)
* Show remote host in error message.

* Typos :-/
2017-01-30 11:16:13 -05:00
Brian Coca
81c614023c improved openrc detection 2017-01-30 11:12:36 -05:00
Brian Coca
f87e67cfb6 added runit and daemontools to service mgr detect 2017-01-30 11:12:36 -05:00
Brian Coca
294a23d7f6 renamed sv to runit, avoid svc confusion 2017-01-30 10:24:43 -05:00
James Sumners
693c176f43 Add sv module to manage runit services #20181 (#20471)
* Add sv module to manage runit services

* Add mission `restarted` method
2017-01-30 10:22:54 -05:00
hloeffler
8b14935521 add META Output for -vv, better than nothing 2017-01-30 09:14:50 -05:00
Ted
772f8f4854 Add bigmon policy module (#20584)
* Cleanup fork

* Add bigmon_policy module

* Remove docker files from commit, fix formatting, add CHANGELOG.md entry

* Put change in CHANGELOG.md in alph order and add the alias to access_token doc

* Fix access_token type, drop the alias, and fix doc

* Capitalize letter, delete redundant notes, make validates_certs True by default

* Add validate_certs to example

* Try fixing trailing space

* Try adding a trailing space

* Try removing trailing space at end of file

* Add newline at end of file and fix trailing space
2017-01-29 15:31:37 +00:00
Matt Clay
10d9318de7 PEP 8 indent cleanup. (#20800)
* PEP 8 E121 cleanup.

* PEP 8 E126 cleanup.

* PEP 8 E122 cleanup.
2017-01-29 07:28:53 +00:00
Matt Clay
1c6bb4add9 Remove duplicate import. 2017-01-28 12:45:45 -08:00
Peter Sprygada
85d78390f9 adds new module eos_system (#20797)
* provides declarative resource for configuring eos system parameters
* supports network_cli connection plugin only
* adds unit tests for module using mock interfaces
2017-01-28 11:07:51 -05:00
Peter Sprygada
d2dd2fbe49 adds module eos_banner (#20796)
* new module allows for configuration of eos multiline banners
* adds unit test cases for module
2017-01-28 10:32:04 -05:00
Peter Sprygada
634338f062 reorganizes eos shared module (#20795)
* adds send_config function to handle pushing configuration commands
* adds support for handling multiline banner commands
* adds env var check to enable or disable config sessions
2017-01-28 10:31:53 -05:00
Matt Clay
e2c0b375d3 PEP 8 cleanup. (#20790)
* PEP 8 E115 cleanup.
* PEP 8 E131 cleanup.
2017-01-28 01:39:40 -08:00
Matt Clay
d0d1158c5e PEP 8 cleanup. (#20789)
* PEP 8 E703 cleanup.
* PEP 8 E701 cleanup.
* PEP 8 E711 cleanup.
* PEP 8 W191 and E101 cleanup.
2017-01-28 00:12:11 -08:00
Michael Johnson
c29d1e3162 default voice of Alex seems safer (#20718) 2017-01-28 07:59:28 +01:00
Matt Clay
d913f69ba1 PEP 8 W291 whitespace cleanup. 2017-01-27 17:08:02 -08:00
Matt Clay
95789f3949 PEP 8 whitespace cleanup. (#20783)
* PEP 8 E271 whitespace cleanup.
* PEP 8 W293 whitespace cleanup.
* Fix whitespace issue from recent PR.
2017-01-27 15:45:23 -08:00
Dag Wieers
802fbcadf8 win_file: Add check-mode support (#20671)
Also a small cleanup
2017-01-27 15:44:16 -08:00
Dag Wieers
93bb6b8eaf win_uri: module cleanup and added check-mode support (#20511)
The following changes have been made:
- Added check-mode support
- Added parameter type support
- Replace PSObject by a normal dictionary
- Improve idempotency (only when $dest is provided it is not idempotent (yet)
2017-01-27 15:24:32 -08:00
Dag Wieers
ba02d9b85c Add -type "path" to path and creates parameter (#20402)
I intended to update the documentation, but it appears the website docs
are behind the actual documentation (as the website doesn't show the
default values for booleans).

So I ended up adding the missing -type "path" and use the default $null
value for undefined parameters.
2017-01-27 15:11:09 -08:00
Dag Wieers
a657572240 Removing an non-existing directory complains (#19014)
The following playbook:

```yaml
- hosts: localhost
  tasks:
  - file:
      path: /tmp/non-existing-foo-bar
      state: absent
      recurse: yes
```

causes this error:

```
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "recurse option requires state to be 'directory'", "path": "/tmp/non-existing-foo-bar", "state": "absent"}
```

The included fix ensures that when recurse is added, we no longer assume
it is a file, but accept that it is a directory.
2017-01-27 14:58:31 -08:00
Jordan Borean
971783a7fd Feature/win stat extra info (#19148)
* Added more return results to win_stat

* Changed Win2012 methods to support older versions in setup

* staging of the tests to work with older servers
2017-01-27 14:51:12 -08:00
Dag Wieers
a655e90e41 powershell.ps1: Use Get-AnsibleParam and more (#20518)
- Harmonize the name $params like most modules
- Use `return` consistently for return values (easier to read)
- Implement Get-AnsibleParam internally using -type "bool"
- Use a dictionary for $result
2017-01-27 14:46:21 -08:00
Matt Clay
63b1e0c277 Fix infrequent PEP 8 issues. 2017-01-27 14:06:21 -08:00
Peter Sprygada
6c89c587cc refactors eos_config module to use network_cli (#20741)
* update eos_config to use eapi exclusively and remove cli transport
* add unit test cases for eos_config
* updates action plugin to handle both eapi and network_cli connections
2017-01-27 16:23:18 -05:00
Dag Wieers
a60c051952 win_ping: Make full-functional
Small cleanup and backport `ping` functionality.
2017-01-27 13:23:01 -08:00