Commit graph

16731 commits

Author SHA1 Message Date
Brian Coca
02311604c9 removed logger from paramiko
(cherry picked from commit 9b7dfd5945ec1ab329e288493b6962d4e8c33fa0)
2017-07-05 18:09:40 -04:00
Nathaniel Case
28c6b226c7 ansible-connection Python3 fix (#26441)
* Fix a number of unicode <-> bytes mismatches

* Return socket_path as text, not bytes

* Docstring run()
2017-07-05 14:07:26 -04:00
Matt Davis
08af853ee9 fix win_shell/win_command nonzero RC failure setting (#26443)
* as a result of recent core engine changes to ignore rc, modules are responsible to set `failed` on nonzero RC if they want that behavior
* the `failed` filter currently triggers on nonzero RC, which caused the tests to false-pass
* updated tests to explicitly check both rc and failed keys, as well as using the failed filter.
2017-07-05 10:05:07 -07:00
James Mighion
1d62283796 Making iosxr check_args call module_util/iosxr check_args. Fixes #25501 (#26261) 2017-07-05 22:20:53 +05:30
saichint
5229370364 fix for nxos_acl_interface idempotency (#26156)
* fix for nxos_acl_interface idempotency

* shippable error fix

* fix issues with python3.x
2017-07-05 12:05:47 -04:00
Dag Wieers
f2ce2d2199 imc_xml: Use the correct response in error message (#26435) 2017-07-05 16:12:21 +01:00
Abhijeet Kasurde
613327d47a Add missing keyword args in aix_inittab (#26423)
fail_json fails if msg is not provided.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-05 16:02:53 +01:00
James Cammarata
95a0fe37da UserKnownHostsFile=/dev/null when verify_host: false
This is a new fix to replace #20361 due to the synchronize module changing
sufficiently to make that commit no longer merge cleanly.

Fixes #20361
Related to #20311
2017-07-05 09:42:04 -05:00
Will Thames
f8d522de69 Support check mode for efs_facts (#26273)
Facts modules support check mode by default

Fix pep8 compliance
2017-07-05 15:06:08 +02:00
Ganesh Nalawade
e612d0be12 Add net_l2_interface platform agnostic module (#26410)
* Add net_l2_interface platform agnostic module

*  net_l2_interface module definition
*  net_l2_interface action plugin

* Fix CI issue
2017-07-05 11:15:19 +05:30
Dag Wieers
b9d018885a win_chocolatey: Ensure chocolatey to fail (#26416)
Currently chocolatey is not failing when the user requests version X,
but version X is not available in the repository.

Obviously the module should fail in this case.

This fixes #25393
2017-07-05 08:20:20 +10:00
Jordan Borean
8e9d04043a win_regedit: fix for same dword value (#26415) 2017-07-05 08:17:49 +10:00
Dag Wieers
69ade22243 win_chocolatey: Fix updating 'all' packages (#26417)
This fixes #15018
2017-07-05 08:04:30 +10:00
Ganesh Nalawade
1a9b0ae731 Remove xml return for junos declarative modules (#26400)
*  Remove xml return
*  Add diff return
*  Related doc changes
2017-07-04 21:49:26 +05:30
René Moser
c1ac55147f haproxy: docs: add version added for state=drain (#26396) 2017-07-04 16:26:18 +02:00
Rene Moser
37b22673fb cloudstack: cs_instance: fix KeyError: 'sshkeypair' 2017-07-04 15:58:21 +02:00
Jakub Jursa
5fafe4c672 openstack: os_volume: add optional scheduler_hints param (#26090)
* openstack: os_volume: add optional scheduler_hints param

* openstack: os_volume: scheduler_hints version_added fix

* openstack: os_volume: fixed codestyle
2017-07-04 11:51:07 +02:00
Trishna Guha
ad3fe08aae fix vyos_banner multiline string issue (#26383)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-04 14:31:18 +05:30
zzaa
df0864d801 haproxy: Add new drained state (#25115) 2017-07-04 10:33:32 +02:00
Toshio Kuratomi
996281d748 Remove metadata from docstring parsing as per last week's meeting decision 2017-07-04 01:12:43 -07:00
Toshio Kuratomi
3ee997b720 metadata and doc generator optimization and fixes
* Fix ansible-doc traceback when a plugin doesn't parse correctly
* Change extract_metadata ivocation to take either an ast or source
  code.  When given source code, it can find file offsets for the start
  and end of dict.  When given the ast, it is quicker as it doesn't have
  to reparse the source.  Requires changing the call to the function to
  use a keyword arg.
* Fix reading of metadata to find the last occurrence of
  ANSIBLE_METADATA instead of the first.
* Add some more unittests to get closer to complete coverage
2017-07-04 01:12:43 -07:00
Abhijeet Kasurde
785ed2cfc0 Multiple fixes in digital_ocean_tag module (#24361)
* Pep8 fixes
* Removed redundant check for name
* Check validity of api_token
* Don't report changed when tag is already present

Fixes #24265

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-04 08:04:49 +02:00
R. Soto
5c0c985547 update auth_flag variable after STARTTLS connection is established, fixes #26376 2017-07-03 23:07:47 -04:00
Matt Davis
0ee46cb0df converted become runas to explicit CreateProcessWithLogonW (#26378)
* fixes become_method: runas for unprivileged users
* sets permissions on tempdir appropriately
* allows automatic system environment generation for new token (old Process.Start way prevents this)
* add basic become runas tests
2017-07-03 17:46:27 -07:00
Brian Coca
1b727c372e igaffneypellz 2017-07-03 17:05:44 -04:00
Brian Coca
32fa4db232 add any_errors_fatal global config 2017-07-03 17:05:44 -04:00
Todd Hertel
e9447e9481 ec2_group fix TypeError bug #26291 2017-07-03 16:59:43 -04:00
Andreas Olsson
42408a97ea Correct doc about the Git module verify_commit param
All that is required to verify the signature is that the matching
public key is present in the remote user's keyring. There is no need
for GnuPG to explicitly trust the authenticity of the key.

Not Ansible specific, but rather the behavior of the `git verify-commit`
and the `git verify-tag` command line invocations.
2017-07-03 16:45:05 -04:00
Michael Scherer
bda066f6f6 Fix exception when using masquerade
The following snippet:

  - name: Let the DMZ connect to internet
  firewalld:
    zone: dmz
    masquerade: True
    permanent: True
    immediate: True
    state: enabled

will fail with this error message:

  Exception caught: set_masquerade_enabled() takes 1 positional argument but 3 were given

It turn out that it treat 'zone' as a array of string instead of 1 string.
I only tested on Python 3 with a Fedora 25.
2017-07-03 16:43:44 -04:00
Yanis Guenane
88099e2acb openssl_privatekey: Add publickey fingerprint (#22202)
This commit adds the fingerprint of the public key in openssl_privatekey
and openssl_publickey returned values.

```
{
  "changed": false,
  "filename": "/tmp/cert.pem",
  "fingerprint": {
    "md5": "31:22:14:58:c6:b1:7b:2a:48:89:b5:02:43:0a:d7:88",
    "sha1": "ed:e5:59:ba:9b:98:5b:e1:01:ef:4b:eb:f0:d1:1d:ee:84:88:c7:78",
    "sha224": "e1:c0:a6:bd:20:30:40:5b:c0:32:14:4a:01:3c:4b:c3:8a:49:a5:1f:ed:39:75:a4:57:e6:93:87",
    "sha256": "8a:18:86:88:79:e5:57:ca:c3:3c:89:92:ae:54:7f:ac:94:12:e2:c7:aa:c2:7c:97:77:cb:e7:8b:5e:1f:af:28",
    "sha384": "7a:5d:c2:49:cc:84:f4:74:ed:76:c7:03:e5:8d:aa:3b:31:b0:ba:0e:29:d2:76:3c:0e:3c:e5:d2:fd:b4:36:b1:70:b5:a6:bb:17:f4:db:ac:d6:75:81:36:42:dd:61:0c",
    "sha512": "da:0a:14:52:c6:c0:ab:fa:52:55:2a:85:65:35:7a:f6:5d:95:1d:d3:95:ae:bd:b9:d8:e0:75:dd:4f:0c:c9:3c:59:82:64:fa:d8:50:26:4f:b7:3a:5d:e8:6f:5d:de:9a:fe:ef:c2:c8:57:9d:e3:c0:c9:dd:4a:a9:bd:7a:77:f3"
  },
  "size": 4096,
  "type": "RSA"
}
```
2017-07-03 20:46:45 +01:00
Brian Coca
8f758204cf correct, cleanup & simplify dwim stack (#25956)
* correct, cleanup & simplify dwim stack

latlh chIS logh HeS qar wej chel laD
better errors
update find_file to new exception

* addressed latest comments

* test should not use realpath as it follows symlink

this fails when on OS X as /var is now a symlink to /private/var
but first_found was not supposed to follow symlinks
2017-07-03 15:27:53 -04:00
Abhijeet Kasurde
ec6e3b0e32 Handle errors gracefully in vmware_guest_snapshot (#25727)
CreateSnapshot may fail with several exceptions. This
fix generically handles these exceptions.

Fixes #21121

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-03 13:39:29 -04:00
Abhijeet Kasurde
29f5fe3ddd Resolve module correctly (#25658)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-03 11:36:42 -04:00
Yanis Guenane
ed15a0e9a7 Remove get_exception from crypto namespace
Fix removes get_exception in favor of native Python exception
handling. Also, added to_native to manage exception message.
2017-07-03 08:30:36 -07:00
jctanner
db5c0b3b2b Use the new file content function post facts refactoring. (#26353)
* Use the new file content function post facts refactoring.

Fixes #26339

* Do not make new abstraction ... use the real function

* Fix pep8 error
2017-07-03 10:35:17 -04:00
Ganesh Nalawade
11e72d495d Add net_logging platform agnostic module and junos implementation (#26316)
* Add net_logging platform agnostic module and junos implemenatation

*  net_logging platform agnostic module
*  junos implemenatation of logging module
*  net_logging integration test
*  junos_logging integration test
2017-07-03 15:31:59 +05:30
Ricardo Carrillo Cruz
4869a7b0ac Add net_linkagg platform agnostic module (#26341) 2017-07-03 11:50:14 +02:00
Trishna Guha
1b427aa419 Fix vyos banner idempotent (#26338)
* fix vyos_banner idempotent

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

* fix vyos_banner unit test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-03 13:08:08 +05:30
Wil Tan
483346d94b Fix win_nssm credentials quoting (#26226) (#26228)
Quote password to avoid Powershell special characters being interpreted.
2017-07-03 09:06:23 +10:00
dupondje
46514de5e6 Fix version_added for new option in template introduced in #21846 (#26302) 2017-06-30 22:58:56 +02:00
Brian Coca
4361659bee correctly deal with encoding in errors
fixes #26256
2017-06-30 14:40:38 -04:00
Denis Afonso
c9b00d2f02 Fixed the exception handling logic for the delete_group function. (#26109)
* Fixed he exception handling logic for the delete_group function.

fixes issue #26100

* Removed the unnecessary del_meta variables and made some other adjustments to the delete_user function
2017-06-30 14:12:50 -04:00
Abhijeet Kasurde
611fbea8ea Support quiesce, memory in vmware guest snapshot (#26275)
Fix adds support for quiesce and memory options while taking
snapshot of virtual machine. Update documentation and examples
for reflecting this change.

Fixes #26270

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 12:34:37 -04:00
Abhijeet Kasurde
f0a5854e39 Fix unresolved import in vmware module_utils (#25288)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 10:28:08 -04:00
Abhijeet Kasurde
5c374cd1ae Add Test Suite for vmware_vswitch (#26076)
Fix adds test suite for vwmare_switch

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-30 10:18:20 -04:00
Trishna Guha
93bbcd8a32 vyos_user fix idempotent (#26289)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-06-30 19:44:08 +05:30
Toshio Kuratomi
34589cee6d Unittests for extracting metadata from plugins (#26218)
* Unittests for extracting metadata from plugins
* Port plugin_docs to use the generic extract_metadata function
* Make the helper functions seek_end_of{string,dict} private
2017-06-30 06:48:32 -07:00
Will Thames
7ae4027c58 Improve ec2_vpc_subnet check mode (#23108)
check_mode should behave pretty similarly to non-check mode -
just don't actually create or delete subnets or change tags.

Using DryRun for check_mode behaves very differently and results
in the following module failure:

```
"msg": "Unable to update tags for subnet-abcd1234,
error: EC2ResponseError: 412 Precondition Failed
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Response><Errors><Error><Code>DryRunOperation</Code>
<Message>Request would have succeeded, but DryRun flag
is set.</Message></Error></Errors>
<RequestID>12345678-abcd-1234-abcd-abcd1234abcd</RequestID></Response>"
```
2017-06-30 08:04:48 -04:00
Vinay Dandekar
c884d4ab7f Add support for EC2 dynamic data in ec2_facts (#21532)
* Add support for EC2 dynamic data in ec2_facts

- Flattens out JSON in the instance identity document and IAM info/credentials for easy access to facts
- This changes region fact from ‘ansible_ec2_placement_region’ to ’ansible_ec2_instance_identity_document_region’

* Maintain backwards compatibility by putting the region into the old key

* Improve JSON parsing logic and split security group IDs

* Add documentation, backwards compatibility, fix bug and formatting

- Update documentation for ec2_facts with return values
- Preserve JSON value from the metadata service for backwards compatibility
- Fix bug in fix_invalid_varnames
  - The keys in the dict were being modified in place; new dict now created to hold the sanitized keys
  - Consolidate two replace calls with a regex substitution
- Move imports for ec2_facts to the top

* Add support for parsing the IAM instance profile role
2017-06-30 16:27:49 +10:00
Rob
d1652aecf0 Upgrade ec2_remote_facts to use boto3 (#22937)
* Deprecate ec2_remote_facts in favor of ec2_instance_facts which uses boto3

* Update legacy-files.txt with deprecated file name change
2017-06-30 14:19:08 +10:00