Commit graph

16792 commits

Author SHA1 Message Date
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