Commit graph

17093 commits

Author SHA1 Message Date
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
Abhijeet Kasurde
0770b1018c Correct variable name in vca_nat module
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 19:36:08 -04:00
Abhijeet Kasurde
a4f1738082 Fail module instead of returning boolean value
Fix added to fail module instead of returning boolean value
which raises AttributeError.

Fixes #21770

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 17:55:22 -04:00
ademmers
025b52938e system/service module initctl location usage (#19712)
* Call initctl version based on initctl's retrieved location

* Remove the use of start/stop/restart in favor of initctl

* Provide correct argument order for initctl usage
2017-06-12 15:29:08 -04:00
Sloane Hertel
3f0c47196e [cloud] s3: deleting a nonexistent bucket should not give a traceback Fixes #25445 (#25487)
* trying to delete a nonexistent bucket should not fail

* Improve error handling for deleting s3 bucket

* Allow successful deletion

* Add test for deleting a nonexistent bucket

rename integration test target from s3 to aws_s3
2017-06-12 13:52:25 -04:00
Abhijeet Kasurde
7521be73c1 Add missing import for get_exception
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 13:18:54 -04:00
Brian Coca
ff4c308359 fixed issue with empty string 'packages'
also cleaned up unused imports/vars
fixes #25582
2017-06-12 12:59:16 -04:00
Abhijeet Kasurde
077a2df1d6 Return exception as string
Pyodbc returns exception as Python Exception class,
typecast as string for fail_json.

Partially fixes: #25010

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 11:26:54 -04:00
Abhijeet Kasurde
da6f6d27e8 Add Description parameter in os_user
Fixes #18914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 10:56:34 -04:00
Monty Taylor
45f07fdeae Make auto_ip in os_server not always return changed (#25540) 2017-06-12 16:48:46 +02:00
Alan Loi
3ac9273507 Fix hash_key_name to be optional for delete (#25009) 2017-06-12 10:25:43 -04:00
Alan Loi
c23e3c1913 Fix version_added for tags and wait_for_active_timeout params (#24993) 2017-06-12 10:19:41 -04:00
Vinay Dandekar
45019e440f Add Linux Mint to Debian OS family in setup facts 2017-06-12 09:27:03 -04:00
Abhijeet Kasurde
e160bcf237 Correct fail_json call in rpm_key
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 09:11:03 -04:00
willricardo
dd1f5d7acd ec2 module conver basestring to string_types (#25503) 2017-06-12 08:48:38 -04:00
Will Thames
16b877e2b3 ec2_asg and ec2_asg_facts module improvements (#25166)
* ec2_asg and ec2_asg_facts module improvements

Return target group information for both ec2_asg and ec2_asg_facts
modules

Provide RETURN documentation for ec2_asg module

PEP8 fixes for ec2_asg_facts

* ec2_asg: use pagination when describing target groups

In case an ASG has 100s of target groups, ensure that
we get the full result using build_full_result
2017-06-12 07:15:04 -04:00
Abhijeet Kasurde
b89cb95609 Fix spelling mistakes (comments only) (#25564)
Original Author : klemens <ka7@github.com>

Taking over previous PR as per
https://github.com/ansible/ansible/pull/23644#issuecomment-307334525

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 07:55:19 +01:00
Pilou
460d932aa8 postgresql_user: fix bugs related to 'expires' option (#23862)
* Factorize tests related to no_password_change using an include task

* Refactor: deduplicate tasks

* postgresql_user: test 'expires' parameter

* Change 'valid until' even it's the only updated field

* value is changed when another value is provided

* value isn't returned when unset

* Remove unused variable

* psycopg2.extras.DictRow is able to handle comparison

* postgresql_user: simplify helper method

* postgresql_user: define variable just before using it

* Fix comparison between user input and applied configuration

* new test: adding an invalid attribute

* Refactor, add cleaning task

* Check that using same attribute a 2nd time does nothing

* Always try to remove created user

* postgresql_user: fix pep8
2017-06-11 14:48:39 -07:00
Abhijeet Kasurde
301cbc1f5b Remove unreachable code from cron module (#25577)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-11 07:35:46 +02:00
Matt Martz
23eebb62e6 Convert docker cmd output to native, early 2017-06-10 07:09:04 -07:00
Matt Clay
a18cc45778 Fix PEP 8 issue. 2017-06-10 14:07:15 +08:00
Brian Coca
5717f4f161 updated cache descriptions 2017-06-09 23:48:47 -04:00
Brian Coca
cdcbd84088 refactor of virtualbox plugin, fixed cache use 2017-06-09 23:48:47 -04:00
Matt Martz
392934f1b9 Fix pep8 issue in lib/ansible/inventory/manager.py (#25562) 2017-06-09 18:40:36 -05:00
Brian Coca
cc66bd4ad0 moved general pattern cache into object
no real reason this is a class global
2017-06-09 15:30:11 -04:00
Adrian Likins
4befefd78c Try to show original exception info for yaml (and other) errors (#24468)
* show original exception for yaml (and other) errors

In places where we need to catch a yaml error and raise
an AnsibleError, add the orig yaml exc to the AnsibleError
via the orig_exc arg.

When the AnsibleError is displayed it will now include the
AnsibleError (AnsibleParserError for example) and the type
and message from the original yaml exception.

This provides more detail to the error messages related to
yaml errors.

This also improves errors from dataloader (for example,
previously if a wrong password was used for a vault encrypted
yaml file, the error was very vague and suggested yaml errors,
but now the message includes the original exception from vault
indicating the password was incorrect or missing).

Add a text note to playbook helper asserts. For playbook
syntax/layout errors that aren't yaml errors, but errors
indicating invalid data structures for a playbook/task/role/block,
we now include some info about where the assert was and
why it was raised.

In places we raise an AnsibleParserError in an except
clause, pass the original exception to AnsibleParserError via
orig_exc arg.

Make assorted error messages a little more specific (like
the playbook helper load methods)

* Revert "Include the original YAML error in syntax error messages"

This reverts commit 781bb44b02.
2017-06-09 13:13:15 -04:00