Commit graph

17162 commits

Author SHA1 Message Date
Yanis Guenane
d72ac0b391 openssl_privatekey: Standardize implementaton of the module
The OpenSSLObject class has been merged[1]. This commit makes the
openssl_privatekey rely on this class and standardize the way openssl
module should be written.

Co-Authored-By: Christian Pointner <cpointner@mgit.at>

[1] https://github.com/ansible/ansible/pull/26945
2017-07-25 15:31:11 +02:00
Toshio Kuratomi
8b34e31e05 Remove the error checking from apply_patch()
The error checking would itself cause a traceback.  The load_config()
function that we'd need to check for errors from only returns None so
there's no way to check for errors via the return value.  In the future
someone could rewrite the load_config function to return useful
information and restore the error checking but for now this is better as
it won't traceback on success and it will let us turn on static analysis
of undefined variables

Fixes #27255
References #27254
2017-07-25 06:12:44 -07:00
Trishna Guha
703eea3da2 eos_logging implementation module (#27093)
* eos_logging implementation module

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

* eos_logging integration test

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

* modify aggregate args logic

* changed collection to aggregate

* add blankline

* handle size value outside method
2017-07-25 18:16:04 +05:30
Philippe Dellaert
c00554735f New module: management of the Nuage Networks VSP SDN solution (network/nuage/nuage_vspk) (#24895)
* Nuage module and unit tests with requested changes

* Cleanup of imports

* Adding check on python version

* Adding import try and catch wrappers

* Cleanup of requirements and adding integration tests

* Using pypi package for simulator

* Cleanup of requirements and adding integration tests

* Adding aliases for integration tests

* Adding module to import sanity test skip list

* Revert "Adding module to import sanity test skip list"

This reverts commit eab23af8c5.

* Adding check for importlib and cleanup of requirements
2017-07-25 12:35:03 +01:00
Trishna Guha
e37e736ddb nxos_logging implementation module (#26949)
* nxos_logging implementation module

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

* pep8 fixes

* nxos_logging integration test

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

* test typo fix

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

* idempotent fix

* rename feature to facility

* make dest_group global var

* remove str from arg_spec
2017-07-25 17:03:54 +05:30
Yanis Guenane
8b22c45a45 Enable integration tests for the crypto/ namespace (#26684)
Crypto namespace contains the openssl modules. It has no integration
testing as of now.

This commits aims to add integration tests for the crypto namespace.
This will make it easier to spot breaking changes in the future.

This tests currently apply to:

  * openssl_privatekey
  * openssl_publickey
  * openssl_csr
2017-07-25 12:18:18 +01:00
René Moser
b3e8fa72ce cloudstack: cs_cluster: remove duplicate code error handling (#27261) 2017-07-25 11:33:58 +02:00
Sloane Hertel
495f91158c fix RETURN docs 2017-07-25 05:21:58 -04:00
Constantin Bugneac
aa341edf4c rds.py - added more attributes to the returned output 2017-07-25 05:21:58 -04:00
Toshio Kuratomi
b26ee657b5 Fix for nonutf8 filenames causing crashes when setting permissions
Fixes #23861
2017-07-25 00:16:30 -07:00
Toshio Kuratomi
035be94271 Fix cloudformation module for import of non-module_utils file 2017-07-24 18:19:32 -07:00
Toshio Kuratomi
59fa35446b Fix undefined vars in cnos module_utils
Fixing undefined vars across the codebase so that we can have pylint
catch them on every commit.

Some of the changes to this module_utils file are Python3 related => The
identifiers exist on python2 but not on Python3.  The changes should be
portable to both py2 (2.6+) and py3.

References #27193
2017-07-24 15:00:49 -07:00
Toshio Kuratomi
84285a741c Various fixes to ec2_vpc_dhcp_options module
* Stringify exception with a nicer error and include traceback
* Give a nice message if boto is not installed
* Fix undefined vars.  Cleaning up all undefined variables so that we
  can run static analysis on new commits.

  References #27193
2017-07-24 14:59:19 -07:00
bfloyd89
1f637f06a5 Make lambda_event.py python 2.6 compatible (#27241)
"Changed in version 2.7: The positional argument specifiers can be omitted, so '{} {}' is equivalent to '{0} {1}'."
2017-07-24 17:01:19 -04:00
Brian Coca
96d577c4c9 endswith supports tuples, nicer 2017-07-24 16:49:01 -04:00
Brian Coca
c7e841e0e4 better reading of 'facts' 2017-07-24 16:35:24 -04:00
Rob
3401a4b330 Rename classic elb modules to match new names applied to application LB modules (#25745) 2017-07-24 16:28:02 -04:00
Toshio Kuratomi
f22c04fa1e leftover from porting become to v2 that's unused
The set_become_default() function is not needed.  All this time, if it
was called it would try to set a value on a passed by value variable
(meaning that it had no effect after returning to the caller).  Since
become has been working in v2, this code is not needed.  Removing.
2017-07-24 10:12:17 -07:00
Toshio Kuratomi
6220c4aea1 Some enhancements to the symbolic_modes change
* Mark _symbolic_mode_to_octal and helper functions as classmethod and staticmethod
  These helpers should be made toplevel functions in their own module.
  For now, make them staticmethod/classmethod so that they can be used
  (and tested) without instantiating an AnsibleModule.
* Move regex compilation out of loops
* Get rid of python-2.4 compat
2017-07-24 10:08:51 -07:00
Dag Wieers
a5eea9042e vmware_host: Small fixes and docs updates (#25144)
* vmware_host: Small fixes and docs updates

This PR includes:
- A fix to no longer require a datacenter folder for adding a host
- Documentation improvements
- Ensure imports are specific

* Update vmware_host

Fix adds following:
* Update logic in vmware_host
* Update example documentation
* Added test case for vmware_host

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-24 13:02:58 -04:00
Abhijeet Kasurde
9649195c26 Refactor getvm method (#27188)
Fix refactors getvm method and modules which are using it.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-24 12:51:26 -04:00
Toshio Kuratomi
fc5d71de0d Fix for to_text and to_bytes error handlers
* surrogate_then_strict doesn't exist.  Switch to surrogate_or_strict
  instead.
* Found some bugs in the _text.py implementation
  * The composed error handlers (error handlers which are made up of two
    or more python encoding error handlers) had a wrong string in it,
    'surrogate_or_escape' doesn't exist.  Replaced that with
    'surrogate_or_replace' which is the correct handler name.
  * Left comment about the implicit conditions that are part of the
    surrogate_then_replace code path

Fixes #23865
Fixes #23861
2017-07-24 09:19:04 -07:00
Toshio Kuratomi
aa9941aaf7 Fix legacy su handling (bad conditional would not fire at the right time) 2017-07-24 10:49:41 -04:00
Toshio Kuratomi
06617548ed Fix undefined vars in network module_utils
References #27193
2017-07-24 07:49:26 -07:00
Ton Kersten
134852e686 #14634: symbolic permissions error (#14994)
This fixes the symbolic notation of the chmod modes, as stated in the man page of chmod (in Linux). This also takes into account that chmod a+x is different from chmod +x. As the second one should take the current umask into account.

Fixes #14634
2017-07-24 06:33:56 -07:00
Ganesh Nalawade
ad4ecf2a64 Fix EntityCollection stacktrace (#27217) 2017-07-24 09:57:52 +05:30
Dag Wieers
be1c517f4d Add example of templating inline using copy module (#19752)
* Add example of templating inline using copy module

The **copy** module documentation implies that `content:` only works
for 'simple values' and for complex stuff you need the **template**
module, but that is an understatement. You can use **copy** to template
anything you desire.

So I changed the wording, added an example, and also added a note
to the template module that the **copy** module could be used for
'inline templating'.

This fixes #19741.
2017-07-22 22:12:31 -07:00
Toshio Kuratomi
4e8b28e404 Switch from map and filter to list comprehensions and generator expressions (#27198)
One of the complex map + filter + lambda combinations here was causing
pylint to have a rare false positive detecting undefined variables.

Switch to list comprehensions and generator expressions which are
easi(er) to read for humans and do not confuse pylint.

References #27193
2017-07-22 19:12:35 -07:00
Sam Doran
1c40631382 Use atomic_move rather than writing in place in redhat_subscription (#27132)
* Use atomic_move rather than writing in place in redhat_subscription and redhat utils

* Change status to curated

* Put curated in the proper field

* Add RETURN doc section

* Disable yum plugins when unregistering

* Change back to community supported

* Alphabetize imports
2017-07-21 18:22:58 -04:00
Evan Kaufman
e8a396be16 cron - validate filename portion of cron_file param (#19185)
* Validated filename from `cron_file` param, updated docs

Fixes ansible/ansible-modules-core#4795, moved from ansible/ansible-modules-core#5361

* Broke long warning message over multiple lines

See: https://github.com/ansible/ansible/pull/19185#issuecomment-302961152
2017-07-21 23:51:34 +02:00
Thomas Krahn
141c6d0d9d ipa_sudorule: Fix bug: get_sudorule_diff() takes exactly 2 arguments (3 given) (#21150) 2017-07-21 23:39:43 +02:00
Andrea Scarpino
4fb5221b5f timezone: Assuming UTC when no /etc/localtime exists (#27131) 2017-07-21 23:15:06 +02:00
Michael Scherer
e2d6ecfa40 Workaround python-libselinux API change (#25685)
In the past, selinux.security_get_boolean_names did return 'bytes'
on python 3, but this was changed to return string later, cf:
b8711e2eaf

So we have to convert to bytes only if the API return us bytes.

Fix #25651
2017-07-21 10:14:22 -07:00
Abhijeet Kasurde
ede82e2130 Implement vmware_argument_spec for required params (#25731)
Without the fix hostname, username and password params
used to skip required check.

Fixes #25696

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-21 12:12:43 -04:00
Toshio Kuratomi
007a3b9c9b Don't need to convert cmd to bytes as it is already an array of bytes
Fixes #27016
2017-07-21 11:55:43 -04:00
Yanis Guenane
70f52e3043 crypto: Build a base object for openssl modules (#26945)
More openssl modules are about to be made, each of them rewriting
some pieces of code that can be refactored and used via a common
library.

This commit aims to create this "base" object and the common functions
one might want to reuse in order to avoid duplication.
2017-07-21 11:54:04 -04:00
David Newswanger
fd771e580f replace str with to_native (#27135) 2017-07-21 09:32:57 -06:00
Anil Kumar Muraleedharan
08327fa459 Changing new Device name from <Device Name>_cnos to <Device Name> (#27025) 2017-07-21 11:18:59 +01:00
McBadass
0229476c44 Added ability to specify destination OU when joining a domain (#22393)
* Added ability to specify destination OU when joining a domain

* Updated win_domain_membership documentation to include OU destination option.

* Updated python to include version

* Additional info in the docs
2017-07-21 10:50:54 +10:00
Brian Coca
899527f3cb make yaml extensions configurable
fixes #25419
2017-07-20 20:29:09 -04:00
Brian Coca
aca11a28a2 allow for null values in yaml inventory (#26765)
* allow for null values in yaml inventory

* 3 dad3 dad3 dad3 dad3 dad3 dad3 dad3 dad
2017-07-20 20:28:09 -04:00
Jordan Borean
5c6e5d4841 win_domain_group: new module (#26682)
* win_domain_group: new module
2017-07-20 17:08:08 -07:00
Dag Wieers
18d9c34e9d win_command, win_shell: Use Fail-Json on failure (#26512)
Two reasons to do this:
- It provides a proper error message indicating why it failed
- It conforms to what is being done in the command and shell modules
2017-07-21 07:34:48 +10:00
Toshio Kuratomi
3a2afc7825 Allow copy to writable files in unwritable dirs (#23509)
unsafe_writes currently allows updating a file that can be updated but
not removed (for instance, when docker mounted).  This change also
allows unsafe_writes to write to writable files in unwritable dirs. For
instance, if a system has made a single file inside of /etc/ writable to
a specific normal user.

Fixes #14961
2017-07-20 12:41:57 -07:00
Andreas Olsson
063f5d0ca8 Set default user-agent for module_utils.urls fetch_url (#27095)
The HTTP User-Agent "ansible-httpget" is already kind of the default,
it being the default value provided by the `url_argument_spec` helper
method. Yet, it may not be practical for all modules to get their
argument_spec that way.

Without a default User-Agent we fall back on the library
User-Agent. That being something like "Python-urllib/2.7".

While I'm no big fan of web servers making decisions based on the
provided User-Agent I still think that part of being a well-behaved
HTTP client is to provide an informative User-Agent. Not to mention
that it's a good thing for Ansible to behave consistently.

Indirectly fixes #26239
2017-07-20 12:34:41 -07:00
Anil Kumar Muraleedharan
7c65272e2d Removing _cnos from all new devices added (#27101) 2017-07-20 12:34:08 -07:00
Ricardo Carrillo Cruz
857726e6b1 Make the 'not found' regex case sensitive (#27100)
Turns out in some commands, like 'sh bgp summary' a line containing
'Not found' can be shown as a column.
This causes those commands to error out with RC=1 .

Fixes #26577
2017-07-20 12:33:18 -07:00
Nathaniel Case
85e7e342b0 nxos_bgp_af correct parents (#26996)
* move config location

* client-to-client is inverse of BOOL_PARAMS
2017-07-20 13:42:26 -04:00
James Cammarata
640d057f3f Don't use _raw_params for IncludeRole objects (#26601)
IncludeRole objects don't use _raw_params for the name/etc. of roles
like regular incudes, but the code for finding relative includes assumed
that all includes had a _raw_params field. This fixes that by correctly
checking the parent object type and using the appropriate field.

Fixes #26525
2017-07-20 12:32:06 -05:00
Thomas Stringer
bf63301b34 Fix bug that was uncovered by comparing the port range which is inherently a string but ansible passes the param in as an implied int if the range does not contain a non-numeric char (#27017) 2017-07-20 11:47:43 -04:00
Gabor Lekeny
7eab802669 SSH fails with '"parsed": false' error message
Fixes: #15436
2017-07-20 08:09:42 -07:00
Brian Coca
8e0b89bdbf corrected precedence, added comments to each entry 2017-07-20 11:07:06 -04:00
Toshio Kuratomi
f86ce0975d Add a directory walker to copy
* We need a directory walker that can handle symlinks, empty directories,
  and some other odd needs.  This commit contains a directory walker that
  can do all that.  The walker returns information about the files in the
  directories that we can then use to implement different strategies for
  copying the files to the remote machines.
* Add local_follow parameter to copy that follows local symlinks (follow
  is for remote symlinks)
* Refactor the copying of files out of run into its own method
* Add new integration tests for copy

Fixes #24949
Fixes #21513
2017-07-20 08:01:29 -07:00
Toshio Kuratomi
753a3a03d0 Revert "Fix for recursive copy slowness"
This reverts commit 78ced5318f.

The fix for copy slowness did not handle circular symlinks.
2017-07-20 08:01:29 -07:00
Pilou
556a1daa33 fix searched paths in DataLoader.path_dwim_relative (avoid AnsibleFileNotFound) (#26729)
* add unit test: nested dynamic includes

* nested dynamic includes: avoid AnsibleFileNotFound error

Error was:
Unable to retrieve file contents
Could not find or access 'include2.yml'

Before 8f758204cf, at the end of
'path_dwim_relative' method, the 'search' variable contained amongst
others paths:
'/tmp/roles/testrole/tasks/tasks/included.yml' and
'/tmp/roles/testrole/tasks/included.yml'.
The commit mentioned before removed the last one despite the method
docstrings specify 'with or without explicitly named dirname subdirs'.

* add integration test: nested includes
2017-07-20 10:26:13 -04:00
Jack Price
aed35aba70 Always set result variable in cloudflare_dns module (#23683)
Fixes #23682
2017-07-20 14:16:37 +02:00
Ganesh Nalawade
5ab8d30d10 Add net_vrf implementation for junos (#27055)
*  junos_vrf implementation
*  junos_vrf integration test
*  net_vrf integration test for junos
2017-07-20 11:20:18 +05:30
Yanis Guenane
f40db199aa openssl_*: Allow user to specify privatekey passphrase
Allow a user to specify the privatekey passphrase when dealing with
openssl modules.
2017-07-19 18:21:30 -07:00
Jordan Borean
a260063ffd Added function to convert camelCase to snake_case for powershell (#26203)
* Added camel case to snake case converters

* removed uneeded shebang

* renamed util to remove PowerShell from the name
2017-07-19 16:57:05 -07:00
David Newswanger
9f64e446c6 Fix #26918: IOS TypeError (#26999)
Fix IOS TypeError

* if flags are None, then ' '.join(flags) fails
* fixed get_defaults_flag so that it returns a list, and ignores lines with white space

Fixes #26918
2017-07-19 15:06:11 -07:00
David Newswanger
0b5b5ec50a fix unicode errors in iosxr 2017-07-19 14:51:35 -07:00
Pierre-Louis Bonicoli
045f0ff520 deprecated msg: fix a typo 2017-07-19 17:23:41 -04:00
Thomas Stringer
3ffe44c70d remove param vm_id in VirtualMachine constructor call (#22974) 2017-07-19 17:05:46 -04:00
Toshio Kuratomi
df15583ad0 Promulgate house's fix for docker_volume to docker_secret
* Revert change to docker_common as it's not as good as the try: except fix
* limit docker_volume fix to ImportErrors
* fix docker_secret i nthe same way
* Remove docker_secret from import tests
2017-07-19 13:20:47 -07:00
Will Thames
ef8c9798d3 include_role handlers bug fix (#26335)
* Ensure that include_role properly fires handlers

include_role needs to ensure that any handlers included
with the role are added to the _notified_handler and
_listening_handler lists of the TaskQueueManager, otherwise
it fails when trying to run the handler.

Additionally, the handler needs to be added to the
PlayIterator's `_uuid_cache` or it fails after running
the handler

Add more uuid debug statements - this code was hard
to debug with existing debug statements, so add more
uuid information at little additional output cost.

Fixes #18411

* Add tests for include_role handlers

Tests for #18411
2017-07-19 15:02:32 -05:00
Chris Houseknecht
2e073e73d2 Fixes doc string in docker_volume (#27074) 2017-07-19 15:42:31 -04:00
Matt Davis
96a0bdeac5 fix docker_volume import error when docker Python package is missing 2017-07-19 12:33:57 -07:00
Michael Scherer
1289322147 Initial working prototype of a salt bus connection plugin (#12836) 2017-07-19 12:48:50 -06:00
Nathaniel Case
56a0b988a9 nxos integration fix part 1 (#27069)
* Assorted Python 3 fixes

* Fix `testcase` definition in integration tests

* Fix nxos_acl_interface

* clean up nxapi after nxos_nxapi
2017-07-19 14:00:05 -04:00
James Mighion
b8337ee9d3 New module aireos_command (#26769)
* Adding ciscowlc_command module and unit tests.

* Adding __init__.py for unit test.

* Fixing PEP8 W503.

* Renaming module from ciscowlc_command to aire_command.

* Renaming aire_command to aireos_command.
2017-07-19 23:14:52 +05:30
Alex Grönholm
657ab58139 Added the docker_volume module (#24957)
* Added the docker_volume module

* Code style fixes

* Added yours truly to the copyright statement

* Added documentation link

* Fixed YAML syntax in documentation string

* Documentation style fixes based on the code review

* Implemented requested code corrections

* Added documentation for the "labels" option
* Handled APIErrors from docker-py
* Fixed the type of the "labels" option (dict -> list)

* Fixed typo

* Import APIError from docker_common, not from docker-py
2017-07-19 13:43:54 -04:00
Frederic Lepied
65d093d9a7 Skip f5 tests if f5-sdk is not installed (#27035)
Fixes: bug #27034

Introduced by 278fa552f8
2017-07-19 10:09:25 -06:00
Tim Rupp
09e9b4b4ba Adds refactored bigip_monitor_tcp (#26842)
This module needed to be refactored to use the REST API and
coding conventions for newer modules. This patch adds those changes.
This patch also deprecates params in favor of separate modules. These
deprecated params will be removed in 2.5.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp/tasks
2017-07-19 10:07:18 -06:00
Andreas Olsson
593297d7a2 Only use git verify-tag when verifying annotated tags (#26414)
* Only use `git verify-tag` when verifying annotated tags

The command `git verify-tag` only applies to annotated tags. When
verifying lightweight tags, which are more similar to non-moving
branches, one has to use `git verify-commit` instead.

Using ':' as a separator is appropriate since that is one of the
characters not allowed in a Git reference name.

See also https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html

* Improve testing of the Git module's gpg verification
2017-07-19 11:30:12 -04:00
Andreas Olsson
779d05aec4 Support tilde (~) paths for unarchive creates tests
This expands the value of the creates parameter the same way which the
value of the dest parameter is already being expanded.

Fixes #26965
2017-07-19 11:13:17 -04:00
Yanis Guenane
bc30dddb81 openssl_publickey: Allow one to specify the output format (#27031)
Public key can be extracted extracted in different format from
the PEM formatted RSA pair.

This commit allows the user to specify the format s/he wants to generate
the public key:

  * PEM
  * OpenSSH
2017-07-19 08:48:11 -04:00
Yanis Guenane
1dc608f2cf OpenSSL modules uses file_common_args (#27032)
* openssl_publickey: Allow one to specify file permission

Allow a user to specify file permissions on the generated publickey via
the file module common arguments.

* openssl: Add documentation regarding file_common_args

Add documentation for those modules to let the user know that he can
rely on file_common_args to specify file permissions.
2017-07-19 08:47:23 -04:00
danielerez
317ad54599 ovirt: ovirt_host_storage_facts (#26184)
Added 'ovirt_host_storage_facts' module to retrieve
a list of HostStorage[1] objects by a specified iscsi
target and address.

E.g.
- ovirt_host_storage_facts:
    vm: myhost
    iscsi:
      target: iqn.2016-08-09.domain-01:nickname
      address: 10.34.63.204

[1] http://ovirt.github.io/ovirt-engine-api-model/master/#types/host_storage

ISSUE TYPE
* Feature Pull Request

COMPONENT NAME
* lib/ansible/modules/cloud/ovirt/ovirt_host_storage_facts.py

@machacekondra
@mureinik @maorlipchuk
2017-07-19 07:25:47 -04:00
Sloane Hertel
79e54f4006 [cloud] s3_bucket: policy comparison - fixes #25428 (#25723)
Creates a new way to compare bucket policies by making their elements hashable & comparing that way after normalizing syntax like single-item lists.
2017-07-19 07:01:33 -04:00
Abhijeet Kasurde
cf34cefbdc Add FindByUUID testcase for vmware_guest_facts (#27022)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-19 06:43:51 -04:00
Yanis Guenane
0b1cca56f7 openssl_csr: Fix typo in the documentation (#27028)
Documentation state 'organizationUnitName' when the actual name of the
param is 'organizationalUnitName'
2017-07-19 05:17:45 -04:00
Dag Wieers
2b4a8095e9 Simplify XML error-handling and typo (#26929)
This PR fixes:
- A typo in the aci_login function
- Improve (XML) error-handling
- Rename status_code back to status
2017-07-19 08:46:16 +01:00
Ganesh Nalawade
abb4361990 Add vyos_interface default description (#27029)
* Add default description string to vyos_interface

* If `state=up` it should remove the `disable` configuration
  for interface. However, if no other interface parameter is configured
  this ends up deleting the interface itself which is not the desired
  behaviour. Hence adding a default description field to avoid such
  scenario's.

* Minor changes

* Add default description to aggregate
2017-07-19 13:01:56 +05:30
James Mighion
f682d9bf49 Adding aruba_command module along with unit tests. (#26625)
* Adding aruba_command module along with unit tests.

* Fixing PEP8 E303 too many blank lines.

* Adding default for timeout.

* Removing unused arguments. Moving default for timeout argument. Fixing cliconf to find hostname.

* Fixing PEP8 E302.
2017-07-19 09:49:12 +05:30
Matt Davis
907b662dc6 Powershell module_utils loader and tests (#26932)
* supports custom module_utils loads (anything in module prefaced with `#Requires -Module Ansible.ModuleUtils.*`)
* supports all usual PluginLoader module_utils locations (built-in lib/ansible/module_utils/, custom path from config, playbook module_utils/, ~/.ansible/module_utils, role module_utils, etc), 
* moves Powershell module_utils from module_utils/powershell.ps1 to module_utils/powershell/Ansible.ModuleUtils.PowerShellLegacy.psm1
2017-07-18 20:44:01 -07:00
Dag Wieers
636f8737c9 win_unzip: Add integration tests, check-mode, various (#25335) 2017-07-19 09:54:57 +10:00
David Moreau-Simard
26d358c64d Fix typo in docstring for host inventory plugin 2017-07-18 18:41:52 -04:00
David Moreau-Simard
16073f5b08 Add the 'ttl' parameter for sensu_check
The TTL [1] parameter for checks allows Sensu to detect if a check
has gotten stale (i.e, stopped checking).

[1]: https://sensuapp.org/docs/latest/reference/checks.html#check-attributes
2017-07-18 18:40:39 -04:00
Dag Wieers
1e8713a50a win_shortcut: Fail when command is not absolute path (#26533)
This PR ensures the user gets a proper error when the `src` is not an absolute path.

And some cosmetic cleanup, and improve integration tests.
2017-07-18 13:32:06 -07:00
Sloane Hertel
d971629062 [cloud] Fix ASG updates when LaunchConfigurationName does not exist for ASG instances
when replacing launch configurations the previous launch config is removed from any instances (#26966)
2017-07-18 16:21:11 -04:00
Vinay Dandekar
5b109506c4 [cloud] Rename ec2_facts to ec2_metadata_facts (#26293)
- Update CHANGELOG with ec2_facts deprecation notice
2017-07-18 16:11:09 -04:00
Ted Timmons
65da6a0789 [cloud][py3] Use to_bytes in ec2_key module in two more places (#26936)
PR #23051 fixes the first failure of this, but it doesn't fix the successive calls.
2017-07-18 15:35:31 -04:00
Matt Clay
6ce683c29e PEP 8 fix. 2017-07-18 10:22:34 -07:00
Tim Rupp
a236d249ae Adds the bigip_configsync_actions module (#26506)
This module is required as part of HA configuration of a set of
BIG-IPs. It is used to initiate and way for configuration syncing
to happen.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_configsync_actions.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_configsync_actions/tasks
2017-07-18 18:21:25 +01:00
Tim Rupp
3af1d6ccae Adds file_common_args to f5 utils (#26618)
This is needed by a future module, so I wanted to make sure it's
available now.
2017-07-18 18:19:06 +01:00
Tim Rupp
ea14107a56 Fixes some bugs in yaml and code (#26627)
related to default values that were pointed out to me.
2017-07-18 18:18:32 +01:00
Tim Rupp
75e609c15e adds the bigip_ucs module (#26663)
This module allows you to load existing UCS files onto a BIG-IP
system

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_ucs.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_ucs/tasks
2017-07-18 18:17:56 +01:00
Tim Rupp
72f41148a0 Adds tcp_echo module for bigip (#26844)
This patch is part a refactor of TCP monitors for BIG-IP. This module
may file in testing without the base tcp module merged because it makes
use of similar fixtures.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp_echo.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp_echo/tasks
2017-07-18 18:04:36 +01:00
Tim Rupp
278fa552f8 Adds half-open tcp monitor module (#26920)
This is necessary as a part of refactoring the tcp monitor module.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_monitor_tcp_half_open.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_monitor_tcp_half_open/tasks
2017-07-18 17:59:17 +01:00
Brian Coca
5ffb40fcdb properly filter out noise from debug 2017-07-18 12:32:39 -04:00
Sloane Hertel
cdd1a147f1 [cloud] fix exception examples in AWS guidelines to be compatible with python3 (#26948) 2017-07-18 09:35:19 -04:00
Dag Wieers
3f567d5295 Added RETURN information
Just that.
2017-07-18 08:13:09 -04:00
Anil Kumar Muraleedharan
9258196184 Update cnos_devicerules.py to add 4 new device supports (#26745)
The devices are NE1072T, NE1032, NE1032T, NE10032, NE2572
2017-07-18 13:12:27 +01:00
Anil Kumar Muraleedharan
7098735fdf Checked again with YAML Checker and Pep8 checker (#26786) 2017-07-18 13:11:21 +01:00
Abhijeet Kasurde
f5e9d19af7 Correct usage of FindByUuid in vmware module util (#26040)
This fix corrects the usage of function FindByUuid by
specifying correct parameter 'uuid' and 'instanceUuid'
as documentation of VMWare's API.

Fixes: #24398, #24835, #25713

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-18 07:48:21 -04:00
Abdul Anshad A
c6d012a2eb fix issue #4755 (#19234) 2017-07-18 07:27:37 -04:00
Andreas Olsson
4e01397817 Add IPv6 support to module_utils.urls TLS validation (#26852)
socket.create_connection is a higher-level function, which tries to
establish a socket connection using both AF_INET and AF_INET6. It got
introduced in Python 2.6, which ought to be fine with Ansible 2.4.

Fixes #26740
2017-07-18 09:55:39 +02:00
Ganesh Nalawade
b8cd646afd net_lldp_interface module implementation for junos (#26915)
*  junos_lldp_interface module implementation
*  junos_lldp_interface integration test
*  net_lldp_interface module intgration test for junos
*  Add lldp configuration parameter in junos_lldp
*  Modify junos_lldp testcase as per above change
*  Add net_lldp_interface module documentation
2017-07-18 12:14:10 +05:30
Will Medlar
3f67d167fe [Fixes #26690] Supports Python 3 handling of base64 encoding (#26876)
* [Fixes #26690] Supports Python 3 handling of base64 encoding

* Set text auth to separate variable for reuse
2017-07-17 21:11:52 -07:00
Jimmy Conner
fbf68b5725 vmware_guest relative paths for folder (#26927)
* Re-introduce relative paths to vmware_guest folder:

Move compile_folder_path_for_object function from vmware_guest_find to
utilities
Allow full path or relative path to be specified for the folder
parameter.  We will build the full path to the new VM.

* Remove duplicate check

* PEP8 Fixes
2017-07-17 22:18:20 -04:00
Peter Sprygada
8e2dcaf9f6 update asa to use network_cli connection plugin (#26899)
* WIP update asa to use network_cli connection plugin

* add asa.py to cliconf plugins
* update asa.py terminal plugin to support regexp and events
* update constants to map asa modules to asa action handler
* update asa action handler to implement persistent connections
* update asa shared module to use persistent connections
* update asa_command module to use new connection

* fixed pep8 issues
2017-07-17 21:23:38 -04:00
Toshio Kuratomi
84fb9f032d Fix symlink handling (#26877)
* Fix symlink handling

On symlinks, make lnk_source return the absolute path of the target of the symlink.
Add a new return field lnk_target that returns the actual, unexpanded path to the target of the symlink.
2017-07-17 12:06:35 -07:00
Sloane Hertel
66f5a094bc [cloud] iam_cert: allow paths to be specified so slurp is not necessary for remote host… (#26097)
* allow paths to be specified so slurp is not necessary for remote hosts to use

* Make requested changes

remove unused parameters

* remove module used out of scope

check the potential filepath to be true before checking isfile

remove required: false

* rephrase documentation

* remove 'lookups' from example
2017-07-17 15:00:54 -04:00
Toshio Kuratomi
d64e291274 Fix modules' use of BOOLEANS*
* The canonical location of BOOLEANS has moved.  Switch imports to use that.
* clean up argument_spec use of booleans.
* Clean up imports to not use wildcards
* Remove usage of get_exception
2017-07-17 11:48:05 -07:00
Toshio Kuratomi
ff22528b07 Consolidate boolean/mk_boolean conversion functions into a single location
Consolidate the module_utils, constants, and config functions that
convert values into booleans into a single function in module_utils.

Port code to use the module_utils.validate.convert_bool.boolean function
isntead of mk_boolean.
2017-07-17 11:48:05 -07:00
Toshio Kuratomi
f9c60e1a82 Make the ConfigManager in constants private
All play focused code should access constants via ansible.constants, not
via the config API.  Even that API should only be used by
ansible-config.  It should be considered an internal implementation
detail to everything else
2017-07-17 11:48:05 -07:00
Abhijeet Kasurde
e979663dfe Add testcase for vmware_guest_facts (#26873)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-17 13:34:43 -04:00
Rob
efbc65bff0 New module: Add elb_application_lb_facts (cloud/amazon/elb_application_lb_facts) (#24584)
* New module - elb_application_lb_facts

* Make sure tags dont get snake cased

* Add listeners and listener rules to application facts

* python3 compat fix
2017-07-17 12:00:58 -04:00
Dag Wieers
e970237a2f New module: access Cisco ACI (network/aci/aci_rest) (#26029)
* aci_rest: New module to access Cisco ACI

This PR includes:
- Relicense as GPLv3+
- Check-mode support
- Cosmetic changes to documentation
- Examples in YAML format
- Removal of incorrect requirements (for this module)
- Do not log passwords
- Implement native fetch_url instead of requests
- Use standard hostname, username and password parameters
- Add alias src for parameter config_file
- Add mutual exclusive content option for inline data (and show some inline examples)
- Add timeout parameter
- Add validate_certs parameter
- Handling ACI result output (identical for JSON as XML input)
- Parse/expose ACI error output to user

* Lower case method, add use_ssl, Use python dicts

This commit includes:
- Use lowercase method names
- Add `use_ssl` parameter (not the `protocol` parameter)
- Use a python dict for the request data (not a JSON string)
- Documentation improvements

* Ensure one of 'content' or 'src' is provided

* Fix issue with totalCount being a string in JSON

This fixes the problem with JSON output where totalCount is a string and
not an integer.

This fixes jedelman8/aci-ansible#7

* Improve code documentation

* Improve error handling and module response

* Small typo

* Improve documentation and examples

* Keep protocol parameter, but deprecate it

* Extrude aci functions from module_utils

* aci_rest: Add unit tests
2017-07-17 16:32:12 +01:00
Nathaniel Case
a3aa5d799e Fix nxos_system name-server parsing (#25973)
* Fix nxos_system name-server parsing

* Introduce lookup_source as a noop, but don't advertise its use
2017-07-17 11:15:43 -04:00
Nathaniel Case
855544604a Fix nxos_bgp_neighbor_af advertise_map and advertise_map_non_exist (#26721) 2017-07-17 11:15:06 -04:00
Brian Coca
4d55148ab2 removed redundant loader 2017-07-17 09:03:39 -04:00
Trishna Guha
e5c2e1b7be iosxr_logging implementation module (#26886)
* iosxr_logging implementation module

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

* iosxr_logging integration test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-07-17 17:20:22 +05:30
Trishna Guha
c38bccb3c4 Add ios_logging implementation module (#26785)
* Add ios_logging implementation module

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

* fix doc

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

* integration test net_logging and ios_logging

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

* modify the module code

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

* modify the module code

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

* change collection to aggregate

* fix buffer size logic

* fix pep8 issues
2017-07-17 12:45:53 +05:30
apmits
033a68d453 pip: Add example for --user (#26856)
* state type of arguments explicitly

* add example for --user argument
2017-07-17 08:17:06 +02:00
Rob
d0d2beafba have elb_application_lb use modify_listeners to avoid removing/recreating them (#25650)
* Rework how listeners and rules and handled. Fixes #25270

* Tidy up, documentation and add rules to returned output

* Remove required=False from argument_spec

* Remove unused functions. Add or [] in case of no elb

* Handle when listners is None in ensure_listeners_default_action_has_arn
2017-07-17 14:33:04 +10:00
sramakr
b980a5c02a Use Boto3 for ec2_group Fixes #23507 (#25340)
* Use Boto3 for ec2_group

Currently boto doesn't support ipv6. To support ipv6 in ec2_group, we need boto3.
boto3 has significant API changes, which caused more re-factoring for ec2_group module.
Added additional integration test to test_ec2_group role.

* Follow the standard for boto3 ansible

Fixed imports. Use boto3 ansible exception with camel_dict_to_snake_dict.
Refactored the call to authorize/revoke  ingress and egress.

* Removed dependancy with module ipaddress

Added new parameter called cidr_ipv6 for specifying
ipv6 addresses inline with how boto3 handles ipv6 addresses.

* Updated integration test

* Added ipv6 integration test for ec2_group

* Set purge_rules to false for integration test

* Fixed import statements

Added example for ipv6.
Removed defining HAS_BOTO3 variable and import HAS_BOTO3 from ec2.
Cleaned up import statements.

* Fixed exception handling

* Add IAM permissions for ec2_group tests

Missing AuthorizeSecurityGroupEgress necessary for latest tests

* Wrapped botocore import in try/except block

Import just botocore to be more similar to other modules
2017-07-17 12:03:31 +10:00
Ganesh Nalawade
879acf378d junos implementation of net_lldp (#26872)
*  junos_lldp module
*  junos_lldp integration test
*  net_lldp integration test for junos
*  Other minor changes
2017-07-17 07:14:09 +05:30
René Moser
30ad30c470 cloudstack: remove CloudStackException dep for several modules (#26874)
* cloudstack: cs_affinitygroup: remove CloudStackException dependency

* cloudstack: cs_domain: remove CloudStackException dependency

* cloudstack: cs_firewall: remove CloudStackException dependency

* cloudstack: cs_host: remove CloudStackException dependency

* cloudstack: cs_instancegroup: remove CloudStackException dependency

* cloudstack: cs_pod: remove CloudStackException dependency

* cloudstack: cs_configuration: remove CloudStackException dependency, fix pep8

* cloudstack: cs_cluster: remove CloudStackException dependency

* cloudstack: cs_network_acl: remove CloudStackException dependency

* cloudstack: cs_network_acl_rule: remove CloudStackException dependency

* cloudstack: cs_zone_facts: remove CloudStackException dependency

* cloudstack: cs_zone: remove CloudStackException dependency

* cloudstack: cs_vpn_gateway: remove CloudStackException dependency

* cloudstack: cs_vpc: remove CloudStackException dependency

* cloudstack: cs_sshkeypair: remove CloudStackException dependency

* cloudstack: cs_role: remove CloudStackException dependency

* cloudstack: cs_ip_address: remove CloudStackException dependency

* cloudstack: cs_ip_staticnat: remove CloudStackException dependency

* cloudstack: cs_resourcelimit: remove CloudStackException dependency

* cloudstack: cs_region: remove CloudStackException dependency

* cloudstack: cs_project: remove CloudStackException dependency

* cloudstack: cs_network: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule_member: remove CloudStackException dependency

* cloudstack: cs_loadbalancer_rule: remove CloudStackException dependency

* cloudstack: cs_iso: remove CloudStackException dependency
2017-07-16 22:05:14 +02:00
Patrick Marques
a59684fddd Created digital_ocean_floating_ip module (#18922)
* Created digital_ocean_floating_ip module
2017-07-16 11:01:04 -07:00
René Moser
8477525d2b cloudstack: cs_account: remove CloudStackException dependency (#26870) 2017-07-16 12:02:28 +02:00
Rene Moser
1a27546039 cloudstack: cs_router: use query_api, remove CloudStackException dependency 2017-07-16 11:46:10 +02:00
Rene Moser
9543025b91 cloudstack: cs_router: fix pep8 2017-07-16 11:46:10 +02:00
Rene Moser
d88e9ab869 cloudstack: cs_router: add zone param 2017-07-16 11:46:10 +02:00
Rene Moser
c896aab5e3 cloudstack: cs_router: fix router not found and async polling in reboot 2017-07-16 11:46:10 +02:00
René Moser
5979f2543f cloudstack: cs_instance_nic: remove duplicate code (#26869) 2017-07-16 11:41:36 +02:00
René Moser
1d907de966 cloudstack: cs_user: fix pep8 and minor restyling (#26849) 2017-07-15 19:16:53 +02:00
René Moser
2a751e1753 cloudstack: cs_instance_nic: remove CloudStackException dependency (#26860) 2017-07-15 19:12:32 +02:00
René Moser
8320071e81 cloudstack: utils: reduce cs lib dependency in modules (#26848)
Also improves error handling and reduces code duplication
2017-07-15 18:25:27 +02:00
ioggstream
dc408f9035 known_hosts: always use lowercase hostnames for host keys (#26850) 2017-07-15 17:51:19 +02:00
Pilou
d9265c7498 os_ironic: fix broken import (#26802) 2017-07-15 08:44:50 -05:00
Quentin Dawans
613690bd46 Proxmox set number of cores for vm/ct (#25901)
* Proxmox set number of cores for vm/ct

Argument to limit the number of assigned core to a vm/ct

* version_added & pep8

* default to 1
2017-07-15 10:51:13 +01:00
Ganesh Nalawade
bf48364c72 junos implementation for net_l3_interface module (#26829)
* junos implementation for net_l3_interface module

*  junos_l3_interface implementation
*  junos_l3_interface integration test
*  net_l3_interface integration test for junos

* Fix module name typo
2017-07-15 12:38:44 +05:30
Brian Coca
04868c22b7 fixed issue with null host vars 2017-07-15 00:20:08 -04:00
Adrian Moisey
6ba49f42c2 Allow creation of github release tags (#25338)
* Allow creation of github release tags

* Reword description

* Prefer to use required_if
2017-07-14 14:57:56 -04:00
Abhijeet Kasurde
6bc15d11b9 Remove unreachable code (#26820)
Break statement is unreachable in current for loop.
Safely remove break statement.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 14:52:30 -04:00
Abhijeet Kasurde
b6fdc904a9 Remove redundant switch_name param (#26817)
Class uses a redundant switch_name param, which can be
removed safely.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 14:49:48 -04:00
Peter Hoffmann
2f81a28414 use tenant in UserPassCredentials if set (#20751)
* use tenant in UserPassCredentials if set

If you have multiple Tenants you need to set the tenant in https://github.com/Azure/msrestazure-for-python/blob/master/msrestazure/azure_active_directory.py otherwise the azure_rm.py call will fail.

see: https://github.com/ansible/ansible/pull/20750

* fixed PEP8 failure
2017-07-14 11:01:43 -07:00
Jordan Borean
8e05d7d962 win_secedit: Added module with tests/diff mode (#26332)
* win_secedit: Added module with tests/diff mode

* fixed up test issues

* Added missing return value

* change for win_secedit based on review

* updated win_security_policy examples for rename
2017-07-14 11:00:29 -07:00
Dag Wieers
4a1864765b Windows: Path integration tests (#26490)
These integration tests were used for testing the exact behaviour of
Ansible for YAML-style syntax and key=value syntax.

This includes fixes to win_shortcut (as `src` can be a URL too)
2017-07-14 10:24:54 -07:00
Colin Heinzmann
1d14de1d8c fixed win_nssm escaping issue (#22512)
* bugfix: applicaiton setting was not properly escaped leading to issues
when picking application under C:\Program Files (x86)\...
2017-07-14 10:11:02 -07:00
Nathaniel Case
61249995a1 Update nxos_interface_ospf & add test (#26644)
* Update nxos_interface_ospf & add test
2017-07-14 12:31:36 -04:00
Jordan Borean
eb1ed6567c win_regedit: rewrite to support edge cases and fix issues (#26468)
* win_regedit: rewrite to support edge cases and fix issues

* fix up byte handling of single bytes and minor doc fix

* removed unused method

* updated with requested changes
2017-07-14 09:28:49 -07:00
Greg
3506febbb9 Fixing issue related to writing ini files
When the file is opened with rwa+ and the update file size is smaller than the original the ini file can become corrupt.  The issue was noticed when we had comments at the top of /etc/yum/pluginconf.d/rhnplugin.conf after using the rhn_register module the file became correct.

rwa+ also make no sense as the file is only written too and why would any appending need to happen?
2017-07-14 11:20:32 -04:00
Jonan
088b930808 Update service.py
Ensure "initctl status servicename" passes along arguments to check correct instance.
2017-07-14 10:57:10 -04:00
Arne de Laat
c536f7789b In cronvar only use '-u {user}' if self.user is not the current user
Use the same logic as in the cron module.
2017-07-14 10:44:31 -04:00
Brian Coca
c581ae4b8d corrected version 2017-07-14 10:25:40 -04:00
Peter Shrom
80e88a7d40 updated version added 2017-07-14 10:25:41 -04:00
Peter Shrom
de5fb8d98c adding ability to set openstack image ids 2017-07-14 10:25:41 -04:00
Gawain
6608629d25 Add 'mac_address' to the attributes returned from the vmware_vm_facts module (#26527)
* Add 'mac_address' to the attributes returned from the vmware_vm_facts module

* fix pep8 issue
2017-07-14 10:25:20 -04:00
Ganesh Nalawade
751ad7021c vyos implementation for net_interface module (#26799)
* vyos implementation for net_interface module

*  vyos_interface implementation module
*  vyos_interface integration test
*  net_interface integration test for vyos

* Change collection to aggregate
2017-07-14 19:39:21 +05:30
Abhijeet Kasurde
a1977d9654 Remove redundant get_obj method (#26324)
vmware_guest_facts has redundant get_obj method, this can
be removed safetly.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 10:04:10 -04:00
Toshio Kuratomi
e986e31a75 This function is for setting variables on hosts. So those two parts are always required.
Don't have to check for the existence of those in the function.  If they
aren't set to iterables then it should be up to the calling code to
handle it.
2017-07-14 07:03:26 -07:00
Abhijeet Kasurde
b4a58b65fb Add param for snapshot subtree removal (#26576)
Fix adds a parameter for removing snapshot subtree.

Fixes: #26522

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 10:00:37 -04:00
Peter Sprygada
b9a1998af5 changes changed to modified in save_when choices (#26801) 2017-07-14 15:08:19 +02:00
Peter Sprygada
3bbb32cac5 fixes error when trying to run show start over eapi (#26800) 2017-07-14 15:07:44 +02:00
Abhijeet Kasurde
156b29b26b Fix for check_mode in archive (#26788)
Fix adds check_mode fix for archive module. Also,
adds unit tests for archive module

Fixes: #26750

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-07-14 09:06:17 -04:00
Ricardo Carrillo Cruz
8333a8b908 Fix eos_config defaults logic (#26798)
Current code is bogus, it was passing flags all unconditionally.
2017-07-14 13:43:17 +02:00
Robin Roth
d4482761ba Make lujeni only maintainter of mongodb_user (#26789) 2017-07-14 11:16:26 +01:00
Lujeni
661791dcb7 Fix the editable condition into pip module (#19028) (#19688)
* Fix the editable condition into pip module (#19028)

* Add editable to tests

Default changed to False, so now editable: True is needed explicitly in
tests
2017-07-14 10:54:04 +01:00
Morgan Robertson
44730c28cc Allow creation of Mongo user via localhost exception (#22792)
* Allow creation of user with localhost exception.

Fixes #22791

When access control is enabled, Mongo allows a user to be created from
localhost (called the "localhost exception":
https://docs.mongodb.com/v3.2/core/security-users/#localhost-exception).
When the `update_password` parameter was added to this module in
Ansible 2.1, this functionality was broken due to a query performed
before `user_add()` is called. This fix only performs the query when
when `update_password` is set to `on-create`, allowing a user to be
created via the localhost exception.

* Only set `password = None` when user exists.
2017-07-14 10:52:19 +01:00
jctanner
245a4d30b9 vmware_guest: fix datastore selection on equal sized disks and add tests (#26774)
* Fix datastore selection on equal sized disks and add tests
2017-07-13 22:02:33 -04:00
Will Thames
df321e8579 [cloud] change iam_managed_policy return to snake_case (#26219)
* Change iam_managed_policy to return snake case

Import module_utils.ec2 methods explicitly

* iam_managed_policy: tidy argument spec

Remove unnecessary specifications (`default=None`, `required=False`)
Use `required_if` to check for `policy` when `state` is `present`

* Provide exception handling in iam_managed_policy

Pretty much all AWS API calls can go wrong, and we should handle them.

Update line wrapping to improve readability of method calls

* Improve error handling when policy version limit exceeded

Better document policy version limit exceeded, and check
the error code to see that that's actually what happened
(rather than e.g. no permissions to add a new version)

* iam_managed_policy: better handle pagination and retry
2017-07-13 21:30:41 -04:00
Takuya Sato
179e2882f7 ecs_taskdefinition module: containers.environment convert to string (fix #23297) (#23681)
It is to fix the failed comparison of containers.
2017-07-13 20:10:31 -04:00
Rene Moser
6d81c9670f cloudstack: cs_role: fix UnboundLocalError in check mode 2017-07-14 00:51:35 +02:00
Brian Coca
3a1b84153c ensure all groups inherit from 'all' 2017-07-13 18:38:39 -04:00
Brian Coca
84367eacef added ansible_remote_tmp inventory var (#26754)
* added ansible_remote_tmp inventory var

* fixed horrible crime of no space after #
2017-07-13 15:31:10 -07:00
Nathaniel Case
62e4353ba1 nxos_facts cleanup (#26192) 2017-07-13 16:56:04 -04:00
Nathaniel Case
f3acf9c929 Fix NX-API json handling (#26716) 2017-07-13 16:23:24 -04:00
Sloane Hertel
ed51380c2c [cloud] ec2_vol module snapshot and volume_size are not mutually exclusive (#26764) 2017-07-13 15:08:03 -04:00
Pilou
2a92120ffa INI inventory plugin: add documentation about variable types (#25798)
* INI inventory: check variable types
* INI inventory: add doc about variable types

Fixes #25784
2017-07-13 12:04:20 -07:00
Ricardo Carrillo Cruz
af4dc6d0eb Add vyos_lldp and vyos_lldp_interface modules (#26753)
* Add vyos_lldp and vyos_lldp_interface modules

* Fix module docstring issue

* Fix bogus aggregate reference

* Add vyos_lldp integration tests

* Add vyos_lldp_interface integration tests

* Remove unused import for run_commands

* Add VyOS net_lldp integration tests

* Remove junos and netconf from net_lldp integration tests

* Add net_lldp_interface integration tests

* Correct CLI filtering tests for VyOS

* Fix pep8 issues

* Fix more pep8 issues
2017-07-13 20:58:18 +02:00
Pilou
4b3d6dfa8a Use pycodestyle instead of pep8 (#25947) 2017-07-13 11:46:31 -07:00
William Leemans
267d0fb400 Update hpilo_boot.py (#24499)
* Update hpilo_boot.py

Add option to change the ssl version to connect to the remotr iLO

* Update hpilo_boot.py

added version_added

* Update hpilo_boot.py

fix lib/ansible/modules/remote_management/hpilo/hpilo_boot.py:83:25: W291 trailing whitespace

* Update hpilo_boot.py

nitpicking fixes :)
2017-07-13 13:48:03 -04:00
William Leemans
ae3a6cd931 Update hpilo_facts.py (#24503)
* Update hpilo_facts.py

Add option to change the ssl version used to connect to the remote iLO

* Update hpilo_facts.py

addition of spaces after commas in lists and replace()
2017-07-13 13:47:52 -04:00
Toshio Kuratomi
b49be56c5b Need regex and string types to match when cleaning arguments for logging
Fixes #25078
2017-07-13 12:24:18 -04:00
Ricardo Carrillo Cruz
5719687920 Split net_lldp into net_lldp (service) and net_lldp_interface (#26757) 2017-07-13 16:38:15 +02:00
Christian Pointner
34c0abd106 Openssl csr fixes (#26110)
* openssl_csr: fix for python3

* openssl_csr: actually check for existence of pyOpenSSL

* pep8 compliance

* fixes for python 2.6 and 3
2017-07-13 09:42:48 -04:00
Ricardo Carrillo Cruz
5a20095b04 Add missing __init__.py on network protocol folder (#26742) 2017-07-13 12:04:49 +02:00
Ricardo Carrillo Cruz
9e819eeee8 Add net_lldp platform agnostic module (#26738) 2017-07-13 12:02:45 +02:00
Peter Sprygada
41c1457823 adds put_file and fetch_file implementations for cliconf plugin (#26728) 2017-07-13 09:21:02 +05:30
Bartek Bielawski
374ea94dc3 Adding more explicit module syntax (#26722)
Removing module_version from Attributes, support for class based resouces that need version specified when multiple version are present, support for File resource that has blank output for ModuleName/Version in Get-DscResource
2017-07-12 19:50:29 -04:00
Brian Coca
a5007f2f88 Namespaced facts fixes (#26615)
* shorten warning on reservd fact collision

also remove ansible_ from namespaced facts for vars manager
handle str conversion errors
use tuple to avoid iterator errors
version added added

* only modify final one

* removed ansible_ removal
2017-07-12 19:27:05 -04:00
jctanner
df507ca9c4 vmware_guest: fixes for cache objects and datacenter association (#26719)
* vmware_guest: fixes for cache objects and datacenter association
* find_all_objs was only looking for datastores
* Clear the result if it's datacenter is not correct.
* Re-enable pyvmomi installation

Addresses #25011
Addresses #26511
2017-07-12 17:10:48 -04:00
evancarter-iex
c22ec81b99 gce_instance_template: Add ability to use disks_gce_struct (#25500)
* Add ability to use disks_gce_struct

* Fixed typos in the options section

* Spacing fixes
2017-07-12 16:36:05 -04:00
Nathaniel Case
5cfdd5df0f nxos_pim_interface (#26367)
* Add unit tests to nxos_pim_interface

* Update tests to match module

* Update nxos_pim_interface

* Address pep8 issues
2017-07-12 15:39:43 -04:00
Matt Davis
c711754924 fix win_chocolatey syntax errors 2017-07-12 11:49:56 -07:00
Brian Coca
c2326aef01 dont show failed key on debug 2017-07-12 14:26:32 -04:00
tdtrask
c24398cfd9 apk: Fix failure when both install and upgrade in same command (#26666)
* apk: Fix failure when both install and upgrade in same command

If name list contains an installed package that needs upgrade plus a new package, apk command would fail due to missing space character.

* Simplify fix by concatenating lists
2017-07-12 12:26:30 -04:00
Ken Celenza
31b6ac896d Kc update ip filter (#26566)
* add first, last and next usable

* add usable ip filters

* add size usable, range usable and wildcard

* add ip prefix and netmask filter

* add network formatting and check if ip in subnet

* clean up order, add comments

* fix pep8

* update format by index

* clean up and updates from jmcgill298
2017-07-12 17:17:58 +01:00