Commit graph

18928 commits

Author SHA1 Message Date
Abhijeet Kasurde
a40ce1ba5e
Handle virtual machine config element gracefully (#32924)
This fix uses '_get_vm_prop' API to handle virtual machine related
properties rather than failing with AttributeError.
Handled invalid request type while connecting to ESXi server, which
is caused by malformed request.

Fixes: #32477

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-17 06:02:30 +00:00
Abhijeet Kasurde
90e9969fb5
VMware: handle error for MarkAsTemplate API (#32968)
This fix adds exception handling for 'MarkAsTemplate' API
in vmware_guest module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-17 01:09:52 +00:00
Daniel Shepherd
cfbe9c8aee [cloud] Add IPv6 support for ec2_vpc_subnet module(#30444)
* Add integration test suite for ec2_vpc_subnet

* wrap boto3 connection in try/except

update module documentation and add RETURN docs

add IPv6 support to VPC subnet module

rename ipv6cidr to ipv6_cidr, use required_if for parameter testing, update some failure messages to be more descriptive

DryRun mode was removed from this function a while ago but exception handling was still checking for it, removed

add wait and timeout for subnet creation process

fixup the ipv6 cidr disassociation logic a bit per review

update RETURN values per review

added module parameter check

removed DryRun parameter from boto3 call since it would always be false here

fix subnet wait loop

add a purge_tags parameter, fix the ensure_tags function, update to use compare_aws_tags func

fix tags type error per review

remove **kwargs use in create_subnet function per review

* rebased on #31870, fixed merge conflicts, and updated error messages

* fixes to pass tests

* add test for failure on invalid ipv6 block and update tags test for purge_tags=true function

* fix pylint issue

* fix exception handling error when run with python3

* add ipv6 tests and fix module code

* Add permissions to hacking/aws_config/testing_policies/ec2-policy.json for adding IPv6 cidr blocks to VPC and subnets

* fix type in tests and update assert conditional to check entire returned value

* add AWS_SESSION_TOKEN into environment for aws cli commands to work in CI

* remove key and value options from call to boto3_tag_list_to_ansible_dict

* remove wait loop and use boto3 EC2 waiter

* remove unused register: result vars

* revert az argument default value to original setting default=None
2017-11-16 14:58:12 -05:00
Brian Coca
23b1dbacaf
Config continued (#31024)
* included inventory and callback in new config

allow inventory to be configurable
updated connection options settings
also updated winrm to work with new configs
removed now obsolete set_host_overrides
added notes for future bcoca, current one is just punting, it's future's problem
updated docs per feedback
added remove group/host methods to inv data
moved fact cache from data to constructed
cleaner/better options
fix when vars are added
extended ignore list to config dicts
updated paramiko connection docs
removed options from base that paramiko already handles
left the look option as it is used by other plugin types
resolve delegation
updated cache doc options
fixed test_script
better fragment merge for options
fixed proxy command
restore ini for proxy
normalized options
moved pipelining to class
updates for host_key_checking
restructured mixins

* fix typo
2017-11-16 13:49:57 -05:00
Will Thames
46c4f6311a [cloud] Add retries/backoff to ec2_vpc_subnet module (#31870)
* Allow backoff for describe_subnets

Improve exception handling to latest standards

* Add integration test suite for ec2_vpc_subnet

* Add test for creating subnet without AZ

Fix bug identified by test

Fixes #31905
2017-11-16 13:09:42 -05:00
Nathaniel Case
4f38c1fea0
Fix another bytes issue (#32951)
If results are bytestrings, they need to be cast to text before hitting
json.loads()
2017-11-16 13:05:24 -05:00
Nathaniel Case
c1c0ad5d69
Fix eos call to prompt() (#32985)
* Remove the check entirely

The response tells you to authorize anyway
2017-11-16 12:48:53 -05:00
Mark Chappell
212d96f779 Add a little more explanation to ovirt_vms cloud_init parameter (#32977) 2017-11-16 12:40:57 -05:00
Will Thames
7556ac91e5 [cloud] Allow ec2_lc module to use volume_type for block devices (#32421)
* Allow ec2_lc module to use volume_type for block devices

Makes ec2_lc consistent with ec2, ec2_ami, ec2_vol etc.

* Add deprecation message for device_type
2017-11-16 10:28:41 -05:00
Will Thames
921cc6d650 [cloud] New module elasticache_facts (#30492)
New module for obtaining facts from elasticache clusters

Fixes #30373

* Removed unnecessary boto3 and exception checking

* AnsibleAWSModule checks for lack of boto3
* boto3_conn handles error checking of AWS connection
2017-11-16 10:20:56 -05:00
Will Thames
60b29cf57d [cloud] Follow up on FIXMEs in ec2_ami & ec2_ami tests (#32337)
* Several tests were marked as FIXME and should have been fixed with
the boto3 move.

* Improved tags output. Add purge_tags option (default: no)

* Allow description and tags update

* Return launch_permissions

* Allow empty launch permissions for image creation

* Empty launch permissions should work the same way for image
creation as no launch permissions

* Cope with ephemeral devices in AMI block device mapping

* Ephemeral devices can appear in AMI block devices, and this information should be returned

* Fix notation for creating sets from comprehensions
2017-11-16 10:14:20 -05:00
Jardar Marshall Bond
1eae3b6b59 Fix example with proceccModel in win_iis_webapppool (#32971)
The attribute processModel.userName have to be written i camelCase. Otherwise this fails silently.
2017-11-16 15:31:10 +01:00
Jim Gu
f6b188e521 Fail module if unknown state passed to set_vm_power_state (#32631) 2017-11-16 08:44:27 +00:00
Abhijeet Kasurde
e61bcc3438
Provide clear error message after failure (#32928) 2017-11-16 06:42:27 +00:00
Abhijeet Kasurde
2d4c4e09db
Add vmware fact about 'Cores Per Socket' (#32881)
This fix adds new fact - 'Cores Per Socket' about vmware guest machine.
Also, adds integration test for this change.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-16 06:22:32 +00:00
Mike Wiebe
208208ab8f Fix nxos_snmp_host bug (#32916)
* Fix nxos_snmp_host bug

* Enable nxos_snmp_host tests
2017-11-16 06:17:42 +00:00
Tim Rupp
3f3c526026
Removes deprecated "append" param from snat pool (#32953)
This param was deprecated in 2.4 and slated for removal in 2.5. This
patch removes it.
2017-11-15 19:35:09 -08:00
Abhijeet Kasurde
aeb896375d
New module for managing IPA Sub CA (#25640)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-16 02:21:59 +00:00
Toshio Kuratomi
ae148d1a21 Make everything in default callback use display (#32811)
Noticed that there was just one old and one new place in the default
callback that did not use Display.display() to show data.  Changed those
two places so that everything is uniform.
2017-11-16 10:53:01 +10:00
Tim Rupp
0c1f493b6c
Adds module for managing bigip device connectivity (#32950)
This module is a critical part of the HA process for BIG-IPs.
2017-11-15 16:51:51 -08:00
Jordan Borean
1bc4940ee1
added powershell symlink util helper (#27153)
* Added symbolic link util for powershell

* updated module_util license to BSD
2017-11-16 10:12:02 +10:00
Jordan Borean
e16e6313c7 windows: fix for checking locked system files (#30665)
* fix for checking locked system files

* moved functions to share module util and created tests

* fixed windows-paths test based on win_stat changes
2017-11-15 19:04:03 -05:00
Jordan Borean
5e20fd0943 removed psobject to hashtables that were missed (#32710)
* removed psobject to hashtables that were missed

* fix up win_region change
2017-11-15 14:51:16 -08:00
Jordan Borean
d21f32168f win_module_utils: updated license to BSD to follow standards (#32949) 2017-11-15 14:43:34 -08:00
Dag Wieers
3089892e59 sl_vm: PEP8 compliancy and documentation changes (#32657)
This PR includes:
- PEP8 compliancy changes
- Documentation changes
2017-11-15 15:22:32 -05:00
Patrick Ogenstad
53c5e5bf5a Fix 'save' parameter in asa_config (#32761) 2017-11-15 15:22:02 -05:00
René Moser
97b844e660
letsencrypt: fix doc version_added (#32943) 2017-11-15 20:47:13 +01:00
Ian Glover
f71816c192 Add support for generating full chain certificates from LetsEncrypt. (#22074)
* Add support for generating full chain certificates from LetsEncrypt.

* Add version_added field to document for fullchain option.

* Update version_added for fullchain option to be 2.4.

* Fix Pep-8 violation.
2017-11-15 20:31:26 +01:00
Wojciech Knapik
115f6f6732 Added helm release updates. Fixes #32545. (#32593) 2017-11-15 14:24:44 -05:00
Adrian Likins
86dc3c09ac
Fix vault --ask-vault-pass with no tty (#31493)
* Fix vault --ask-vault-pass with no tty

2.4.0 added a check for isatty() that would skip setting up interactive
vault password prompts if not running on a tty.

But... getpass.getpass() will fallback to reading from stdin if
it gets that far without a tty. Since 2.4.0 skipped the interactive
prompts / getpass.getpass() in that case, it would never get a chance
to fall back to stdin.

So if 'echo $VAULT_PASSWORD| ansible-playbook --ask-vault-pass site.yml'
was ran without a tty (ie, from a jenkins job or via the vagrant
ansible provisioner) the 2.4 behavior was different than 2.3. 2.4
would never read the password from stdin, resulting in a vault password
error like:

        ERROR! Attempting to decrypt but no vault secrets found

Fix is just to always call the interactive password prompts based
on getpass.getpass() on --ask-vault-pass or --vault-id @prompt and
let getpass sort it out.

* up test_prompt_no_tty to expect prompt with no tty

We do call the PromptSecret class if there is no tty, but
we are back to expecting it to read from stdin in that case.

* Fix logic for when to auto-prompt vault pass

If --ask-vault-pass is used, then pretty much always
prompt.

If it is not used, then prompt if there are no other
vault ids provided and 'auto_prompt==True'.

Fixes vagrant bug https://github.com/hashicorp/vagrant/issues/9033

Fixes #30993
2017-11-15 14:01:32 -05:00
Yaacov Zamir
f93b98661a Add new module manageiq_policies (#32892)
* Add new module manageiq_policies

* add return example
2017-11-15 19:33:00 +01:00
Nathaniel Case
7414405063
Back to 'prompt' for authorize prompt (#32932) 2017-11-15 12:22:14 -05:00
Pavel
c56dcb7afa module_utils: vmware.py. Incorrect chain of attributes to obtain snapshots from virtual machine (#32669)
* Update vmware.py
Incorrect chain of attributes to obtain snapshots from virtual machine. Module 'vmware_guest_facts' uses method 'gather_vm_facts' of vmware.py and always gets empty list of snapshots.
* Added test for module vmware_guest_facts. Checked VM snapshots.
* Fixed tests for vmware_guest_facts. Ignored certificate for vmware_guest_snapshot module.
2017-11-15 16:00:22 +00:00
Sloane Hertel
cabd7f078b Fix ec2_snapshot_facts traceback if a snapshot has been deleted (#32217) 2017-11-15 10:56:49 -05:00
Sloane Hertel
53ade280a3 clarify docs for --flush-cache (#32799) 2017-11-15 10:40:35 -05:00
chifu1234
e2fef7beed nxos_facts: cdp support (#31202)
* nxos_facts get CPD neighbor

* nxos_fact: cdp support

* remove blank spaces

* add ansible_net_neighbors cdp informations
2017-11-15 07:38:19 -07:00
Sebastiaan van Doesselaar
900abcddb3 Integrated publickey import and removal in iosxr_user (#32115)
* Integrated publickey import and removal in iosxr_user

* Fixed linting issues

* Added version added for publickeyfile option

* Added quotation marks to version, oops

* Added some integration tests, added some checks to prevent aggregate users with public keys.

* Added some integration test files

* Created mutually exclusive public_key and public_key_contents versions of config

* Modified tests to use both methods and test more logins

* Added supports for aggregates

* Incorporated provider auth

* Fixed some lint issues

* Fixed a YAML lint issue

* Implemented catches for unconfigured providers.

* Fixed catches, hopefully

* Another test

* Added groups support so you can add users to multiple groups

* Trailing whitespace
2017-11-15 07:34:36 -07:00
Jacob McGill
64f9ced750 ACI Module: Bug Fix for Python versions > 3.6.0 (#32660) 2017-11-15 07:20:08 -07:00
Prasad Katti
d5e247243f ec2_key - clean up examples (#32714)
* ec2_key - clean up examples

* ec2_key: remove unnecessary example
2017-11-15 22:51:46 +10:00
René Moser
9e15f82aa3
cloudstack: update copyright header (#32922) 2017-11-15 12:55:46 +01:00
Abhijeet Kasurde
43f89004a0 Refactor vmware_guest_facts (#31448)
This fix adds refactoring to vmware_guest_facts module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-15 01:56:50 -05:00
Abhijeet Kasurde
6c400d3bc8 Add new module - digital_ocean_certificate (#26632)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-11-15 01:33:01 -05:00
Ganesh Nalawade
7170c26399
Ironware module_utils cliconf plugin minor change (#32920)
As per refactor in connection framework PR 32521
pass socket_path to Connection class while initiating
cliconf connection
2017-11-15 11:49:43 +05:30
Ganesh Nalawade
52c87c4691
Fix typo in network_cli to fetch command prompt (#32899) 2017-11-15 09:06:28 +05:30
Anil Kumar Muraleedharan
e5b3f60a74 Enos connection issue (#32895)
* Changes due to connection issues

* Adding changes pertaining to connection issue of Ansible

* Review comments of Kedar

* Adding EOL PyLint issue

* Fixing pep8  and yamlint issues
2017-11-14 16:00:16 -05:00
Nathaniel Case
a1517234f6
Fix authorize: yes and become_method: enable (#32864)
* Update connection play_context when socket exists

* Don't fail on connections other than network_cli

* Fix enable prompt detection on ios & eos

* Check against "Module not found" error code, defined in modules/jsonrpc.py
2017-11-14 15:51:14 -05:00
Sorin Sbarnea
3fedd88a9f Avoid AttributeError: internal_network on os_floating_ip (#32887)
Fixes #32884

Change-Id: I3be1dc81266b32dd8f545b743365c2bbc02dfdeb
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2017-11-14 13:42:20 -05:00
Ganesh Nalawade
71fa60bc68
Fix prompt issue in asa terminal plugin (#32900) 2017-11-14 22:25:35 +05:30
Musee Ullah
7318b7c0b0 Keep newlines when reading LXC container config file (#32219) 2017-11-14 10:46:39 -06:00
Gawain
fa764f6918 New Module vmware_host_facts (#26492)
Add new module  vmware_host_facts ,it can get remote vmware host system info like setup module

* modify ansible version
* optimized output for human readable
* add serial number get_system_facts() add ansible_product_serial
* fix pep8 issue and ansible module required format
* Use find_obj method instead get_obj
* add ansible_hostname ansible_distribution_build
* add integration test
* vmware_host_facts integration test add verify
* fix yamllint issue
* fix boilerplate test
* Update vmware_host_facts.py
* fix RETURN key's name
2017-11-14 15:41:55 +00:00
Ganesh Nalawade
9cedb89644
Fix iosxr get_prompt return value failure (#32902) 2017-11-14 21:11:10 +05:30
Brian Coca
49a1472656
undeprecated with_ (#32805)
* undeprecated with_
2017-11-14 10:36:41 -05:00
Trishna Guha
3ee2501c83
multiple fixes nxos (#32903)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 15:23:11 +00:00
Anil Kumar Muraleedharan
177a4fb3ec Adding enos_command module and unit test (#32782)
* Adding git_command module and its UT file

* Changing Author Name and removing 2 blank lines

* Removing blank lines

* Adding enos_config and its UT files

* Removing config module as I am allowed to have only module per PR

* Work on Ganesh's Review comments

* John Review Comments on enos_command.py

* Review comments of John
2017-11-14 15:09:29 +00:00
Alexander Saprykin
58e255c2d9 Fix IndexError raised on galaxy-install
This patch fixes IndexError, that may be raised When trying
to install a role with `ansible-galaxy` in case of
access error to roles directory.

Issue: ansible/galaxy#149
2017-11-14 09:54:52 -05:00
Brian Coca
992f6d8bf4 unixy maint info 2017-11-14 09:39:21 -05:00
Ganesh Nalawade
8472a53bea Add prompt check in action plugin for network platform (#32787)
* Add prompt check in action plugin for network platform

In case of ignore_errors for a wrong configuration
the prompt is left in configuration mode and moved to
next task, if the next taks requires prompt to be
in operational state it results in failure.
Hence add a check to ensure right prompt at start of
each task run.

* Add prompt check in action plugin for network platform

*  In case of ignore_errors for a wrong configuration
   the prompt is left in configuration mode and moved to
   next task, if the next taks requires prompt to be
   in operational state it results in failure.
*  Hence add a check to ensure right prompt at start of
   each task run.
*  Fix CI issue

* Fix CI issues
Fix review comment
Change iosxr exit command to abort as per review comment
2017-11-14 17:37:52 +05:30
Ganesh Nalawade
414eaefcb5 Fix idempotency issue for network modules. (#32838)
After the connection refactor if response value returned from
the remote device is empty in that case an `ok` return value is send
to module side code. To avoid this do not overwrite the empty response
received from remote device in `jsonrpc` reply.
2017-11-14 11:58:33 +01:00
Trishna Guha
c40de24e9c
fix mtu check nxos_interface (#32880)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 10:40:37 +00:00
Trishna Guha
ceefeeb279
fix dci failure nxos (#32877)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 07:17:21 +00:00
Trishna Guha
a17244f896
ios_vlan DI module (#32490)
* ios_vlan DI module

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

* Integration test

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

* comment out testcases since the image is not available in dci

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

* add aggregate test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-11-14 05:50:17 +00:00
rahushen
1360ae6518 nxos_config and nxos_facts - fixes for N35 platform. (#32762)
* update nxos_facts to handle errors in n35 platform

* switch show commands to output text

* replace basestring which is not supported in python3

* do it like the other modules: use string_types

* incorporate PR review
2017-11-14 05:03:37 +00:00
Prasad Katti
e23928cb41 ec2_key: document return values (#32813) 2017-11-14 14:39:54 +10:00
dramaley
1fe608afbf Fix for database names that contain colons
Bug fix: Permissions were not parsed correctly if the database name contains a colon (:) character. For example, a privilege string of "*.*:USAGE/`lnx-www-prod:wordpress`.*:ALL" would fail with "invalid privileges string: Invalid privileges specified: frozenset(['WORDPRESS`.*'])". This 1-line fix works around the problem.
2017-11-13 20:23:57 -05:00
Sam Doran
ea3638b580 Add proper check mode support to the script module (#31852)
* Do not run script in check mode

Fixes #30676

* Reformat script integration test

* Add integration tests for check mode of script module

* Fix name on test

* Cleanup temp file

* win_script integration test syntaxt changes

* Add check mode tests for win_script

* Use proper variable in test

* Fail if source file does not exist

* Verify script is accessible and don't copy in check mode

Use shlex to properly split shell arguments, though a path with spaces in it still needs to be quoted in the playbook.
Add note to docs describing such.
Improve error message if file is not found indicating there may be a space in the path.

* Properly encode path now that path is split using shlex

* Allow for spaces in both path and script name

* Add unicode character test to Linux script tests

* Add Linux test for space in path to script
2017-11-13 15:33:44 -08:00
Pierre-Louis Bonicoli
474bf208e9 syslog_json: fix typos in documentation 2017-11-13 17:11:15 -05:00
Katerina Koukiou
414d0e92ac cloud: ovirt: ovirt_cluster.py Fix issue with non required parameter 'external_network_providers' (#32797) 2017-11-13 15:59:52 -05:00
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