Commit graph

17318 commits

Author SHA1 Message Date
Kamil Cholewiński
b5414088a3 Add ConfigMap support to kubernetes module (#21014) 2017-08-09 16:03:35 -04:00
Nathaniel Case
a78f3faa6c nxos_bgp_neighbor_af does not want required_together (#26370)
* nxos_bgp_neighbor_af does not want required_together

* fixup tests

* Fix max_prefix_* issues

* Require address-family

* Fix idempotency for next_hop_third_party

* Fix idempotency for allowas_in*

* Fix idempotency for *_in and *_out

* Reorder command generation again

`default` is first, then `max-prefix`, then booleans
2017-08-09 15:54:34 -04:00
Peter Sprygada
4fb114174b fixes Traceback generated by nxos_igmp module (#27869)
* fixes Traceback generated by nxos_igmp module

* update module code to reflect review comments

* doh!...remove q
2017-08-09 15:52:37 -04:00
Colin Nolan
db50650365 Adds support for all Consul 0.8 ACL rule scopes (#25800)
* Added in support for 'agent' and 'node' types.

* Tidies and moves `consul_acl` module closer to PEP8 compliance.

* Switched from using byspoke code to handle py2/3 string issues to using `to_text`.

* Made changes suggested by jrandall in https://github.com/ansible/ansible/pull/23467#pullrequestreview-34021967.

* Refactored consul_acl to support scopes with no pattern (and therefore a different HCL defintion).

* Corrects whitespace in Consul ACL HCL representation.

* Fixes Consul ACL to return the HCL equivalent JSON (according to the Consul docs) for the set ACLs.

* Repositioned import to align with Ansible standard (!= PEP8 standard).

* Adds Python 2.6 compatibility.

* Fixes PEP8 issues.

* Removes consul_acl.py as it now passes PEP8.

* Follows advice in the "Documenting Your Module" guide and moves imports up from the bottom.

* Tidies consul_acl module documentation.

* Updates link to guide about Consul ACLs.

* Removes new line spaces from error message string.

* Provide better error message if user forgets to associate a value to a Consul ACL rule.

* Minor refactoring of Consul ACL module.

* Fixes bug that was breaking idempotence in Consul ACL module.

* Detects redefinition of same rule.

* Adds test to check the Consul ACL module can set rules for all supported scopes.

* Fixes return when updating an ACL.

* Clean up of Consul ACL integration test file.

* Verify correct changes to existing Consul ACL rule.

* Adds tests for idempotence.

* Splits Consul ACL tests into cohesive modules.

* Adds test for deleting Consul ACLs.

* Test that Consul ACL module can set all rule scopes.

* Fixes issues surrounding the creation of ACLs.

Thanks for the comments by manos in https://github.com/ansible/ansible/pull/25800#issuecomment-310137889.

* Stops Consul ACL's name being "forgotten" if ACL updated by token.

* Fixes incorrect assignment when a Consul ACL is deleted.

* Fixes value of `changed` when Consul ACL is removed.

* Fixes tests for Consul ACL.

* Adds interal documentation.

* Refactors to separate update and create (also makes it possible to unit test this module).

* Improves documentation.

* Completes RETURN documentation for Consul ACL module.

* Fixes issue with equality checking for `None` in ACL Consul.

* Fixes Python 2 issue with making a decision based on `str` type.

* Fixes inequality check bug in Python 2.

* Adds tests for setting ACL with token.

* Adds support for creating an ACL with a given token.

* Outputs operation performed on Consul ACL when changed.

* Fixs issue with test for creating a Consul ACL with rules.

* Corrects property used to set ACL token in python-consul library.

* Fixes tear-down issue in test that creates a Consul ACL using a token.
2017-08-09 15:21:12 -04:00
Lucas Melchior
756b510414 fixed formatting for maven_artifact synopsis 2017-08-09 14:43:29 -04:00
Eduardo Suarez-Santana
9339b0f4a7 Fix lookup into search paths when undefined.
A fileglob may issue a warning `Unable to find xxxx in expected paths` when `ansible_search_path` is not defined, because it loops over the characters in the string instead of looping over a list of one element.
2017-08-09 14:07:40 -04:00
QijunPan
9e3ae8a0cb Delete unused module_utils/cloudengine.py (#25054)
* Delete unused cloudengine.py
rename cloudengine to ce.

* remove unused cloudengine.py
2017-08-09 12:32:45 -04:00
Willem van Ketwich
82765637b9 AWS EC2 ASG - Replace ELBs correctly and remove existing ELBs when specified as an empty list (#27830)
* fixes for edge cases - load_balancers has not been specified - don't want to delete existing elbs, wanted elbs aren't a superset of has_elbs (eg. 1 elb existing, adding another), specifying load_balancers: [] to delete existing elbs
2017-08-09 11:56:30 -04:00
saichint
14186af558 Fix for nxos_ospf idempotent issue (#27913) 2017-08-09 11:25:35 -04:00
Andrej Svenke
ef55530d67 ecs_attribute: new module. (#20618)
ecs_attribute: fixed docs.

ecs_attribute: changed state to 'present' by default.

ecs_attribute: pep8 fix.

ecs_attribute: improved attribute iteration.

ecs_attribute: fixed absent EC2_REGION error message.

ecs_attribute: fixed exception handling on invalid attribute (e.g. 2+2).

ecs_attribute: pep8 fix.

ecs_attribute: docs and python3 fixes.

ecs_attribute: fixed class declaration for python 2-3 compatibility.
2017-08-09 11:06:24 -04:00
flowerysong
e2b2ba6bc7 hashi_vault: fix token logic again (#27863)
The token is not mandatory, and there are more ways of setting it than
passing it in as a module arg.
2017-08-09 10:53:30 -04:00
Adrian Likins
767cd82e42 Fix module failure with pacemaker_cluster: state=cleanup (#27846)
* Fix module failure with pacemaker_cluster: state=cleanup

If state=cleanup was used, set_cluster() was being called
with 'cleanup' state which it doesn't handle. Instead
use existing clean_cluster() method.

Fixes #27799

* get and return cluster_state on state=clean as well
2017-08-09 10:43:16 -04:00
Anil Kumar Muraleedharan
52a8ed55ee Update cnos.py to remove unused method checkServerForImage (#27767) 2017-08-09 10:16:13 -04:00
Will Rouesnel
1685338603 get_url: Use atomic_move with get_url rather then shutil.copyfile
This brings get_url inline with the other internal file handling modules,
and allows replacement of in-use files.
2017-08-09 10:09:03 -04:00
Nathaniel Case
01dda25e0f fix nxapi transport in nxos_snmp_location (#27849)
* fix nxapi transport in nxos_snmp_location

* Appease Shippable
2017-08-09 09:44:02 -04:00
Nathaniel Case
c1bf74283e Network load_config: Capture configuration output and display as warnings (#27851)
* Capture configuration output and display as warnings

* Don't break on nxapi

nxapi errors very loudly instead, so no need to muck about with warnings
2017-08-09 09:43:04 -04:00
Dag Wieers
2af759e9f9 vmware_vm_facts: Improve example and docs (#27898)
This fixes ansible/ansible-modules-extras#2475
2017-08-09 09:41:30 -04:00
schunduri
3241b7116e Cisco ACI New Module PR (#26836)
* New ACI Tenant module

*  New module requirements added.

* Placed from __future__ import to be the first line

* Interpreter line added
2017-08-09 07:08:44 -06:00
s-hertel
875c8e4f3e ensure stickiness expiration is an int before comparison 2017-08-08 22:30:50 -07:00
Ganesh Nalawade
1f7e04d958 Fix junos_lldp integration test failure (#27936) 2017-08-09 10:23:41 +05:30
Dag Wieers
6874ba23ff New module: Support manipulating XML files (#25323)
* Import original unmodified upstream version

This is another attempt to get the xml module upstream.
https://github.com/cmprescott/ansible-xml/

This is the original file from upstream,
without commit 1e7a3f6b6e2bc01aa9cebfd80ac5cd4555032774

* Add additional changes required for upstreaming

This PR includes the following changes:

- Clean up of DOCUMENTATION
- Rename "ensure" parameter to "state" parameter (kept alias)
- Added EXAMPLES
- Remove explicit type-case using str() for formatting
- Clean up AnsibleModule parameter handling
- Retained Python 2.4 compatibility
- PEP8 compliancy
- Various fixes as suggested by abadger during first review

This fixes cmprescott/ansible-xml#108

* Added original integration tests

There is some room for improvement wrt. idempotency and check-mode
testing.

* Some tests depend on lxml v3.0alpha1 or higher

We are now expecting lxml v2.3.0 or higher.
We skips tests if lxml is too old.

Plus small fix.

* Relicense to GPLv3+ header

All past contributors have agreed to relicense this module to GPLv2+, and GPLv3 specifically.

See: https://github.com/cmprescott/ansible-xml/issues/113

This fixes cmprescott/ansible-xml#73

* Fix small typo in integration tests

* Python 3 support

This PR also includes:
- Python 3 support
- Documentation fixes
- Check-mode fixes and improvements
- Bugfix in check-mode support
- Always return xmlstring, even if there's no change
- Check for lxml 2.3.0 or newer

* Add return values

* Various fixes after review
2017-08-08 20:21:03 -07:00
CyberArk BizDev
923445a484 CyberArk User Management (#27519)
* Initial submit for CyberArk User management module
2017-08-08 18:34:40 -07:00
Michael Price
760015fc6d Refactor E-Series Volume to use module_utils (#20901)
Refactor the NetApp E-Series module to utlize the common module_utils
and doc_fragments.
2017-08-08 14:51:02 -06:00
Adrian Likins
c38ff3b8f8 pylint fixes for vault related code (#27721)
* rm unneeded parens following assert
* rm unused parse_vaulttext_envelope from yaml.constructor
* No longer need index/enumerate over vault_ids
* rm unnecessary else
* rm unused VaultCli.secrets
* rm unused vault_id arg on VaultAES.decrypt()

pylint: Unused argument 'vault_id'
pylint: Unused parse_vaulttext_envelope imported from ansible.parsing.vault
pylint: Unused variable 'index'
pylint: Unnecessary parens after 'assert' keyword
pylint: Unnecessary "else" after "return" (no-else-return)
pylint: Attribute 'editor' defined outside __init__

* use 'dummy' for unused variables instead of _

Based on pylint unused variable warnings.

Existing code use '_' for this, but that is old
and busted. The hot new thing is 'dummy'. It
is so fetch.

Except for where we get warnings for reusing
the 'dummy' var name inside of a list comprehension.

* Add super().__init__ call to PromptVaultSecret.__init__
pylint: __init__ method from base class 'VaultSecret' is not called (super-init-not-called)

* Make FileVaultSecret.read_file reg method again

The base class read_file() doesnt need self but
the sub classes do.

Rm now unneeded loader arg to read_file()

* Fix err msg string literal that had no effect
pylint: String statement has no effect

The indent on the continuation of the msg_format was wrong
so the second half was dropped.

There was also no need to join() filename (copy/paste from
original with a command list I assume...)

* Use local cipher_name in VaultEditor.edit_file not instance
pylint: Unused variable 'cipher_name'
pylint: Unused variable 'b_ciphertext'

Use the local cipher_name returned from parse_vaulttext_envelope()
instead of the instance self.cipher_name var.

Since there is only one valid cipher_name either way, it was
equilivent, but it will not be with more valid cipher_names

* Rm unused b_salt arg on VaultAES256._encrypt*
pylint: Unused argument 'b_salt'

Previously the methods computed the keys and iv themselves
so needed to be passed in the salt, but now the key/iv
are built before and passed in so b_salt arg is not used
anymore.

* rm redundant import of call from subprocess
pylint: Imports from package subprocess are not grouped

use via subprocess module now instead of direct
import.

* self._bytes is set in super init now, rm dup

* Make FileVaultSecret.read_file() -> _read_file()

_read_file() is details of the implementation of
load(), so now 'private'.
2017-08-08 16:10:03 -04:00
schwatvogel
b8d371ca8b Fixes #23558 rpm key ids (#27847)
* Changed rpm-keyid extraction and verification method
* minor style fixes
* fixed rpm key deletion,added integration test for mono key,fixed wording in integration tests
2017-08-08 11:56:03 -07:00
Ricardo Carrillo Cruz
d1d0cd5406 Add delay and check configuration when interfaces is set on eos_vrf (#27884)
* Add delay and check configuration is right when interfaces is set on eos_vrf

Per the spec we put up for declarative intent modules, we need to check declarative
intent params (in the case of eos_vrf it's 'interfaces') after a delay and non-declarative
params have been set.
If that doesn't meet desired state after delay, we fail the task.

* Check declarative intent param only if config changed

* Fix pep8 issue

* Change default of delay param to 10

* Revert bogus change on eos_vlan
2017-08-08 20:23:45 +02:00
Will Thames
dbf9a65c05 Improve error messages when MySQLdb is not installed (#27871)
The python package is called MySQL-python in pypi, and
reporting this rather than mysqldb makes resolving the
problem far easier.
2017-08-08 12:59:51 -04:00
saichint
babec35faa Fix nxos_vtp_password and nxos_vrf_interface for remove idempotency tests (#27724)
* fixes for 27600 27676

* add sanity tests
2017-08-08 12:40:22 -04:00
Sloane Hertel
bd4f08823d [cloud] Cleanup of elasticache argspec (#27890)
Remove unnecessary specifications from the argument spec and use dict() instead of brackets for module uniformity.
2017-08-08 12:18:02 -04:00
Peter Sprygada
0b67ef4232 fixes #27527 (#27868) 2017-08-08 10:12:02 -06:00
Andreas Olsson
ccc68f7157 Don't do additional path expand in file module
Since the module's path parameter is of the AnsibleModule type path
it's already being expanded. Hence no need to have the
set_fs_attributes_if_different method do its own expand.

This additional expand is an actual problem when the file module runs
recursively, as real existing file names can be mistakenly expanded to
something completely wrong and non-existing.

Fixes #25005
Fixes #25639
2017-08-08 09:05:06 -07:00
Abhijeet Kasurde
47ccb66ae3 Add support to add multiple NICs in vSwitch (#25857)
Add support for adding multiple NICs in VMWare vSwitch.
Also, updated documetation with example.

Fixes: #23522

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-08 11:41:57 -04:00
giovannisciortino
1fb1793c70 helpers.py: Fixes #27334 include empty task file within a 'block' dis… (#27811)
* helpers.py: Fixes #27334 include empty task file within a 'block' disables the complete block

* include module: added warning if file without tasks is included
2017-08-08 09:48:39 -04:00
mzizzi
4648dc9702 [cloud] Add more configurable backoff implementations to CloudRetry/AWSRetry (#27251) 2017-08-08 08:56:46 -04:00
Moritz Grimm
11af034255 moved aws elasticache module to boto3 (#27441)
* moved aws elasticache module to boto3

* fixed error and improved code

* implemented requested changes

* now checking for missing boto3 packages in a better way

* now dynamically setting the default port depending on the engine if it is not set

* moved standard import in front of ansible ones

* now case insensitive in regards to engine name

* removed superfluous spaces

* now checking for None in the correct way

* removed elasticache module from exceptions to pep8 testing

* removed hardcoded default ports and letting aws decide if no port is given
2017-08-08 08:39:09 -04:00
Willem van Ketwich
6d402de25e ec2 launch configuration boto3 upgrade (#26348)
Updates ec2_lc module to use boto3. Adds parameters:

instance_id
placement_tenancy

Also added a second example using instance_id and updated the docs with the new parameters.
2017-08-08 22:11:06 +10:00
Ganesh Nalawade
12e81e68fc remoe duplicate net_lldp_interface (#27880) 2017-08-08 14:50:54 +05:30
Rob Nieuwenhuizen
73e19c2ed1 Add support for pip list format=columns (#21990)
* Use 'pip list --format=freeze' to simplify output code parse
2017-08-07 23:56:04 -07:00
Ganesh Nalawade
49eb81d573 junos_linkagg aggregate and other minor fixes (#27855)
* junos_linkagg aggregate and other minor fixes

* Minor change
2017-08-08 12:13:28 +05:30
Toshio Kuratomi
43f6a97bdc Fix security documentation to note it only works in conjunction with state=latest 2017-08-07 23:11:55 -07:00
Abhijeet Kasurde
d3fe598202 [WIP] Add security option in yum module
Fix adds option to specify security updates in yum module

Fixes #11498

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-07 23:05:00 -07:00
Toshio Kuratomi
0aa7c06395 Remove comments about import order
No longer needed as AnsiballZ fixed this
2017-08-07 19:46:06 -07:00
Toshio Kuratomi
2fc7c14dca Reclisence module_utils/api.py to BSD
Permission from all contributors to the file was granted here:
https://github.com/ansible/ansible/issues/27599

Fixes #27599
2017-08-07 19:46:06 -07:00
Toshio Kuratomi
8894c57753 Fix rabbitmq modules for python3 import
Also get rid of unnecessary capture of exception into a variable for
python-2.4 compat.
2017-08-07 19:42:39 -07:00
rahushen
441376c754 Fix #26024: suppress_fib_pending imdepotence for nxos_bgp (#27862) 2017-08-07 21:08:46 -04:00
Brian Coca
e4a997c97e removed debug print
fixes #27864
2017-08-07 20:44:35 -04:00
Juan Manuel Parrilla
5df4ff8983 Fixes #25057, Added Hiera Lookup (#25060) 2017-08-07 12:59:39 -06:00
Arthur Kepler
d828449611 Corrects default arg format used by datetime filter (#27612)
This ensures the default datetime format matches that of
datetime.datetime. Docs updated to match as well.
2017-08-07 11:33:25 -07:00
Mike Wiebe
65cf31e1ce Fix nxos_interface_ospf idempotence issue (#27783)
* Add tests and fix 27167

* Add modify test
2017-08-07 13:54:31 -04:00
Tyler
2571fc061e Add try/except to catch ipv6 interfaces that didn't appear on 'show interfaces' output (#27246) 2017-08-07 19:04:50 +02:00