Commit graph

18811 commits

Author SHA1 Message Date
Peter Sprygada
db6a72ebf9 fixes eos connection checks and checks configured connection (#32828)
This change will check the configured connection first and then check
the local provider values.
2017-11-13 14:28:55 -05:00
Peter Sprygada
b9bdb05459 fixes asa action plugin for connection=local (#32827)
* fixes asa action plugin for connection=local

This change fixes asa modules when using connection=local to load the
provider values.

* fix up pep8 issues
2017-11-13 14:24:13 -05:00
Brian Coca
b70e48a54d fixed issues with lookup url docs 2017-11-13 13:43:19 -05:00
Matt Martz
99d4f5bab4 Remove uses of assert in production code (#32079)
* Remove uses of assert in production code

* Fix assertion

* Add code smell test for assertions, currently limited to lib/ansible

* Fix assertion

* Add docs for no-assert

* Remove new assert from enos

* Fix assert in module_utils.connection
2017-11-13 11:51:18 -05:00
Kellin
464ded80f5 Add link dest to synchronize module (#32746)
* Clean up after two recent synchronize tests

- add clean up after the last two tests in synchronize to make them
  match with the expectations in the previous tests

Signed-off-by: Robert Marshall <rmarshall@redhat.com>

* Add link-dest functionality to synchronize module

- add the link-dest option to the synchronize module code
- add tests for the link-dest option
- add documentation of the link_dest option to synchronize
- modify changed flag so it can properly work around rsync
  upstream not flagging hardlinks as a change properly in
  formatted output

Signed-off-by: Robert Marshall <rmarshall@redhat.com>

* Minor change to test
2017-11-13 11:13:25 -05:00
Trishna Guha
f49555d494
nxos_bgp_neighbor_af feature idea disable-peer-as-check (#32665)
* nxos_bgp_neighbor_af feature idea disable-peer-as-check

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-13 14:48:31 +00:00
Trishna Guha
e4052c1261
Add mtu option nxos_interface feature idea (#32680)
* Add mtu option nxos_interface feature idea

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add unit test for mtu feature

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-13 14:48:04 +00:00
Trishna Guha
b0e7c71716
nxos_interface TypeError fix (#32114)
* nxos_inteface TypeError fix

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Make sure that run_commands does not list of strings for json output

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* return default value to handle exception

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-13 10:47:20 +00:00
Mike Wiebe
de8d00b401 Fix snmp bugs on Nexus 3500 platform (#32773)
* Add n35 platform support

* Fix regex bug and add snmp_location it tests

* Enable nxos_snmp_location tests
2017-11-13 08:03:06 +00:00
Toshio Kuratomi
d97080174e Some cleanups to nxos module_utils (#32804)
* When splitting, use rsplit and 1 just in case the string has more pipe
  characters than anticipated
* When converting to text, make decoding errors an error instead of
  silently corrupting data
* When converting to text for message strings, use the default error
  handler as that is already surrogate_then_replace
2017-11-13 05:07:35 +00:00
Peter Sprygada
c9e6da338c
update sros local action plugin to support network_cli (#32830)
* update sros local action plugin to support network_cli

This updates the sros local action plugin to only start the connection
if connection=local is specified.  This is to support network_cli
connection plugin

* fix up pep8 issues
2017-11-12 19:57:04 -05:00
Trentr9
5625720c64 Fix typo in documentation (#32821) 2017-11-12 09:37:22 +01:00
Abhijeet Kasurde
1a0fbd424e Remove hypen from vmware powerstate (#32295)
This fix removes hypen while comparing to current
virtual machine's powerstate.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-11 22:09:28 -05:00
Toshio Kuratomi
e8c599b0f7 Avoid re.split as it's a bit less efficient and a bit harder to read. 2017-11-10 17:27:05 -08:00
joaocpinto
57990f5c0e Correct typo on required keyword (#32790) 2017-11-10 16:21:08 -05:00
Giuseppe Scrivano
69f13bbb6c atomic_container: drop duplicate 'latest' choice (#32794)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2017-11-10 16:21:00 -05:00
Adrian Likins
9c58827410
Better handling of malformed vault data envelope (#32515)
* Better handling of malformed vault data envelope

If an embedded vaulted variable ('!vault' in yaml)
had an invalid format, it would eventually cause
an error for seemingly unrelated reasons.
"Invalid" meaning not valid hexlify (extra chars,
non-hex chars, etc).

For ex, if a host_vars file had invalid vault format
variables, on py2, it would cause an error like:

  'ansible.vars.hostvars.HostVars object' has no
  attribute u'broken.example.com'

Depending on where the invalid vault is, it could
also cause "VARIABLE IS NOT DEFINED!". The behavior
can also change if ansible-playbook is py2 or py3.

Root cause is errors from binascii.unhexlify() not
being handled consistently.

Fix is to add a AnsibleVaultFormatError exception and
raise it on any unhexlify() errors and to handle it
properly elsewhere.

Add a _unhexlify() that try/excepts around a binascii.unhexlify()
and raises an AnsibleVaultFormatError on invalid vault data.
This is so the same exception type is always raised for this
case. Previous it was different between py2 and py3.

binascii.unhexlify() raises a binascii.Error if the hexlified
blobs in a vault data blob are invalid.

On py2, binascii.Error is a subclass of Exception.
On py3, binascii.Error is a subclass of TypeError

When decrypting content of vault encrypted variables,
if a binascii.Error is raised it propagates up to
playbook.base.Base.post_validate(). post_validate()
handles exceptions for TypeErrors but not for
base Exception subclasses (like py2 binascii.Error).

* Add a display.warning on vault format errors
* Unit tests for _unhexlify, parse_vaulttext*
* Add intg test cases for invalid vault formats

Fixes #28038
2017-11-10 14:24:56 -05:00
Brian Coca
e7941b0d4e
avoid chroot paths (#32778)
* avoid chroot paths

fixes #32764

* check name
2017-11-10 13:26:49 -05:00
Jose A. Rivera
7a82c49a5f Fix documentation for mount state (#32647)
* Fix documentation for mount state

Fixes https://github.com/ansible/ansible/issues/18948

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>

* Remove redundant line
2017-11-10 12:31:40 -05:00
Sloane Hertel
33a704cc61 Add documentation for the aws_ssm lookup plugin. (#32763) 2017-11-10 12:15:19 -05:00
Martin Krizek
4c58ad1266 pacman: fix closing parenthesis (#32783) 2017-11-10 09:52:40 -05:00
Dario Zanzico
8a21fa2c07 remove cpuHotAddEnabled, memoryHotAddEnabled defaults from configSpec (#25202)
* add hardware.hotadd_cpu, hardware.hotadd_memory parameters
* use hotadd_{cpu,memory} paramters on create integration tests
2017-11-10 13:09:30 +00:00
Tim Rightnour
4756b392ea Apply fix to allow the root resource pool of a cluster to be chosen (#31641)
Whitespace cleanup
2017-11-10 13:51:36 +01:00
Andreas Nafpliotis
639bac11d4 vmware cfg backup module (#21070)
* vmware cfg backup module
* used ansible's urllib
* pep8 changes
* pep8 changes
* added ansible metadata
* user can define also the backup filename
* fixed required_if values
* Changes for vmware_cfg_backup as per recommendation
* small changes (pep, specific imports etc)
* added import from future
2017-11-10 06:07:30 +00:00
Jordan Borean
bac759e282 fixed up typo in azure_rm_virtualmachine docs 2017-11-10 14:57:12 +10:00
Trishna Guha
9eb5921c1c
fix AttributeError eos_static_route (#32779)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-10 04:48:05 +00:00
Matt Davis
5ff36c3423 Enable autoloading of inventory plugins (#32709)
* Automatically loads and executes an inventory plugin specified by a standard YAML inventory config file containing a `plugin` key at its root.
* Moved inventory PluginLoader to a shared global instance.
2017-11-09 19:38:34 -05:00
Jordan Borean
abc4210a33 azure_rm_virtualmachine: add custom image support (#32367)
* azure_rm_virtualmachine: added support for specifying custom image

* Use separate parameter for custom_image, add very basic test

* missed the version_added tag for doco

* removed whitespace I accidentally left in

* merged custom image into the image dict and added more tests

* added one more test
2017-11-09 18:48:14 -05:00
Brian Coca
85f727ad4b clean args only if needed 2017-11-09 17:21:26 -05:00
Brian Coca
59d5481abb
fixes to events/callbacks (#32633)
* fixes to events/callbacks

  - made note of 'not called' methods for future fixes
  - removed uncalled v2_runner_on_file_diff because dupe of v2_on_file_diff, which is called
  - removed v2_runner_on_no_hosts due to existing pb level ones, which are called
  - removed v2_on_setup, it is just a task, triggers normal task events
  - v2_on_notify is now called when a handler is notified
  - TODO: async, cleanup? and import events
    these currently occur in code that has no access to sending events

* corrected display
2017-11-09 17:12:37 -05:00
Brian Coca
0e74731d73 Added callback that removes callback noise
for those that only want logging but no events to screen
2017-11-09 17:12:13 -05:00
u625030
6d597ac05a Update win_copy for #32677 (#32682)
* Update win_copy for #32677

enable large zip file support in win_copy

* Update win_copy.py
2017-11-10 06:34:29 +10:00
Nathaniel Case
9c0275a879
Connection plugins network_cli and netconf (#32521)
* implements jsonrpc message passing for ansible-connection

* implements more generic mechanism for persistent connections
* starts persistent connection in task_executor if enabled and supported
* supports using network_cli as top level connection plugin
* enhances logging for persistent connection to stdout

* Update action plugins

* Fix Python3 RPC

* Fix Junos bytes<-->str issues

* supports using netconf as top level connection plugin

* Error message when running netconf on an unsupported platform
* Update tests

* Fix `authorize: yes` for `connection: local`

* Handle potentially JSON data in terminal

* Add clarifying detail if possible on ConnectionError
2017-11-09 15:04:40 -05:00
Tobias Wolf
bed78872f9 Synchronize: Document the private_key option (#32754)
`synchronize` has supported the `private_key` option for a long time,
apparently. But for some reason it was never documented.

Today I managed to workaround the synchronize quoting bug by just using

```
private_key: /path/to/id_rsa
```

instead of

```
rsync_opts:
  - "--rsh 'ssh -i /path/to/id_rsa'"
```

So, I'll just go ahead and document this useful option ...
2017-11-09 12:49:49 -05:00
Ganesh Nalawade
37b0537279
Fix ios_config file prompt issue (#32744)
Fixes #23263

Add a carriage return (\r) at end on copy config
command which results in prompt on cli terminal
2017-11-09 22:43:49 +05:30
Abhijeet Kasurde
dbadb5a014 Add details about snapshot in result (#32730)
This fix adds details about snapshots in result of
vmware_guest_snapshot, when operation is successful.

Fixes: #32154

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-09 11:42:30 -05:00
Jiri Tyr
1a3037ff63 Making options of type list (fixing #32704) (#32706) 2017-11-09 10:57:27 -05:00
Brian Coca
ee80215fa9
Combine lists of dicts (#32686)
* allow combine to take lists of dicts

* updated as per feedback
2017-11-09 10:02:38 -05:00
Brian Coca
9c629f8a1c updated chlog, moved missed comment 2017-11-09 09:59:43 -05:00
Mike Wiebe
fedd1779cc Add ISSU capability and fix workflow bug for nxos_install_os module (#32540)
* Initial issu support

* Enhance ISSU support

* Additional refactoring to simplify code flow

* Remove debugs and bug fixes

* Update doc example output

* Update provider line in task example

* Remove unneeded else clause and comments

* Fix ansible-doc errors

* Satisfy ansibot requirements

* Update header docs

* Update nxos_install_os.py
2017-11-09 14:54:19 +00:00
Brian Coca
db749de5b8 namespace facts
updated action plugins to use new guranteed facts
updated tests to new data clean
added cases for ansible_local and some docstrings
2017-11-09 09:48:14 -05:00
cnasten
f1fe467c22 nso_config module for setting configuration in Cisco NSO (#30973) 2017-11-09 13:34:41 +00:00
Martin Krizek
356901b72d yum: case for multilib when installing from a file (#32236) 2017-11-09 06:04:53 -05:00
Martin Krizek
38444bb76c yum: the rpm command requires newline in --qf (#32244) 2017-11-09 05:41:47 -05:00
Martin Krizek
714598e91b
acl: do not remove all default entries (#32615) 2017-11-09 10:31:33 +01:00
Ganesh Nalawade
1b26cce57e
Fix platform agnostic failure for eos modules (#32712)
Platform agnostic action plugin (net_base) calls
`get_provider_argspec()` to fetch the provider specific
details for each platform. This fix adds the function in
eos module_utils and retuns a dict of provider spec.
2017-11-09 11:33:57 +05:30
Brian Coca
437babbd07 get path from play if task does not have
fixes #28451
2017-11-09 00:50:58 -05:00
Prasad Katti
306c3508b2 Deprecate ec2_ami_find (#32501) 2017-11-09 11:38:05 +10:00
Dag Wieers
59c30595c1
stacki_host: PEP8 compliancy and documentation changes (#32651)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
2017-11-08 23:16:49 +01:00
Toshio Kuratomi
facbf7f14d
Remove the params option from jenkns_plugin and yum_repository (#32708)
* Remove the params option from jenkns_plugin and yum_repository

It was decided that these options which override Ansible module options
from a generic, unchecked dict are an antipattern for Ansible Modules
and must be removed:

https://meetbot.fedoraproject.org/ansible-meeting/2017-09-28/ansible_dev_meeting.2017-09-28-15.00.log.html

Fixes #30874
2017-11-08 13:59:59 -08:00