Commit graph

15607 commits

Author SHA1 Message Date
Gabriele
d7d76f3aaf Fixing nxos_vrf_interface when interface name is not full (#22769) 2017-03-23 22:57:24 -04:00
Luis Rueda
0fe29f8eb1 Update netconf_config.py (#22429)
Fixes issue https://github.com/ansible/ansible/issues/22410
Fix trailing whitespace at the end of line 66
Fix version_added: "2.3" for allow_agent and look_for_keys
2017-03-23 22:54:34 -04:00
Dag Wieers
ac43a1bbbc Windows: Use the correct newline sequence for the platform (#21846)
This change to the template action plugin make template use the
platform's native newline_sequence for Jinja.

We also added the option `newline_sequence` to change the newline
sequence using by Jinja if you need to use another newline sequence than
the platform default.

This was previously discussed in
https://github.com/ansible/ansible/issues/16255#issuecomment-278289414

And also relates to issue #21128
2017-03-23 19:47:10 -07:00
Peter Sprygada
866f67e213 fixes a number of issues with nxos_facts (#22923)
* updates command runs to return warning if command fails
* fixes variable issues from recent refactoring
* removes provider from return of module
2017-03-23 22:35:15 -04:00
Matt Davis
73f50b4f9f fix Windows env handling (#22927)
* fixes #22441
* fixes #22655
* moves all env handling into the exec wrapper; this should work for everything but raw, which is consistent with non-Windows.
2017-03-23 17:48:15 -07:00
Jordan Borean
f1ab879bb6 win_reg_stat change the module parameters for standardisation (#22732) 2017-03-23 15:15:28 -07:00
Jordan Borean
89b78cb5e8 win_share: tweaks after the caching mode changes (#22763)
* win_share: tweaks after the caching mode changes

* Re-added the Unknown option back in
2017-03-23 15:08:53 -07:00
Toshio Kuratomi
2fff690caa Update module_utils.six to latest (#22855)
* Update module_utils.six to latest

We've been held back on the version of six we could use on the module
side to 1.4.x because of python-2.4 compatibility.  Now that our minimum
is Python-2.6, we can update to the latest version of six in
module_utils and get rid of the second copy in lib/ansible/compat.
2017-03-23 13:35:05 -07:00
Toshio Kuratomi
c7c8481181 No need to specialcase comment characters
If the # is inside of quotes, it's a string.  If it's outside of quotes
then an exception will be raised which we'll catch and then send to the
to_text() call at the end of the function anyhow.

Fixes #22868
2017-03-23 13:13:10 -07:00
Toshio Kuratomi
589e217278 base64 functions must be given byte strings
The base64 stdlib functions require byte strings.  So we have to
transform the strings into bytes before handing to the stdlib and then
transform them back into text before handing back to ansible.

Fixes #22873
2017-03-23 12:15:02 -07:00
Toshio Kuratomi
d0712b1ec7 Make yum's state=list obey disablerepo and enablerepo
Fixes #22876
2017-03-23 12:10:59 -07:00
Peter Sprygada
cda3e001c6 fixes issue when host is defined in provider for junos (#22918)
The junos action handler was not honoring the host value in the provider
argument.  This patch will now use the provider host entry if it exists
and falls back to the inventory hostname
2017-03-23 15:05:11 -04:00
Matt Martz
0ced29c51b Don't skip action/__init__.py (#22911) 2017-03-23 13:40:02 -05:00
Matt Martz
ed52d91249 Swap pep8 current to legacy (#22891) 2017-03-23 13:16:55 -05:00
Sloane Hertel
1ca4a42c0e include traceback in exception handling (#22807) 2017-03-23 14:08:02 -04:00
Adrian Likins
0bb3545333 Remove ununsed Connection.log method (#22837)
method referenced 'logger' which no longer exists.
2017-03-23 12:24:39 -04:00
Adrian Likins
dfec69b9a1 Fix bad ref to AnsibleConnectionError -> AnsibleConnectionFailure (#22838) 2017-03-23 10:43:02 -04:00
Dustin Spicuzza
78de05e58d win_iis_webapppool: Use Get-AnsibleParam to retrieve parameter
- Fixes #22805
2017-03-23 07:42:47 -07:00
Adrian Likins
ee478c4885 make netconf.py stylish (#22839)
(flake8 stuff)

netconf.py:22:1: F401 're' imported but unused
netconf.py:23:1: F401 'socket' imported but unused
netconf.py:24:1: F401 'json' imported but unused
netconf.py:25:1: F401 'signal' imported but unused
netconf.py:31:1: F401 'ansible.module_utils.six.moves.StringIO' imported but unused
2017-03-23 10:29:24 -04:00
Brian Coca
91a385b87d etcd doc tests 2017-03-23 01:27:19 -04:00
Brian Coca
d14634ca21 uncommit the crime of extra spaces in docstring 2017-03-23 01:27:19 -04:00
Brian Coca
7839f70e36 Enable documentation in plugins
Made ansible-doc more plugin agnostic
We can have docs in lookup, callback, connectionm strategy, etc
Use first docstring and make pepizis happy
generalized module_docs to plugin_docs
documented cartesian, ssh, default, jsonfile, etc as examples
changed lack of docs to warning when listing
made smarter about bad docstrings
better blacklisting
added handling of options/config/envs/etc
move blacklist to find_plugins, only need once
2017-03-23 01:27:19 -04:00
Brian Coca
d3115ae8f3 put cache base classes in __init__ (#22809)
* put cache base classes in __init__

* added placeholder
2017-03-23 01:26:10 -04:00
Brian Coca
97cb2016d8 keep ansible_local as top level var, always present 2017-03-23 01:25:39 -04:00
Evgeni Golov
7a00f28804 synchronize: explicitly set the executable for localhost
Otherwise the executable for the destination is also used on the local
machine and this might not exist.

Fixes: #22867
2017-03-22 21:27:47 -07:00
Matt Martz
3164e8b561 E501 fixes (#22879) 2017-03-22 20:50:28 -05:00
Glen Maetzig
ac992eff1c Import camel_dict_to_snake_dict method to fix error when executing get_nat_gateways() method
(cherry picked from commit 223fc34ab9)
2017-03-22 16:30:59 -07:00
Shaun Brady
cd24bbbc9c Missing purge_subnets parameter on function call
purge_subnets|routes were introduced recently.
ensure_subnet_associations now takes purge_subnets as a parameter.  A
call to this function was missed when introducing this feature.  With
out, results in a "got 5 expected 6" error.
2017-03-22 16:22:54 -07:00
mjfroehlich
cc50b803df [cloud][route53_health_check] Consider port in identity test (#22762)
Allows to health-check two services on one host. Before, asking for 2 health checks being present for `http://myhost:8888` and `http://myhost:9999`  resulted in just a single health check, as this module considered the two specs as equal.

Bonus: route53_health_check now passes style guidelines
2017-03-22 12:49:39 -04:00
Brian Coca
052be86605 fix for loosing ungrouped hosts in ini
fixes #22861
2017-03-22 12:48:19 -04:00
Brian Coca
5e98be2e62 better handling of parsed
updated tests to match new result output
2017-03-22 12:03:43 -04:00
Brian Coca
9ad62a48ab prevent failure for meta: reset_connection
now plugins that don't explicitly support it give a warning.
2017-03-22 11:00:32 -04:00
Robin Schneider
bbc6af6749 Fix use of unauthenticated connection examples in git module docs
Ref: https://git-scm.com/book/ch4-1.html#The-Git-Protocol
2017-03-22 10:26:48 -04:00
Ricardo Carrillo Cruz
98c98125f0 Fallback to show-run on ios_banner for devices where show banner does not work (#22793)
On switches 'show banner' command doesn't work, fallback to show run|begin banner
and extract the banner text in case that fails.
2017-03-22 10:01:41 +01:00
Matt Martz
02f66b9369 E1 legacy pep8 fixes (#21933)
* E1 pep8 fixes

* e111 fix for rds.py
2017-03-21 21:19:40 -05:00
Ted Timmons
887456ab8e Fix stderr false return value (#22845)
* ensure exit_json does not fail from stderr=False

- do a little bit of safety-checking in exit_json to not try to .splitlines() on a boolean
- remove the stderr=boolean from uri.py, this is the only spot that uses it (at least so obviously)
- add unit tests that call exit_json. These are useless because the stderr parsing is in _execute_module and is difficult to mock; deleting these tests after the commit.

* remove added unit tests per prev commit

exit_json doesn't do the param parsing, that is buried deep inside _execute_module.
2017-03-21 18:11:11 -04:00
Brian Coca
5beb27ef5e use namespaced facts 2017-03-21 17:10:15 -04:00
yuriy-z
40a1f20bea Add storage device WWN to facts for Linux (#16640)
World Wide Name (WWN) is unique identifier of device.
This patch adds this identifier to facts for Linux.
2017-03-21 16:51:18 -04:00
Johan Guldmyr
897201c4be add infiniband network type (#18833) 2017-03-21 16:31:30 -04:00
Christian Albrecht
66818050b0 Add perm_hwaddr on Linux bonding slave nics (#19071)
This patch will additionally report the `perm_hwaddr`
fact of a Linux bonding slave network interface.

Related to issue #19067
2017-03-21 16:29:38 -04:00
Brian Coca
455aff8436 ported fix from ansible-core #5639
From 3d09c94faeaa52075055f23744d8b52581c59bb2 Mon Sep 17 00:00:00 2001
Evan Kaufman <evan@digitalflophouse.com>
2017-03-21 16:03:00 -04:00
Brian Coca
2022fc162a fixed name to unit 2017-03-21 14:28:23 -04:00
Brian Coca
b82aa41e31 removed deprecated config/env vars 2017-03-21 14:02:39 -04:00
Brian Coca
3f4b87f0c0 allow systemd to 'just' reload 2017-03-21 13:49:44 -04:00
Peter Sprygada
d6787632c9 fixes return data structure (#22830)
The return was being re-written instead of updated so warnings were
lost.  This patch now updates the result instead of replacing it.
2017-03-21 14:41:59 +01:00
Joshua C. Randall
e7fd38af78 Fix get_s3_connection (fixes #22317) (#22318)
* Fix get_s3_connection (fixes #22317)

Override aws_connect_kwargs rather than prepending to them. Should fix an issue in which `calling_format` is set twice in the kwargs passed to `boto.connect_s3` or `S3Connection` if a bucket name contains a `.`

* Revert "Fix get_s3_connection (fixes #22317)"

This reverts commit 7f61b8bebd.

* implements alternative way of fixing issue with aws_connect_kwargs for rgw and fakes3 (fixes 22317)

* add comment to explain why the keys are being removed from aws_connect_kwargs

* remove trailing whitespace on comment line
2017-03-21 08:15:53 -04:00
René Moser
e3525d8df9 cloudstack: fix pep8 for loadbalancer modules (#22822) 2017-03-21 11:00:46 +01:00
Peter Sprygada
e20ed8bc0c replaces logging with display for network connection plugins (#22819)
* updates network_cli and netconf connection plugins
* updates ansible-connection
2017-03-20 20:08:02 -07:00
Peter Sprygada
ed7cace425 implements python logging for network connection plugin (#22817)
* enables logging for network_cli and paramiko
* enables logging for ansible-connection
* enabled logging for netconf connection
2017-03-20 19:26:18 -07:00
Joseph Price
ed15ba1b3c CLI: unfrack --private-key path
Relative paths can break the synchronize plugin when the playbook
is not in the current working directory.

Fixes: ansible/ansible#22695
2017-03-20 11:40:17 -07:00
Brian Coca
07d9366ed8 added 'existing' back
fixes #22785
2017-03-20 12:28:35 -04:00
Tom Melendez
1c38cba7ca [GCE] Invalid zone reported through fail_json
* added new helper function for zones and regions.
* modified GCE module to use it

Fixes: ansible/ansible#20616
2017-03-20 10:15:39 -04:00
Peter Sprygada
cdb4d350b4 removes unneeded exception 2017-03-20 09:56:56 -04:00
Ondra Machacek
a46c55b2dd cloud: ovirt: Add sparsify option to ovirt_disks (#22560)
This patch fixes: https://github.com/ansible/ansible/issues/22348
2017-03-20 09:39:16 -04:00
René Moser
24c617766c cloudstack: fix load balancer idempotency if no zone given (#22768)
get_zone() is special, as it always returns a zone (default zone) even
if no zone param is given. This makes sense for many use cases.
2017-03-19 10:07:46 +01:00
David Baumann
634d6894e3 Add Missing default param for caching_mode (#22753)
Add Missing default param for caching_mode and Usage of new Ansible-Param Commant with default Value
2017-03-17 14:44:42 -07:00
Sloane Hertel
4749b75090 [cloud] ec2_eni: don't modify a network interface without eni_id - fixes #22401 (#22689)
* don't modify an eni without eni_id

fix pep8

remove ec2_eni from pep8 legacy files

remove a couple unused variables in main()

fix the documentation

* fix yaml
2017-03-17 16:26:49 -04:00
Sloane Hertel
8ccde6fbb0 [cloud] make docs for ec2_group rules more clear (#22701)
make ec2_group pep8

removed ec2_group from pep8 legacy files
2017-03-17 16:14:20 -04:00
Sloane Hertel
a4552c11b3 allow groups parameter to be noticed as an empty list (#22707)
make iam.py pep8

remove iam.py from pep8 legacy files
2017-03-17 16:11:48 -04:00
Andrea Scarpino
c80d696cec win_file: fix error when creating an existing dir (#19070)
If something else created the dir New-Item will throw an exception and
the task will fail. Check the existing file and as long as it's a dir,
we don't need to error out.
2017-03-17 09:33:57 -07:00
René Moser
b90517caf9 cloudstack: implement config overloading and ENV vars for API auth (#22724)
* cloudstack: fix connection by ENV vars and configs overloading

* cloudstack: pep8 cloudstack module_utils

* cloudstack: allow api_url to be set in ini config

* docsite: explain ENV vars support as written in python-cs for ansible
2017-03-17 11:01:43 +01:00
Tom Melendez
f5f6cf467e [GCE] Support default credentials (#22723)
Add support for default credentials. Practically, this means that a playbook creator would not have to specify the service_account_email or credentials_file Ansible parameters.

Default Credentials only work when running on Google Cloud Platform. The 'project_id' is still required.

A test has been added to trigger this condition.
2017-03-16 17:10:07 -07:00
Matt Davis
ffa4f0c427 Suppress Windows Add-Type debug noise (#22722) 2017-03-16 15:44:42 -07:00
Andreas Mosti
1fa7a3db27 Added example of removing the standard website and port 80 binding (#22457) 2017-03-16 14:52:28 -07:00
Brian Coca
c6dedea1a6 corrected docs 2017-03-16 17:36:03 -04:00
Jens Carl
cd39ff9996 Add parameters to limit replace to certain section of the file
Add parameters 'after' and 'before' to limit the replacement/remove of
lines to a certain section of the file.
2017-03-16 17:34:56 -04:00
Brian Coca
4319ddd5de allow users to control group var merge order (#22580)
* allow users to control group var merge order

With ansible_group_priority var at each group will determine merge order with siblings,
falling back to sorted names when priority is equal as it did before.

Parent/children relationships still work as they did and have higher precedence than priority

* move priority setting to groups, sourc indep

* now both inventory and play group follow priority

* removed double exception handling
2017-03-16 14:02:43 -04:00
jralbert
5334814396 Cast syslogport value from getenv as int (#22664)
SysLogHandler requires an int for port, but getenv produces a string.
Cast return from getenv as int to overcome this mismatch.
2017-03-16 10:38:55 -07:00
Ilya Simonenko
dba8edf735 cloud: docker: Fixes #22638 load image to memory when archive_path provided (#22642) 2017-03-16 10:06:19 -07:00
Brian Coca
4fb8b03f05 added docstring to get_hosts_left 2017-03-16 12:15:17 -04:00
Brian Coca
6a4039e169 readded !vault-encrypted for backwards compat
even though this was never documented someone might be using it
2017-03-16 12:13:15 -04:00
Brian Coca
6b46cc5c73 added new 'order' directive to sort hosts in play
fixes #10964
2017-03-16 12:13:29 -04:00
Ricardo Carrillo Cruz
6e56a61535 Add ios_banner module (#22687)
With unit and integration tests.
2017-03-16 16:35:44 +01:00
Dag Wieers
895664f539 vmware_guest: Fix "KeyError: 'changed'" (#22564)
Due to how the result-dictionary is being used, in some codepaths it would have an empty dictionary.
This then is problematic if the code expects the 'changed' key later on.

I also improved the docs a bit, by clearly marking the parameter names and URL in the documentation.
2017-03-16 10:55:07 -04:00
Ondra Machacek
7a3b6ca37c cloud: ovirt: fix ovirt_nics profile search (#22684) 2017-03-16 08:27:30 -04:00
Brian Coca
dd8d699981 namespace facts (#18445)
* namespace facts

always namespace facts, make the polluting of 'main' conditional on config

* updated to 2.4

* Update intro_configuration.rst
2017-03-15 17:12:16 -07:00
Brian Coca
0c44959800 added new tests any and all (#22665)
* added new tests any and all

* updated code names
2017-03-15 18:09:25 -04:00
Brian Coca
eb0b1e149d warn when failed to match host pattern
fixes #11934
2017-03-15 18:06:21 -04:00
Dylan Silva
9ffad27319 Changed supported_by from curated to community (#22654) 2017-03-15 14:28:33 -07:00
Dylan Silva
4c8da5ad49 changed supported_by from curated to community (#22656) 2017-03-15 14:28:15 -07:00
Dylan Silva
049946b26f Dropped openwrt module from curated to community (#22657) 2017-03-15 14:28:02 -07:00
Brian Coca
517cdbe22a better 'role detection' for dwim (#22513)
* better 'role detection' for dwim

possible fix for #21735

* fixed unmatched paren

* pep does not like the denting
2017-03-15 16:01:04 -04:00
Brian Coca
39ba55e5ac corrected host group ancestor management 2017-03-15 15:46:58 -04:00
Brian Coca
7b0f765a57 made error slightly more neutral in case of 'local' 2017-03-15 15:32:30 -04:00
Brian Coca
273786d0bd simplified pattern matching, fixed ungrouped (#22523)
* simplified pattern matching, fixed ungrouped

ungrouped was ignored for patterns, now it is usable again

* even simpler
2017-03-15 14:25:46 -04:00
John R Barker
08d9a5932f metadata_version 2017-03-15 17:28:52 +00:00
Sloane Hertel
5e67f86586 [cloud] fix ec2_vpc_route_table module documentation - Fixes #19344 (#22367)
* improve ec2_vpc_route_table documentation

* make pep8
2017-03-15 13:14:13 -04:00
Sloane Hertel
3aef028d42 [cloud] make ec2 module pep8 (#22421)
* making ec2 pep8

* remove ec2 from pep8 legacy files

* missed a couple

* fix imports and remove iteritems

* making group_id and group_name mutually exclusive and fixing whitespace
2017-03-15 13:13:25 -04:00
John R Barker
9857ce8ddb Fix render issue (#22650) 2017-03-15 16:31:37 +00:00
John R Barker
f82239e1f7 [WIP] Network module docs 2.3 (#22454)
* Tidy up docs for network 2.3 modules

* Use suboptions

* Correct indentation

* more tidyup

* bulk updates

* more tidyup

* Bulk changes

* nxos_mtu is dead

* revert

* NXOS_mtu is dead, also better layout

* rebase

* rebase
2017-03-15 16:00:43 +00:00
James Cammarata
76f28fd2fc Bumping devel version to 2.4.0 2017-03-15 09:42:01 -05:00
Dag Wieers
72e7927dd5 win_scheduled_task: Added frequency: once and check_mode support (#22611)
* win_scheduled_task: Added frequency: once and check_mode support

This patch includes:
- Renamed `execute:` parameter to `executable:`
- Renamed `argument:` parameter to `arguments:`
- Implemented `frequency: once` support
- Implemented check_mode support
- Fix idempotency issue related to empty description
- Added integration tests

* Improve the integration test structure

I think this is a great way to test normal mode and check-mode from the same playbook.

* Small fixes after review
2017-03-15 07:11:24 -07:00
Ondra Machacek
699df5824d cloud: ovirt: fix update_params for ovirt module_utils (#22637) 2017-03-15 08:04:06 -04:00
Ondra Machacek
bb7e7be71f cloud: ovirt: Fix disk image upload (#22557) 2017-03-15 08:03:18 -04:00
Dag Wieers
9755d2dbbc win_feature: Clean up and check-mode support (#21351)
* Clean up parameter handling and added check-mode support

Changes include:
- Remove trailing semi-colons
- Replaced PSObjects into normal hashes
- Make use of Get-AnsibleParam and types
- Added check-mode support

* Implemented -WhatIf:$check_mode support

* powershell.ps1: Ensure Fail-Json() works with Hashtables

Without this change a dictionary $result object would be emptied if it
is anything but a PSCustomObject. Now we also support Hashtables.

* Revert to original formatting
2017-03-14 19:01:03 -07:00
Dag Wieers
589c483cfc win_chocolatey: Add check-mode support (#22501)
This patch implements:
- check-mode support
- add state "reinstalled"
- cleanup of timeout parameter
2017-03-14 18:57:29 -07:00
Jordan Borean
6ce338d29c win_service Added -Force option and minor cleanup (#22598)
* win_service Added -Force option and minor cleanup

* Changed parameter and fixed typos
2017-03-14 18:53:31 -07:00
René Moser
0ee108bda0 cloudstack: cs_instance: revert VPC support (#22629)
Partly reverts 5374c7cd09
2017-03-15 02:02:38 +01:00
René Moser
a2b6844858 cloudstack: cs_network: fix VPC support (#22627)
* cloudstack: cs_network: fix vpc support

* cloudstack: cs_network: fix pep8
2017-03-15 02:00:40 +01:00
René Moser
38b9f055d7 cloudstack: cs_staticnat: fix VPC support (#22626)
- Fix the VPC support by adding network to create and update methods
- Fix pep8
2017-03-15 01:59:20 +01:00