Commit graph

15676 commits

Author SHA1 Message Date
Senthil Kumar Ganesan
a0344acd78 Ansible 2.3 feature support for dellos6. (#23084)
* Ansible 2.3 feature support for dellos6.

- With the new Ansible 2.3 infra changes, the dellos modules doesn't work
  (the new infra changes are not backward compatible), so added the below
  changes support it.
- Added the new terminal plugin for DellOS6
- Added the new action plugin for DellOS6
- Modified the modules to work with the new infra.
- with that it adds support for DellOS6 Persistent Connection support.

* Remove pep8 confirming files from dellos6.py and dellos6_config legacy-files
2017-03-30 15:26:32 +02:00
Sloane Hertel
44b2859338 ec2: fix instids and res_list being referenced before assigned - fixes #22692 (#23053)
* add else statement to ensure instids is set

set res_list to None to avoid UnboundLocalError and fix iteration over a nonetype by adding an empty tuple

* make res_list empty tuple by default and check for instids before setting tags (fails otherwise)
2017-03-29 20:18:23 -04:00
Konstantin Suvorov
c1b3d6a51f Fix 'sequence' lookup shortcut syntax and documentation (#22989)
* fix 'sequence' lookup shortcut syntax and documentation

* Update playbooks_loops.rst

Minor edits for grammar and clarity.

* Update playbooks_loops.rst

Another tweak for clarity.
2017-03-29 19:11:19 -04:00
Ricardo Carrillo Cruz
1abc73da68 Fix ios_config return on python 2.4 (#23094) 2017-03-30 00:19:43 +02:00
Chris Houseknecht
4099eb41b9 Treats both [] and {} as equal to None (#23088) 2017-03-29 22:48:21 +02:00
Ricardo Carrillo Cruz
66e29f0a7c Do not re.search show configuration stdout if empty (#23087)
If the banner is not set, the stdout of 'show configuration | begin banner <banner>'
returns empty string thus the re.search raises an exception.

Fixes #22216
2017-03-29 22:38:15 +02:00
Peter Sprygada
88ce6fd273 restores pre 2.3 behavior with respects to keys (#23083)
This removes the requirement to configure look_for_keys=False and
restores the behavior to disable key lookup if no key was provided.
2017-03-29 15:12:18 -04:00
Toshio Kuratomi
6f77498700 Split on newlines when searching for become prompt
The fix for leading junk in sudo output: fee6e29 causes problems with
ssh + sudo.  On the initial connection using ControlPersist, the output
that we scan for the prompt contains both the command we're sending to
configure the prompt and the prompt itself.  The code in fee6e29 ends up
sending the password when it sees the line configuring the prompt which
is too early.

Switch to a version that splits on lines and then checks whether the
first or last line starts with the prompt to decide if it's time to send
the password.

Fixes #23054
References #20858
2017-03-29 12:11:10 -07:00
jhawkesworth
4eba248a8e changed parameter name from forest_root_dns_domain to dns_domain_name (to match documentation and other win_domain* modules) and fix example which has win_domain_controller instead of win_domain for module name. (#23081) 2017-03-29 11:34:45 -07:00
jhawkesworth
a3e2280e62 correct examples to match correct _password module parameter names (#23067) 2017-03-29 11:32:33 -07:00
Artem Zinenko
a5da638d34 Fix #22126 (#22128) 2017-03-29 11:29:27 -07:00
Pavel Glushchak
097173c6f5 Added Virtuozzo distribution support
Virtuozzo Linux is based on CentOS sources. Thus OS family
should be recognized as 'RedHat'.

Signed-off-by: Pavel Glushchak <pglushchak@virtuozzo.com>
2017-03-29 08:47:05 -07:00
Fabrizio Colonna
3765dc37ca Fixed issue #22996 and issue #22955.
(cherry picked from commit 4465171e89)
2017-03-29 08:30:30 -07:00
Victor Perron
bc44175d8d paramiko_ssh: fix crash upon pass prompt in py3
The pass prompt expects an answer and compares a `str` to a binary buffer, thus crashing.

It's an obvious fix to help transitioning towards Python3 and hopes it does not need a specific test.
2017-03-29 07:47:16 -07:00
Jeremy L. Gaddis
b52dbddc17 Update requirements for seboolean module (fixes #23028) 2017-03-29 07:24:30 -07:00
Ricardo Carrillo Cruz
cc7e09451a Fall-back to show configuration on old IOSXR devices (#22900)
In old IOSXR versions, 'show commit changes diff' does not work.
Fall-back to 'show configuration' if that command fails so execution
can move forward.

Fixes #22235
2017-03-29 16:21:23 +02:00
Dag Wieers
521fa9b458 win_chocolatey: Fix state=latest when absent (#23041)
When using state=latest with the package not being installled, Ansible complains that the package is not installed and fails the task.
Whereas the expected behaviour is to install the package when it is missing.

This PR fixes this behaviour.
2017-03-28 17:49:21 -07:00
Matt Clay
0ed86775f0 Fix PEP 8 issues. 2017-03-28 15:09:44 -07:00
Dr Josef Karthauser
0752906ae5 Add --jail support to pkgng. (#22958)
* Add --jail support to pkgng.

* Bump the version number for the --jail argument.
2017-03-28 17:38:47 -04:00
Brian Coca
37cef2a9eb standarized role/plugin paths 2017-03-28 17:31:24 -04:00
Sloane Hertel
7720ef8ec1 [cloud][python3] bytes fix to make ec2_key work on python 3 (#23051) 2017-03-28 17:00:26 -04:00
Brian Coca
ea7bff4a3f changed spec to options as per irc meeting 2017-03-28 15:55:22 -04:00
Toshio Kuratomi
d3a1aea7c5 Fix a couple issues in synchronize with docker (#23047)
* Fix a couple issues in synchronize with docker

* Make the rsync_opts parse as a list using the same criteria as
  module_utils argumentspec parsing
* Do not quote arguments in the action plugin.  The module will quote as
  it knows whether it will invoke rsync with a shell or via exec.

Fixes #23046
2017-03-28 11:38:37 -07:00
Peter Sprygada
768cb437ab minor updates to network connection plugins (#23043)
* removes unused log() function in network_cli
* adds method comments to terminal plugin base
2017-03-28 12:57:18 -04:00
Brian Coca
c0db6d79f6 minor correction to module path option docs 2017-03-28 11:43:58 -04:00
Brian Coca
99e298a2a6 removed bad ignore as host can override connection
also breaks testing network modules
2017-03-28 11:32:22 -04:00
Evgeni Golov
61579aebb2 cron: don't force changed=True when old crontab was empty
The cron module forces changed=True when there was no real change,
but the original crontab did not contain a final newline, which is
mandatory.

When the user has no crontab or the user does not exist at all,
crontab -l exits with 1 and the cron module correctly interprets
this as "no crontab" and stores the old crontab as "".

However this triggers changed=True, even if we're not going to
change anything, e.g. when removing a crontab entry from a user
who has no crontabs at all.

Let's special-case the fact that the old crontab is empty and not
force changed=True in that case.
2017-03-28 07:45:13 -07:00
Ricardo Carrillo Cruz
6fa3cb55e1 Fix dynamodb pep8 issues (#23032) 2017-03-28 15:11:39 +02:00
Miyurz
1ea1becf23 Fixes bug https://github.com/ansible/ansible/issues/22455 - Git reset… (#22502)
* Fixes bug https://github.com/ansible/ansible/issues/22455 - Git reset fails when file with the name 'origin' is present in the repository

* #22455 Integration test for git module to test if it clones a repository with a file named origin

* Fixed yaml errors for test/integration/roles/test_git_clone/tasks/main.yml

* Removed the newly added target git and moved the code to test/integration/targets/git

* Reorganised code structure as per comments

* Fixed playbook name

* Added code that didn't make it to the playbook before.

* No longer need git.yml

* Remove non tasks specific code from tasks file and use existing variables

* Removed msg var from the vars.yml
2017-03-28 08:41:25 -04:00
nevotheless
ab8578d343 Update netapp_e_amg_sync.py (#22693) 2017-03-28 07:19:05 -04:00
Corey Christous
34a3ab94d8 add tagging to dynamodb_table.py (#20946)
* add tagging to dynamodb_table.py

* fix doc syntax

* address PR comments

* add boto3 has tagging check
2017-03-28 07:18:20 -04:00
Ricardo Carrillo Cruz
a5b12ff269 Introspect flag to use on 'show run' when using defaults in ios_config (#22903)
When the ios_config module has 'defaults' param it runs in the device the command
'show running-config all' but 'all' may not be available in older devices.
This change makes introspection by using the help command and run 'full' in case
'all' is not available.

Fixes #22747
2017-03-28 10:20:52 +02:00
Chris Houseknecht
d2ea851d09 Adds k8s_common.py (#22899) 2017-03-28 02:27:28 +02:00
Mike Hume
a4ae329465 Update __init__.py
Just guessin, but is this how it is supposed to read?
2017-03-27 20:21:40 -04:00
Hugo Chargois
1bc5527c69 Vault: Remove tmp decrypted file when experiencing error while writing (#14835)
* Vault edit: Erase tmp file if error while writing to it

* Close the FDs returned by mkstemp()
2017-03-27 16:52:18 -04:00
Jon "The Nice Guy" Spriggs
8e0c11ebc4 Add examples in os_server module showing userdata (#22997)
* Add examples in os_server module showing userdata

Added an example using Bash and also using Cloud-init. Also, showing using {% raw %} and {% endraw %} to provide a pointer to those hitting similar issues to the ones I had.

* Removed erronious whitespace
2017-03-27 14:44:13 -05:00
Nick Ball
c8364d64d6 [cloud] New module: AWS lightsail (#19846)
* Add AWS lightsail module

* lightsail: fix doc error + badly formatted yaml

* lightsail: code style cleanup

* make requested lightsail changes

* fix imports and pep8

* fix metadata and version

fix yaml

fix RETURN section
2017-03-27 15:10:52 -04:00
Senthil Kumar Ganesan
dd63dfcf1e Ansible 2.3 feature support for dellos9 and dellos10 (#22856)
* Ansible 2.3 feature support for dellos9 and dellos10
* Use Persistent Connection Manager

* Fix CI issue, revert the doc and metadata changes

* Reverted the meta_info (supported_by) to community from core

* Fixed the CI issues, use module_utisl.six and updated legacy-files
2017-03-27 19:32:57 +01:00
John R Barker
f9b75d44e8 pep8 fixes (#23005) 2017-03-27 18:36:20 +01:00
John R Barker
58441869bd metadata_version, not version 2017-03-27 18:25:36 +01:00
Will Thames
7142e28423 [cloud] Default encrypted parameter on ec2_ami_copy to False (#22634)
Set encrypted to default False, rather than None

Otherwise you get:

```
Invalid type for parameter Encrypted, value: None, type: <type 'NoneType'>, valid types: <type 'bool'>)
```
2017-03-27 12:44:59 -04:00
Davis Phillips
36e24c53c6 Vmware resource pool first add (#21116)
* Adding first checkin of resource_pool module
* fixing length issues and indentation multipliers
* mend
* mend
* mend
* remove * import from modules
* Add space on variable assignments
* changing line 321 to less characters
* fixing pep8 issues
* mend
* cleaning up example section
* Add RETURN section
* adding spacing to list
* all spacing consistent now
* move imports as per CI
2017-03-27 10:35:58 -04:00
Peter Sprygada
ab4b8cb104 removes unused code in eos action plugin (#22986) 2017-03-27 00:50:55 -04:00
Alex Lo
ac74520b6f ec2_group: description property is immutable (#19790)
* update integration tests for updated boto exception message

* integration tests fail on both "test credential" test cases

exception bubbles out of module.  instead catch and wrap

* ec2_group does not support updating a security group's description

AWS security group descriptions are immutable.
if ec2_group finds a group that matches by name, but the descriptions do not match, the module does not support this case
previously it would check if the group was used, but would not do anything if it was

old behavior was erroneous because it could make a user expect that the description change of a group was fine when in fact it did not occur
also, it made an expensive check against all ec2 instances for no good reason

* comments not doc strings

* else must have pass w/o doc-string statement

* Catch specific BotoServerException, give context around error when fetching SGs

* python3 compatible exception blocks

* add traceback to fail_json

* two blank lines before first function
2017-03-26 09:33:29 -04:00
Peter Sprygada
3169cbd493 roll up of fixes for sros modules (#22972)
* fixes action handlers for sros
* fixes sros_config module execution to use AnsibleModule
* fixes sros_command module to use socket connection
* adds sros to constants
2017-03-25 10:35:15 -04:00
Peter Sprygada
33624fe96f fixes junos_package module to use junos_pyez (#22973)
This allows junos_package to use junos_pyez directly instead of the
persistent connection.  This is a workaround fix for 2.3
2017-03-25 10:22:01 -04:00
Gabriele
9b2bdf2df6 Fixing module behavior when route_target_both is used (#20076) 2017-03-25 08:02:15 -04:00
Peter Sprygada
6a414371a1 fixes issue where nxos module will fail due to KeyError (#22966)
Updates nxos action handler to handle deleting provider key if exists or
silently continuing if a  KeyError is raised.
2017-03-25 07:45:08 -04:00
Peter Sprygada
e93cdecef1 fixes log message in junos action handler (#22965) 2017-03-25 00:38:05 -04:00
Toshio Kuratomi
9c9ef0d6ab Fix a few problems with the metadata extraction for docs (#22963)
* key is ANSIBLE_METADATA, not METADATA
* Need to check that the node is an ast.Dict, not a real dict.
* Need to convert the ast.Dict into a real dict via literal_eval.
2017-03-24 21:18:48 -07:00
ukaj
db328a0f83 [cloud] Add support for running s3 module in check mode (#22188) 2017-03-24 16:05:19 -04:00
Brian Coca
9a05113daf pass params to validate against 2017-03-24 15:53:15 -04:00
Brian Coca
25de905c6e subspec protptype 2017-03-24 15:53:15 -04:00
scottb
ed413f2b28 Update vault.py
Edit for conciseness and clarity.
2017-03-24 15:52:36 -04:00
Brian Coca
2a2e02aea4 .--. . .--. ---.. / .. ... / .- -. -. --- -.-- .. -. --. 2017-03-24 15:52:36 -04:00
Brian Coca
18a7a1ec31 added docs to CLI docstringsadded
removed 'now intermediate build files' from repo
adjusted gitignore
2017-03-24 15:52:36 -04:00
Brian Coca
b4c47ebf68 draft to generate man pages 2017-03-24 15:52:36 -04:00
Brian Coca
7b197d823e let user control "auto-de-vault" (#22739)
* added option to toggle off autodevaulting

* fixes per feedbazck
2017-03-24 15:39:25 -04:00
Toshio Kuratomi
29f623571e Handle the case where HTTPError.info() returns an object that aren't (#22894)
dict-like enough (can't be used with **).

This should give a better error message for #22872
2017-03-24 12:24:59 -07:00
Erwin Lang
f7c9f44aab synchronize: Convert cmd to list and fix handling of the copy_links argument (#22573)
* synchronize: Convert cmd to list and fix handling of the copy_links argument

Converting cmd from str to list stops the pain of argument quoting/escaping.

* synchronize: Update imports according to #pullrequestreview-28758614
2017-03-24 09:22:45 -07:00
Toshio Kuratomi
65d9feea4f Revert "Quote ssh_args"
This reverts commit a9c3a452f0.
2017-03-24 09:18:35 -07:00
Toshio Kuratomi
a9c3a452f0 Quote ssh_args
Fixes #22111
2017-03-24 09:17:34 -07:00
Alexander Gordeev
4b9b0a25c3 Add pvs info to linux hardware 'ansible_lvm' facts (#16773)
This change adds the information about physical volume to hardware
facts.
2017-03-24 12:13:33 -04:00
Miroslav Lichvar
c1a766df98 Add PHC and timestamping info to network interface facts on Linux (#21767) 2017-03-24 12:09:33 -04:00
Adrian Likins
25be6aebc3 Add HDD serial numbers. (rebase/fixes of #9454) (#22852)
Add HDD serial numbers to linux hardware facts via 'sg_inq' tool
2017-03-24 12:06:42 -04:00
Matt Davis
e084e8809e force Windows to always use preamble-free UTF8 input encoding (#22934)
* fixes #15770
* When running under the UTF-8 codepage, Powershell subprocesses will fail (eg, Start-Job, others) if the input encoding is using the default BOM preamble. This fix forces it to use no preamble in leaf_exec and win_shell, and includes tests to verify that Start-Job works.
2017-03-24 00:02:39 -07:00
Dhivyap
cd662efd2b Fixes#21557-Handled dellos9_facts crash with IPV6 configs (#21652) 2017-03-23 23:06:26 -04:00
Dag Wieers
1cfaa5caab win_command/win_shell: Clean up and make coherent (#21371)
* win_command/win_shell: Clean up and make coherent

Changes include:
- Make win_command and win_shell more coherent
- Make condensed one-line more readable

* Revert to original formatting
2017-03-23 20:05:22 -07:00
Artem Zinenko
f4b34a4c3b win_firewall_rule doesn't fail when profile is "any" or remoteip is IPv4 and the task runs more than once. (#22555)
* Fixed #22554

* Wrote tests for win_firewall_rule module

* Fixed #22786

* Fixed review comments

* Fixed #22799

* Added test when RemoteIP containt a netmask

* Revert comment
2017-03-23 20:01:26 -07:00
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