Commit Graph

17697 Commits (f5f2a2fac2b251ead20192cc46c719b33ee4bbad)

Author SHA1 Message Date
Pierre-Louis Bonicoli dbc422ea1c Fix 'module' object is not callable 7 years ago
Pierre-Louis Bonicoli f9404b0d85 Fix exit_json usage: really call client.auth.logout 7 years ago
Pierre-Louis Bonicoli b556def4d3 Update DOCUMENTATION metadata 7 years ago
Pierre-Louis Bonicoli ac05645bce Remove commented statements 7 years ago
Pierre-Louis Bonicoli f761fc1d1f rhn_channel: fix py3 compatibility (use six)
and remove unused import
7 years ago
Pierre-Louis Bonicoli 5f62a973da docker_secret: fix broken import 7 years ago
Pilou feff6abd72 os_client_config: fix broken import (#26839)
* os_client_config: fix broken import
* remove wildcards and add boilerplate
7 years ago
Nick Ward f52a022022 Python3 compatability for elb_application_lb and elb_target_group 7 years ago
Toshio Kuratomi 9a7e23569e Fix wildcard imports, remove get_exception, add boilerplate
Amazon modules that don't have open PRs against them
7 years ago
Toshio Kuratomi 7cd81b802d Fix wildcard imports, remove get_exception, add boilerplate
Fixed for monitoring modules
7 years ago
Sloane Hertel aca1950150 iam certificate facts (duplicate): add iam_cert_facts as alias for iam_server_certificate_facts (#25387)
* add iam_cert_facts as alias for iam_server_certificate_facts
* remove from legacy files
7 years ago
Artem Zinenko 6058cb736d rabbitmq_plugin for Windows (#28017)
* Fixes #28016: rabbitmq_plugin for Windows

* Disable documentation check for rabbitmq_plugin.ps1

* Renamed rabbitmq_plugin -> win_rabbitmq_plugin

* Fixed the documentation after review

* Fixed 'RETURN' section

* Fixed docs for original module

* Added dots to original module docs.
7 years ago
Toshio Kuratomi ac56a2f138 Remove wildcard imports and get_exception calls
Fixed module_utils
7 years ago
T. Miller 93e1caccb7 ini_file: Match tabs before options (#28102) 7 years ago
Peter Sprygada 5ee7862793 update telnet module (#28100)
* accepts list of prompts to expect
* updates doc strings
7 years ago
Brian Coca 40d29936a4 telnet action plugin (#27983)
* draft telnet action plugin

docs in module

* updated per feedback

* fixed imports

* pep8 fixes

* added meta import even though its useless
7 years ago
Toshio Kuratomi 039383d90f Fix symbolic mode usage in unarchive with zip files
Fixes #21090
7 years ago
Toshio Kuratomi a3132e5dd6 Optimize template (#28044)
* Optimize template

* In fixing template to handle diff correctly #24477, I introduced more
  round trips to the remote end which slowed things down  The new code now
  uses one fewer round trips than the old code.
* Reimplement a large part of template by calling the copy action plugin
  instead of doing it in template's code.  This reduces the code in
  template and gives us one place to fix bugs and optimize.
* Add a follow parameter to template that mirrors the follow parameters
  for file and copy.
* Fix copy's diff handling (probably broken in my rewrite for in 2.4
  development)
* Adjusted when copy creates tmp dirs to rduce round trips in copy and
  template.

Fixes #27956
7 years ago
Jacob McGill 8b92369678 Update aci_tenant to support check_mode (#28090) 7 years ago
Jacob McGill c04349088e update aci module util with methods to support check_mode and idempotency (#28089) 7 years ago
Jason Lingohr 3d29f79e74 Documentation fixes. (#28047)
* Documentation fixes.

* Update win_route.py
7 years ago
chriskarel 991918e9d2 Fix idempotency for Unix permissions in zip files. (#24580)
* Fix idempotency for Unix permissions in zip files.

This fix prevents the unarchive module from reporting 'changed' when a zipfile contains items with Unix permissions that differ from the system default.

* Update zip unarchive tests.

Additional tests for the unarchive module with zip files:
- Test file in zip archive with non-default permissions
- Test file added to zip archive with Windows permissions

* Additional fix for mixed win/unix archives.

  Turns out my original fix fails under some mixed archives, as setting the umask to zero can be applied to those files.  This creates a per-file umask variable, so a mix of permission types don't cause problems.

* CI Checks

CI checks for archives with:
* non default Unix permissions
* Windows permissions


* Workaround for BSD differences.

Using Zipinfo due to lack of support in BSD unzip.
Permissions handling is also different in BSD -- always applies UMASK to file permissions.

* Added checks for creating directories and SSH keys for existing users.
7 years ago
Sloane Hertel 3cb1c38ecc [cloud] Allow S3 module to correctly delete objects by groups of <= 1000 (#28068) 7 years ago
Brian Coca d89dd75769 validate include_role args (#28077)
* validate include_role args

* nicer error msg

* removed unused static

* updated as per feedback

* pepe ATE
7 years ago
Jacob McGill 21dbde0abe fix issue with trailing white space when logging into asa (#28073) 7 years ago
Trishna Guha aef4e3d8fa fix nxos_snapshot (#27993)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Peter Sprygada 17a259a163 fixes command to be sent over nxapi for nxos_file_copy (#28029)
fixes #27347
7 years ago
Patrick Ogenstad 089226e372 Fixes for broken asa_config module (#27218)
* Fixes for broken asa_config module

* strip() prompt before checking
7 years ago
Sloane Hertel 40eb349ac6 [cloud] Make ec2_asg more resilient using AWSRetry around boto3 calls (#27598)
* Add AWSRetry to ec2_asg

* Paginate describing ASGs and launch configurations

pass connection to delete_asg

Fix a couple little bugs

* Use boto3's pagination build_full_result()
7 years ago
Thomas Stringer e4cd899363 Add support for Azure 2.0.0 (#27920)
* Adapt azure_rm_resource_group to azure 2.0.0 + azure Cli support

* Fix exceptions in Azure ARM plugins

* update azure_rm_networkinterface documention to reflect required params

* change state param to not required for docs in azure_rm_subnet

* fix import to reflect azure==2.0.0 changes

* add aliases and fix docs for azure_rm_storageblob

* add resource_group_name alias to azure_rm_storageaccount_facts

* fix import bug due to change in azure==2.0.0

* fix args bug and enum modules issue

* update docs to reflect azure==2.0.0

* pin management clients to a specific api_version

* update docs to reflect the new azure-ansible-base python package

* add fallback for older api resource group listing

* rework azure dependencies installation

* refactor path joining to a cross-plat solution
7 years ago
Michael Price 1b9d9376e2 Refactor E-Series Hosts module to use module_utils (#20893)
Refactor the NetApp E-Series module to utlize the common module_utils
and doc_fragments.
7 years ago
Brandon Schlueter 0e334ca821 Don't compare group_vars paths with bytestrings (#27922)
* Don't compare group_vars paths with bytestrings

* Compare spath with unicode string in VarsModule
7 years ago
Nathaniel Case 0464a21a85 Fix nxos_snmp_contact, others (#28000)
* Fix nxos_snmp_contact

Fixes #27714

* Fix nxos_snmp_community

Fixes #27711

* Fix nxos_install_os

Fixes #27604

* Update nxos_ntp_auth

Fixes #27521

* Fix nxos_igmp_snooping

Fixes #27501
7 years ago
Sloane Hertel 1de91a9aa0 [cloud] Convert `s3` module to use boto3 (#21529)
* replace boto with boto3 for the s3 module

make s3 pep8 and remove from legacy files

fix s3 unit tests

* fix indentation

* s3 module - if we can't create an MD5 sum return None and always upload file

* remove Location.DEFAULT which isn't used in boto3 and tidy up the docs

* pep8

* s3: remove default: null, empty aliases, and required: false from documentation

fix incorrectly documented defaults

* Porting s3 to boto3. Simplify some logic and remove unused imports

* Fix s3 module variables

* Fix a typo in s3 module and remove from pep8 legacy files

* s3: add pagination for listing objects.

Fix logic and use head_object instead of get_object for efficiency.

Fix typo in unit test.

* Fix pagination to maintain backwards compatibility.

Fix incorrect conditional.

Remove redundant variable assignment.

Fix s3 list_object pagination to return all pages

* Use the revised List Objects API as recommended.

* Wrap call to paginated_list in a try/except

Also remembered to allow marker/prefix/max_keys to modify what keys are listed

* Simplify argument
7 years ago
Michele Zuccala 7d1308b0d8 [cloud] ovirt: add headers param to auth (#27881)
* Add filter param to ovirt module auth

* Update docs to include new filter param

* Fix broken YAML

* Replace filter param with headers
7 years ago
giovannisciortino 49209bfcc5 blockinfile: add --diff support in check mode (#27997) 7 years ago
Rich Murphey 88ccaf106b use of multiple chocolatey package names (#28046)
* use of multiple chocolatey package names

It might be helpful to users, to clarify whether/when <name:> must specify a single package.

Users who are familiar with chocolatey may be accustomed to installing multiple packages in a single invocation of 'choco install'.

I believe win_chocolatey currently accepts multiple package names when state: is latest or present.
For instance, this appears to work currently:

  - win_chocolatey:
      name: >-
        pscx
        windirstat
      state: latest

However, when state: is absent, uninstall is not performed if multiple package are specified.
The chocolate.log output suggests that chocolatey is treating the multiple packages as an 'exact' name of a single package name:
2017-08-10 19:04:04,087 2424 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" list --local-only --exact pscx windirstat
2017-08-10 19:04:04,087 2424 [DEBUG] - Received arguments: list --local-only --exact pscx windirstat

I find the current behavior helpful in terms of accepting multiple package names, even if uninstall must be treated differently.
It might be helpful to show an example of how multiple uninstalls can be handled by looping over them. 

  - win_chocolatey:
      name: "{{ item }}"
      state: absent
    with_items:
      - pscx
      - windirstat

* revise per Jordan Borean. remote colon (:) from text. revise formating.

* Update win_chocolatey.py
7 years ago
Nathan Hyde 241d38077f Use ChocolateyInstall env variable after installation (#27812)
* Use ChocolateyInstall env variable after installation

Fixes #19725 Custom install locations specified by the ChocolateyInstall
env variable in win_chocolatey

After an initial install of chocolatey, use the ChocolateyInstall
environment variable when assigning $script:executable .

* Improve process of locating "choco.exe" post-initial install

Implement feedback for locating choco:

* Check if choco.exe is in PATH, if there use this
* If not in path and ChocolateyInstall var is available, use that
* Otherwise, use the equivalent of Windows Special Folder CommonApplicationData for locating chocolatey.
  (Chocolatey install (v0.10.7) uses CommonApplicationData when ChocolateyInstall is not set.)
7 years ago
Dave 4cec83471c win_get_url.ps1 - enable TLS1.1/TLS1.2 if they're available but disabled (#26833) 7 years ago
Nick Chandler 22533c0932 New module: Add module or managing Windows Active Directory users (windows/win_domain_user) (#24075)
* Initial win_domain_user module support

* Add return information

* Update return values

* Add try/catch for PS module import

* Improve win_domain_user module

* Fix bad merge

* Fix pep8 failure

* Actually fix pep8 failure

* Update win_domain_user.py to meet standards

* Add check_mode support for win_domain_user

* Updated documentation before merge
7 years ago
Peter Sprygada edc3507c98 restore the ability to issue commands over junos cli (#28025)
* restore the ability to issue commands over junos cli

* add warn message for invalid arguments

* fix issue when checking if provider transport is set
7 years ago
Jordan Borean 5fbbf0e75a win_hotfix: new module to install Windows hotfixes (#27260)
* win_hotfix: new module to install Windows hotfixes

* revert to older module util loader style to satisfy the checks for now

* Changes from PR

* changed the test hotfix so we can run tests in shippable
7 years ago
Jordan Borean 44ed891290 win_mapped_drive: new module (#27020)
* win_mapped_drive: new module

* Rebased from upstream and updated copyright text
7 years ago
Jordan Borean e46adece48 win_user_right: add module with tests (#26276)
* win_user_right: add module with tests

* fixed up name of module in docs

* forgot the test module

* fixed up whitespace

* changes made to win_user_right based on feedback

* moved away from using secedit to Win32 with P/Invoke

* tidied up copyright for documentation
7 years ago
Ganesh Nalawade 3b0e9ded91 Fix fallback and boolean check in argspec (#27994)
Fixes #27978

*  Add missing assignment for param key in fallback handling
*  Add check for frozenset type
*  Unit testcase
7 years ago
Philip Gough fee42a01d9 Redhat subscription proxy support (#22544) 7 years ago
David Newswanger d0485779e8 nxos_smu: fix Structured output unsupported error in nxapi (#27976)
* fixed structured output unsupported error
7 years ago
Ricardo Carrillo Cruz e8f1c1511c Implement purge on eos_vrf (#28013) 7 years ago
Martin Krizek 1c4e491eac yum: do not hide yum's errors (#27696) 7 years ago
Rémi REY 7974ad34f1 add playbook runtime stat in the logstash callback stats (#25785) 7 years ago
Raphael Nestler ac0202fba1 win_file: Remove 'Create a file' example (#28009)
Fixes #28005
7 years ago
Peter Sprygada 145895dcf0 updates examples and documentation (#24211)
includes better examples of valid and invalid usage of the lines
argument

fixes #22828
7 years ago
Peter Sprygada d8b005ec65 updates the prompt regexp for prompt handling in sros (#28015)
* thanks to @jurajama for tracking this down and providing the fix
* fixes #24192
7 years ago
Brian Coca 2015835759 updated author with github id 7 years ago
Dag Wieers 8451d945aa Add new maintainer 7 years ago
Luke Armstrong fd18ade465 Documentation - modules/files/unarchive (#27998)
Last example is incorrect and will not run without throwing an error.
7 years ago
Juan Manuel Parrilla 2cfb30fc91 Fixes #24414, Added support for a ETCD folders (#24432) 7 years ago
Adrian Likins 220db9cdd2 Better vault pass prompt behav on EOF, more unit tests (#27981) 7 years ago
Adrian Likins 82f550e8cd Add prompt formats for 2.3 compat ask-vault-pass (#27974)
The prompt_formats dict didn't get the 'prompt_ask_vault_pass'
item added for interactive --ask-vault-pass, which
caused "KeyError: u'prompt_ask_vault_pass'"

Fixes #27885
7 years ago
Valentin Krasontovitsch cfff72e9db Use apt-get as fallback for apt upgrade
In answer to #2540, `aptitude` was introduced as tool of choice for running
upgrades in the apt module and installing new packages that arise as
dependencies during upgrades.

This recently lead to problems, as for example Ubuntu Xenial (16.04) ships
without aptitude (installed).

Studying the man pages of both apt-get and aptitude, it appears that we can
achieve the effects of `aptitude safe-upgrade` using

```
apt-get upgrade --with-new-pkgs --autoremove
```

while `aptitude full-upgrade` seems to be identical to `apt-get dist-upgrade`.

We use `apt-get` as described above as a fall-back in case that `aptitude`
cannot be found, issuing a warning when it does so.

Furthermore it introduces a flag `force_apt_get` which may be used to enforce
usage of apt-get (which does not issue a warning).

The integration tests are updated accordingly.

Cf. also the discussion in #27370.

Fixes #18987
7 years ago
Brian Coca 13d2eb6568 fix incorrect joingin of command for chpasswd
fixes #24638
7 years ago
Peter Sprygada c4da61239d stops trying to filter out commands from config (#28002)
* stops trying to filter out commands from config

fixes #24874

* fix up pep8 issues and remove offending function
7 years ago
Nathaniel Case ed8a5af3dc nxos_bgp: Fix idempotence for event-history (#27329)
* Fix idempotence for event-history

* `event-history detail` defaults to `False`, the rest to `size_small`
7 years ago
Lukas Bednar 29891bff19 ovirt_templates: fixed typo in doc (#27883) 7 years ago
Lukas Bednar a48a7eecc8 ovirt_templates: added option to name imported disk as a template (#27902)
* ovirt_templates: added option to name imported disk as a template

* ovirt_templates: added version_added to new attribute

* ovirt_templates: added alias for image_name and example

* added alias glance_image_disk_name for image_name
* example how to import image from glance as template
* improve description of template_image_disk_name
7 years ago
Abhijeet Kasurde f7321a87ca Pep8 fixes for rabbitmq modules (#24590)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Ricardo Carrillo Cruz 7e2169f6d5 Add aggregate functionality to eos_vrf (#27915)
* Add aggregate functionality to eos_vrf

* Add tests for eos_vrf aggregate option

* Remove test2 and test3 vrfs at the beginning of the eos_vrf tests

* Pull all vrfs

With aggregate, we need to get all VRFs and we then compare with
desired VRFs, instead of assuming it will be just one.
7 years ago
Dag Wieers eee09565b1 utilities modules: PEP8 compliancy (#27741) 7 years ago
Simon Dodsley f30589c91d purefa_volume: Fix typo in required_if (#27921) 7 years ago
Marc Sensenich 38d026b1db New Module: Notification module for Office 365 Connector Cards (#27636)
* New Module: Notification module for Office 365 Connector Cards (notification/office_365_connector_card)

* Updates per review

* Added connection check when in check mode
7 years ago
Philippe Dellaert 920cd7bb1c New module: Waiting for VMware tools to become available (#27236)
* Adding VMware tools module
Functionality: Waits for VMware tools to become available (running
state)

* Adding base integration test preparations
Until govcsim supports actual guest tool status, the tests are disabled

* Cleanup and better getvm method

* Updating Changelog

* Adding required metaclass and future import

* Rename to vmware_guest_tools_wait

* Cleanup of documentation

* Fixing review remarks
7 years ago
giovannisciortino 064c3b837f Fixes #27836: get_url check if directory exists (#27852) 7 years ago
Dag Wieers 6bfedc9fe5 Various fixes (#27889)
This PR includes:
- Removal of get_exception (sadly)
- Avoid deprecating 'state' parameter with aci_rest
- Small fix for querying using aci_rest

Signed-off-by: @bcoca
7 years ago
mzizzi 380c43de4e cloudformation_facts: describe all stacks by default
* cloudformation_facts describe all stacks by default

* cloudformation_facts jittered backoff / retries

* cloudformation_facts stack_name use default arg_spec

* cloudformation_facts bugfix broken notification_arns output

* cloudformation_facts add simplified "stack_tags" output

* CloudFormationServiceManager.describe_stacks default args
7 years ago
Zac Medico 501fc7a248 template: fix KeyError: 'undefined variable: 0 (#27972)
* template: fix KeyError: 'undefined variable: 0

For compatibility with the Context.get_all() implementation
in jinja 2.9, make AnsibleJ2Vars implement collections.Mapping.
Also, make AnsibleJ2Template.newcontext() handle dict type
for the 'vars' parameter.

See: d67f0fd4cc
Fixes: https://github.com/ansible/ansible/issues/20494

* add units/template/test_vars

* intg tests for jinja-2.9 issues like 20494

test cases here are based on
https://github.com/ansible/ansible/issues/20494#issue-202108318
7 years ago
James Hogarth 7ec34b4cb2 ISSUE 25470 - update patch from review details 7 years ago
James fc274bda8a ISSUE 25470 - junit report failure on changes
This commit provides an environment option to change the behaviour so
that it's possible to declare any changes shoudl be considered a junit
failure.

This is useful when carrying out idempotent testing to ensure that
multiple runs are safe and any changes should be considered a test
failure.

In a CI test of an ansible role the practice would be to run the role
once without this to configure the test system, and tehn to run a second
time including this environment vairable so that the CI engine
processing the junit report recognise any changes to be a test fail.
7 years ago
David Moreau-Simard b35c749268 Add a sensu_client module
This provides a sensu_client module in order to be able to dynamically
configure a Sensu client.

It takes a different approach than the existing Sensu modules such as
sensu_check but is hopefully a much more flexible and simple way of
handling configurations.
7 years ago
David Moreau-Simard 7a56e5d45d Add sensu_handler Ansible module
This provides a sensu_handler module in order to be able to dynamically
configure a Sensu handler.
7 years ago
Kamil Cholewiński b5414088a3 Add ConfigMap support to kubernetes module (#21014) 7 years ago
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
7 years ago
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
7 years ago
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.
7 years ago
Lucas Melchior 756b510414 fixed formatting for maven_artifact synopsis 7 years ago
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.
7 years ago
QijunPan 9e3ae8a0cb Delete unused module_utils/cloudengine.py (#25054)
* Delete unused cloudengine.py
rename cloudengine to ce.

* remove unused cloudengine.py
7 years ago
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
7 years ago
saichint 14186af558 Fix for nxos_ospf idempotent issue (#27913) 7 years ago
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.
7 years ago
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.
7 years ago
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
7 years ago
Anil Kumar Muraleedharan 52a8ed55ee Update cnos.py to remove unused method checkServerForImage (#27767) 7 years ago
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.
7 years ago
Nathaniel Case 01dda25e0f fix nxapi transport in nxos_snmp_location (#27849)
* fix nxapi transport in nxos_snmp_location

* Appease Shippable
7 years ago
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
7 years ago
Dag Wieers 2af759e9f9 vmware_vm_facts: Improve example and docs (#27898)
This fixes ansible/ansible-modules-extras#2475
7 years ago
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
7 years ago
s-hertel 875c8e4f3e ensure stickiness expiration is an int before comparison 7 years ago
Ganesh Nalawade 1f7e04d958 Fix junos_lldp integration test failure (#27936) 7 years ago
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
7 years ago
CyberArk BizDev 923445a484 CyberArk User Management (#27519)
* Initial submit for CyberArk User management module
7 years ago
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.
7 years ago
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'.
7 years ago
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
7 years ago
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
7 years ago
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.
7 years ago
saichint babec35faa Fix nxos_vtp_password and nxos_vrf_interface for remove idempotency tests (#27724)
* fixes for 27600 27676

* add sanity tests
7 years ago
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.
7 years ago
Peter Sprygada 0b67ef4232 fixes #27527 (#27868) 7 years ago
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
7 years ago
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>
7 years ago
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
7 years ago
mzizzi 4648dc9702 [cloud] Add more configurable backoff implementations to CloudRetry/AWSRetry (#27251) 7 years ago
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
7 years ago
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.
7 years ago
Ganesh Nalawade 12e81e68fc remoe duplicate net_lldp_interface (#27880) 7 years ago
Rob Nieuwenhuizen 73e19c2ed1 Add support for pip list format=columns (#21990)
* Use 'pip list --format=freeze' to simplify output code parse
7 years ago
Ganesh Nalawade 49eb81d573 junos_linkagg aggregate and other minor fixes (#27855)
* junos_linkagg aggregate and other minor fixes

* Minor change
7 years ago
Toshio Kuratomi 43f6a97bdc Fix security documentation to note it only works in conjunction with state=latest 7 years ago
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>
7 years ago
Toshio Kuratomi 0aa7c06395 Remove comments about import order
No longer needed as AnsiballZ fixed this
7 years ago
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
7 years ago
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.
7 years ago
rahushen 441376c754 Fix #26024: suppress_fib_pending imdepotence for nxos_bgp (#27862) 7 years ago
Brian Coca e4a997c97e removed debug print
fixes #27864
7 years ago
Juan Manuel Parrilla 5df4ff8983 Fixes #25057, Added Hiera Lookup (#25060) 7 years ago
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.
7 years ago
Mike Wiebe 65cf31e1ce Fix nxos_interface_ospf idempotence issue (#27783)
* Add tests and fix 27167

* Add modify test
7 years ago
Tyler 2571fc061e Add try/except to catch ipv6 interfaces that didn't appear on 'show interfaces' output (#27246) 7 years ago
Flavio Percoco Premoli 4fad156768 Allow for generating kubernetes YAML files from modules (#27833)
* Return the request dictionary in the results

It's sometimes useful to have access to the request params in a k8s
style. The dictionary returned by the request_params call can be
serialized into YAML to produce a k8s like file.

* Add dry_run option to skip module execution

By having support for dry_run executions, it'll be possible to generate
YAML files from the results dictionary by using the data in the
`requests` key.
7 years ago
Dag Wieers 3a86579b69 vcenter_license: New module to manage vCenter licenses (#25143)
This module supports check-mode and diff output.
It also includes basic integration tests.

This PR fixes #24971
7 years ago
Dag Wieers 71163d4d61 vmware_cluster: PEP8, imports, cosmetics (#25140)
This PR includes:
- Documentation improvements (mostly related to boolean defaults)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
7 years ago
Zhangfei Gao ce4ada93f9 facts: fix arm64 ansible_processor_vcpus = 0
On arm64, /proc/cpuinfo has no 'model name', 'Processor', 'vendor_id', 'cpu', 'Vendor',
as a resul "ansible_processor_count": 0 & "ansible_processor_vcpus": 0
Add checking element "processor" to fix the issue.

$ ansible -i ~/all-in-one  -m setup all | grep proc
	"ansible_processor": [],
	"ansible_processor_cores": 1,
	"ansible_processor_count": 0,
	"ansible_processor_threads_per_core": 1,
	"ansible_processor_vcpus": 0,

$ cat /proc/cpuinfo
processor	: 0
BogoMIPS	: 100.00
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x1
CPU part	: 0xd07
CPU revision	: 1

$ ansible --version
ansible 2.3.1.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.9 (default, Aug 13 2016, 16:27:01) [GCC 4.9.2]

With fix, checking processor as well:
$ ansible -i ~/all-in-one  -m setup all | grep proc
	"ansible_processor": [
	"ansible_processor_cores": 1,
	"ansible_processor_count": 16,
	"ansible_processor_threads_per_core": 1,
	"ansible_processor_vcpus": 16,

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
7 years ago
Ben Waters be5e2251a7 Fixes #21536: Allowing the ability to pass aws session paramters to credstash lookup (#23077)
* Allowing the ability to pass aws session paramters to credstash lookup
Fixes #21536
https://github.com/ansible/ansible/issues/21536

* Default environment variable lookup

To get around non lookup of environment variables. First, check for environment variables, then look for parameters

* Following AWS Precedence

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#config-settings-and-precedence
7 years ago
James Mighion bdccc2df3c Keep the diff even when running in check mode so we can tell if there is a diff or changed is true. (#27713) 7 years ago
Michael Price 8f4b13de73 Refactor E-Series VolumeCopy to use module_utils (#20902)
Refactor the NetApp E-Series module to utlize the common module_utils
and doc_fragments.
7 years ago
Nathaniel Case b9e80b6117 nxos_vrf_interface cleanup (#27642)
* Update RETURN, results, & execute_show_command
7 years ago
Dag Wieers ca7ce4459d aci.py: Add use_proxy support (#27735)
This PR includes:
- Support for the use_proxy parameter
- Additional notes related to proxy support and use_proxy parameter
7 years ago
Patrick Marques f1816bb438 Update module digital_ocean_sshkey (#18930)
* add new module do_sshkeys

* Deprecate digital_ocean_sshkey.py in favor of do_sshkeys

* Should not exit changed if name not set and key exist

* Add ansible metadata

* Return "ansible_facts" instead of "data" key

* Update documentation and remove unused import

* Remove facts module (1 module / PR)

* Fix

* Fix

* fix version_added

* Change old module status to deprecated

* Change old module status to deprecated

* Fix module deprecation

* Add support for new DO_OAUTH_TOKEN env var

* Fix python 2.6 positional index

* Update deprecation info

* Configure timeout and validate_certs for fetch_url

* rename do_sshkeys to digital_ocean_sshkeys

* Module is replaced, not deprecated anymore

* Fix module name

* Add version to new parameters

* Update module from boilerplate
7 years ago
colin-hanson-zocdoc ac15df8ab9 [cloud] Extend AWSRetry to also retry on `Throttling` exceptions (#22698)
We use ansible+cloudformation pretty heavily in our CI environments and occasionally bump into throttling issues.  By adding this error code to the retry system we should be able to achieve better stability.
7 years ago
Will Thames 2276c5f206 apt: Update cache if cache_valid_time is set (#27618)
It's not clear from the docs whether you need to set `update_cache`
when using `cache_valid_time`.

Setting `cache_valid_time` should imply `update_cache`. Update docs
to reflect this.
7 years ago
Nicolas Porcel fa6ce54011 Fix yum with rpm file or url when state=latest (#27775) 7 years ago
Slezhuk Yevgeniy 54035d5c59 Fix documentation issue in jira module (#27820) (#27823)
Fixes #27820
7 years ago
Nicolas Porcel 616d5ddc93 Clean downloaded rpm files after install (#20594) 7 years ago
Markus Krogemann d2f9160bc1 Fix documentation of name field in return values (#27822) 7 years ago
Jordan Borean 107e177658 win_stat: add explicit error message when file is in use (#27826)
* win_stat: add explicit error message when file is in use

* make the lock last a bit longer
7 years ago
Ricardo Carrillo Cruz b51a1e9045 Fix junos_netconf idempotency issues (#27804)
* Fix junos_netconf idempotency issues

* Fix pep8 issue

* Fix pep8 issue
7 years ago
René Moser fdaa803cca cloudstack: cs_vmsnapshot: fix pep8 (#27792) 7 years ago
René Moser f1ef61da4e cloudstack: cs_domain: tests: add update tests (#27791) 7 years ago
Trishna Guha edb5760723 nxos_vpc doc update to handle confirmation prompt (#27796)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Sam Doran cb7b44f9e4 Remove _diff from play_context default
Follow up from PR #27746
7 years ago
Dag Wieers 25e67d804c iso_extract: Reimplement using 7zip (not requiring root) (#24937)
* Reimplement iso_extract using 7zip (not requiring root)

So one of the drawbacks of the original implementation is that it required root for mounting/unmount the ISO image.
This is now no longer needed as we use 7zip for extracting files from the ISO.

* Fall back to using mount/umount if 7zip not found

As discussed with others.

Also improved integration tests.
7 years ago
James Cammarata e0b0e61b32 Properly copy the role path when the IncludeRole object is copied
This exposed some additional errors in logic in IncludeFile, which
had to be fixed to deal with the fact that the role path (unlike paths
from includes) are always absolute paths.

Fixes #27345
7 years ago
Jacky Hu c770d657f3 Enable url lookup without a proxy
By introducing a use_proxy parameter to url lookup, the usage of proxy
is totally controllable.

(cherry picked from commit 11e4e51235)
from #23811
7 years ago
Benjamin 8fc113219c Enhance maven_artifact with a keep_name option (#22339)
It allows retaining the version number in the downloaded artifact's name when the version to be downloaded is dynamically determined ('latest').

So far, the behavior was to overwrite the version string in the artifact name with 'latest' which leaves no trace of what version the downloaded artifact has. E.g., you cannot use this information for further processing like transferring it to an RPM that is built from the artifact.

This fulfills feature request ansible/ansible#22337
7 years ago
Jérôme Guilbot e29daf34f7 [s3_sync] Add cache_control option (#27388) 7 years ago
David Barroso 0f60041dea Handle better the many ways information can be passed around (#27506)
* Handle better the many ways information can be passed around

* Fixing pep8 complaints

* Removing message
7 years ago
Dag Wieers a98e3fb81f Add RETURN information, doc improvements and PEP8
This PR includes:
- RETURN information (since the difference between status_code and
  status was confusing)
- Improvements to parameter definition (and docs)
- PEP8 compliancy
7 years ago
10sr 000f8dcc8f Fix bug that diff.always = yes in ansible.cfg won't be respected (#27746) 7 years ago
Keith Hawkridge f62fa16a89 [cloud] Fix Dead Letter config property name (#27733)
Closes #27688
7 years ago
Pilou b57af4428d rhn_register: fix broken imports, add unit tests (#26878)
Fix 'module' object is not callable

* rhn_register: fix Python 3 compatibility
* rhn_register: update requirements
* rhn_register: add unit tests
* Add missing method name
* use a dedicated line for XML related requirements
* rhn_register: drop support for Python 2.4
* rhn_register unit tests: fix Python 3 compatibility
* refactor in order to check order of the requests
7 years ago
Dag Wieers 0342760f5b sefcontext: PEP8 compliancy (#27742) 7 years ago
Philippe Dellaert 6d33e59ca1 Fix for subspec options validation issue #27715 (#27728)
* Fix for issue ansible/ansible#27715

* Also fixing mutually exclusive check

* Updating subspec checks
These changes take into account a spec with all features enabled and do
the following tests for subspecs:
1. Test proper specs
2. Test Alias
3. Test missing required param
4. Test mutually exclusive params
5. Test required if params
6. Test required one of params
7. Test required together params
8. Test required if params with a default value
9. Test basis subspec params
10. Test invalid subsec params
7 years ago
Toshio Kuratomi 3f12fccd02 Fix several things causing tracebacks with unicode cwd (#27731)
Fixes #27511
7 years ago
Sloane Hertel de5f8f1ec4 [cloud] allow module_utils to get creds without boto installed (#27647)
Would try to grab creds from `boto.config` and lead to a NameError in some cases.
7 years ago
René Moser 5700b09610 cloudstack: new module cs_instance_nic_secondaryip, replaces cs_nic (#26491) 7 years ago
Peter Sprygada 7b604368d3 adds new filter plugins for network use cases (#27695)
* adds new filter plugins for network use cases

* adds parse_cli filter
* adds parse_cli_textfsm filter
* adds Template class to network_common
* adds conditional function to network_common

* fix up PEP8 issues
7 years ago
Dag Wieers a34ef12d73 hpilo modules: PEP8 fixes (#27739) 7 years ago
Ganesh Nalawade d3e5d30f7c Add aggregate for junos modules and sub spec validation (#27726)
* Add aggregate for junos modules and sub spec validation

*  aggregate support of junos modules
*  aggregate sub spec validation
*  relevant changes to junos integration test
*  junos module boilerplate changes

* Add new boilerplate for junos modules

* Fix CI issues
7 years ago
Dag Wieers bcb3e33adb command: PEP8 compliancy (#27740) 7 years ago
Dag Wieers d125520071 imc_rest: Increase default timeout, add elapsed time (#26743)
The IMC interface can be quite slow depending on the XML fragments used.
So we increase the default timeout to 60 seconds, and return the elapsed
time so it is easier to determine what timeout value makes sense from
earlier runs.

We also renamed **imc_xml** to **imc_rest**, now that we still can.
7 years ago
Alex Bush 8e8d4df340 #26903 Invalid JSON-RPC request (#26906) 7 years ago
Dag Wieers 60276b60a2 win_stat: Add stat.isreg support (#27732)
* win_stat: Add stat.isreg support

This PR includes the following changes:
- Adds stat.isreg support (cfr. the stat module)
- Always returns stat.isdir, stat.islnk, stat.isreg, stat.isshared

* Remove the controversial part
7 years ago
Adam Miller 91ea8e5eaf Fixes #23895 firewalld handle port arg whitespace (#27577)
Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
7 years ago
Will Thames 4e0666fc4a Add oracle-se2 database support (#23482)
Fixes ansible-modules-core#4808
7 years ago
Toshio Kuratomi fbf6cb8fff Add boilerplate to fetch.py
This completes the modules/files directory so we can now check it for
regressions.
7 years ago
Sloane Hertel 467a1f54a3 s3_bucket: fix python3 sorting incompatibility (#27502)
* s3_bucket: fix policy sorting for python3 so strings are evaluated as less than tuples.

Add tests to ensure this behavior is maintained.

* Fix s3_bucket comparison function to work on both Python 3.5 and 3.6

* s3_bucket: document that cmp_to_key is used for python 2.7.

Add another test for s3_bucket to compare policies of different sizes.

* fix pep8

* Work around code-smell grepping by not using the word 'cmp'.
7 years ago
Pilou 96784160b1 rhn_register: call logout (#27533)
* missing requirement: list sufficient pkgs in error

* rhn_register: call logout when necessary

* rhn_register: remove useless return, small rewrite
7 years ago
Sloane Hertel dbbad16385 [cloud] New module: Add module for managing AWS Datapipelines (cloud/amazon/data_pipeline) (#22878)
* New module for managing AWS Datapipelines

* Supports create/activate/deactivate and deletion
* Handles idempotent creation by embeding the version in the
uniqueId field
* Waits for requested state to be reached, as Botocore doesn't
have waiters yet for datapipelines

* rename module, fix imports, add tags option, improve exit_json results, fix a couple bugs, add a TODO so I don't forget

fix pep8

allow timeout to be used for pipeline creation

make .format syntax uniform

fix pep8

fix exception handling

allow pipeline to be modified, refactor, add some comments, remove unnecessary imports

pipeline activation may not be in the activated state long

remove datapipeline version option

change a loop to a list comprehension

create idempotence by hashing the options given to the module minus the objects (which can be modified)

small bugfix

* data_pipeline unittests

make unittests pep8

fix bug in unittests

* remove exception handling that serves no purpose

* Fix python3 incompatibilities in datapipeline tests and add placebo fixture maybe_sleep for faster tests

Fix python3 incompatibilities in data_pipeline build_unique_id()

Don't delete a pipeline in diff_pipeline() because it's unexpected

Don't use time.time() because it causes an issue with placebo testing

re-recorded tests

fix pep8 in data_pipeline

Remove disable_rollback from tests

Make sure unique identifier is a string

re-record tests

* improve documentation and add another example

* use a placebo fixture instead of redundant code in tests

fix tests for PLACEBO_RECORD=false

* Fix data_pipeline docs

use isinstance instead of type()

fix documentation

* fix documentation

* Remove use of undefined variable from data_pipeline module and fix license

* fix copyright header
7 years ago
Dmitry Telegin 6841763d70 Support install root in URPMI module. Fixes #23475 7 years ago
Sam Doran af558698a0 Include aliases in ansible-doc output (#27702)
* Properly include aliases in ansible-doc output

Use correct variable name for storing aliases and only print them out if the list isn't empty.

Fixes #24498

* Only include choices in output if choices exist in the list
7 years ago
Abhijeet Kasurde 97240a9ebc Fix for missing import and boilerplate
Fix adds missing imports and boilerplate for proxysql.
It also remove get_exception calls in-favor of native exception.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Chris Chambers afbad8789f cachamber - Issue #27566 - Correct urlparse import for maven_artifact module 7 years ago
Chad Bean 661d81ef86 Add new API param for new_host_delay (#21262) 7 years ago
Abhijeet Kasurde bf54a0c3e5 Fix missing import and boilerplate
Added fix for missing imports and boilerplate in files modules,
also, removed get_exception calls to match 2.6> exception handling.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Will Thames 11da85f938 timer callback plugin: handle timezone changes better
A playbook that does `timezone name=Australia/Brisbane` on
a host previously in UTC will appear to take 10 hours.

Improve the seconds handling for playbooks that take longer
than one hour.
Improve the hours handling for playbooks that take longer than
one day.

TZ change before:
```
Playbook run took 0 days, 10 hours, 0 minutes, 36055 seconds
```
After:
```
Playbook run took 0 days, 0 hours, 0 minutes, 55 seconds
```

Sleep for 100s more than one hour before:
```
Playbook run took 0 days, 1 hours, 1 minutes, 3641 seconds
```

After:
```
Playbook run took 0 days, 1 hours, 1 minutes, 41 seconds
```
7 years ago
Mark McKinstry f17cb253a4 pear: add option for path to pear executable (#19200)
* add option for path to pear executable

this is useful if you have multiple versions of PHP installed at once,
using SCL PHP RPMs from Red Hat or some other method

* update version number

* improve wording
7 years ago
Pete Travis 7a35b95609 provide usable examples for sudo validation 7 years ago
Yaacov Zamir 48922660fe New model manageiq manageiq user (#26641)
* ManageIQ: manageiq_user module, module utils and doc_fragment

ManageIQ is an open source management platform for Hybrid IT.

This change is adding:
- manageiq_user module, responsible for user management in ManageIQ
- manageiq utils
- manageiq doc_fragment

* Handle import error

* Use formatting options

* group parameter is required

* changed doesn't need to be an attribute

* resource dictionary should contain values which isn't None

* move from monitoring to remote-management

* Use ManageIQ nameing convention

* Do not set defauts in arguments

* Use idempotent state parameter instead of action

* Check import error in the manageiq util class

* Update the miq documentation

* rename the connection configuration from miq to manageiq_connection

* All messeges start with non cap, fix typos, add examples, rename vars

* more typos fixes

* Make sure we insert only strings to logs by using % formating

* use suboptions keyword for the manageiq connection

* do not log the managiq connection struct (it include sensitive information like username and password)

* add missing from __future__

* ahh, wrong no-log line

* Use sub options
7 years ago
Abhijeet Kasurde 748fa5db35 Add check for requests module
Fix adds check for requests Python module and suggests user to install,
if no requests module installation found.

Fixes: #27643

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
George Nikolopoulos 31b4ae2e6a New module: manage Citrix Netscaler GSLB site configuration (network/netscaler/netscaler_gslb_site) (#27639)
* Add netscaler_gslb_site

* Lowercase enabled, disabled option values

* Add fixes in netscaler module utils needed for unit test success
7 years ago
George Nikolopoulos d88c07a037 New module: manage Citrix Netscaler GSLB service configuration (network/netscaler/netscaler_gslb_service)) (#27638)
* Add netscaler_gslb_service

* Lowercase enabled, disabled option values

* Add fixes in netscaler module utils needed for unit test success
7 years ago
George Nikolopoulos cd865be987 New module: manage Citrix Netscaler SSL certificate keys (network/netscaler/netscaler_ssl_certkey)) (#27641)
* Add netscaler_ssl_certkey

* Fix options

* Lowercase enabled, disabled option values

* Add fixes in netscaler module utils needed for unit test success
7 years ago
Gregory Danenberg 1e42e1e04c [cloud] cloudformation: fix changeset_name bug fix #27487 (#27518)
Closes #27487
7 years ago
George Nikolopoulos e2f907ae3e Add netscaler_gslb_vserver (#27640) 7 years ago
Christian Pointner 1ce2bf56a2 crypto/openssl_*: Standardize implementaton and add support keyUsage, extenededKeyUsage (#27281)
* openssl_csr: make subjectAltNames a list

* csr module now uses the new standard way to build openssl crypto modules

* add check functions for subject and subjectAltNames

* added support for keyUsage and extendedKeyUsage

* check if CSR signature is correct (aka the privatekey belongs to the CSR)

* fixes for first PR review

* fixes for second PR review

* openssl_csr: there is no need to pass on privatekey as it can be accessed directly

* openssl_csr: documentation fixes
7 years ago
rahushen e0f482a8c5 Fixes #27340 - make indent consistent for nxos_config (#27652) 7 years ago
Trishna Guha 3da9607203 fix unexpected key argument for eos_config replace (#27683)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Trishna Guha 91a9564b3b modify indent to avoid re-run of src template fail (#27686)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Felipe Garcia Bulsoni b060d0ccba Initial commits for integration of HPE OneView resources with Ansible (#26026)
* Initial commit for integration of HPE OneView resources with Ansible Core. Adding FC Network and FC Network Fact modules and unit tests, and OneView base class for all OV resources.
7 years ago
James Mighion baaa1ef2ec Sanitizing all responses from aireos. (#27660) 7 years ago
Eduard Iskandarov a1abe7d941 add kubernetes beta resources to clustering/kubernetes module (#18953) 7 years ago
Adrian Likins 6fbd0a8bb5 Add set_fact_persistent action and module. (#26153)
* Add 'cacheable' param to  set_fact action and module.

Used just like set_fact, except facts set with cacheable: true
will be stored in the fact cache if fact caching is enabled.

set_fact normally only sets facts in the non_persistent_fact_cache, so they
are lost between invocations.

* update set_facts docs

* use 'ansible_facts_cacheable' in module/actions result

* pop fact cacheable related items out of args/results

We dont want to use 'ansible_facts_cacheable' result item
or 'cacheable' arg as actual facts, so pop them out of the
dicts.
7 years ago
jctanner e1abed28ba Fix version_added from #21822 (#27665) 7 years ago
jctanner 93f98effe9 Update version added from #20777 (#27662) 7 years ago
Chekov2k a0370b8254 Add pv_options to lvg module so that, for example, metadatasize can b… (#21822)
* Add pv_options to lvg module so that, for example, metadatasize can be specified (e.g. for openstack cinder volumes)

* Fixing version added
7 years ago
mwellmeyer 54a3bcc4ec add iptables tcp-flags option (#20777)
* add iptables tcp-flags option

* fix invalid character in iptables documentation

* fix wrong default value for tcp_flags in the documentation
7 years ago
Sloane Hertel b0efbc5418 [cloud] ec2_vpc_igw: fix check mode - fixes #27490 (#27637)
Fix check mode for adding/removing tags; boto's DryRun is not equivalent to check mode.

Fixes #27490
7 years ago
Sloane Hertel c02deef454 [cloud] filter by vpc and subnet if provided before terminating instances (#27394) 7 years ago
piotrkarbowski-ciklum a260d99f74 ec2_ami_copy.py: Fix WaiterError handling. (#27416)
* ec2_ami_copy.py: Fix WaiterError handling.

Change suggested by Adam Johnson at https://github.com/ansible/ansible/issues/26971

* ec2_ami_copy.py: WaiterError: fail_json: add exception parameter.

* ec2_ami_copy.py: import traceback
7 years ago
Toshio Kuratomi e992e4f436 Add missing copyright header in modules cleaned up yesterday 7 years ago
Abhijeet Kasurde 5e2184c683 Fixing broken imports and get_exception for ipa
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Brandon Davidson 3d20a2ea82 Fix typo in cloud/amazon/ec2_vpc_nacl_facts (#27534) 7 years ago
Abhijeet Kasurde be58fa979d Fix broken import in cloudformation
* Fix imports
* Add new GPLv3 Licence

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Nathaniel Case 123b5e222f nxos_bgp_neighbor fixes (#27348)
* Fix `timers` idempotency

* `shutdown` is not documented as having a `default` option

* dynamic_capability is the inverse of BOOL_PARAMS
7 years ago
Adrian Likins 27a015f0ad add a 'min' type for gather_subset to collect nothing (#27085)
previously gather_subset=['!all'] would still gather the
min set of facts, and there was no way to collect no facts.

The 'min' specifier in gather_subset is equilivent to
exclude the minimal_gather_subset facts as well.

   gather_subset=['!all', '!min'] will collect no facts

This also lets explicitly added gather_subsets override excludes.

   gather_subset=['pkg_mgr', '!all', '!min'] will collect only the pkg_mgr
fact.
7 years ago
DavidVentura c85b36d220 Fix Proxmox module crashing if the hostname doesn't exist and there's no vmid (#21305)
* fail the execution instead of panicking when the hostname is not found and the vmid was not provided

* return an empty vmid list if the hostname doesn't exist
7 years ago
mharista c85f363aaa Add module cv_server_provision for integration with Arista CloudVision Portal. (#25450)
* Add module cv_server_provision for integration with Arista CloudVision Portal.

* Doc update.

* Remove shebang from test file. Update short description with company and product name.

* Update exception syntax to Python3 style.

* Remove blank line between imports.

* Remove newlines from RETURN documentation.

* Add cvprac to unittest requirements.

* Update unittest format. Add a few additional tests.

* Mock exceptions from cvprac so the library is not needed for unittests.

* Mock cvprac imports.

* Update unit tests to support python 3.5.

* Mock full cvprac library for unittests.

* Update Jinja2 import to pass updated CI checks.

* Update cvprac imports format for new CI tests.

* Add __metaclass__ and __future__.
7 years ago
Simon Dodsley 7fbd924cbb Add Pure Storage Host Group module (#26355) 7 years ago
Simon Dodsley b3865b173d Add Pure Storage Protection Groups module (#26356)
Update documentation to be correct
Change type to bool
7 years ago
jctanner baf1ed9100 [WIP] Create preserved_copy function in basic.py to perserve file ownership. (#27344)
Create preserved_copy function in basic.py to perserve file ownership.

* Add a test for template preserved backup
* Use a script to get the random names
* bytes to strings
* Remove dump of hostvars
* Stop being fancy and create a testuser instead
* Fix pep8
* set file attributes
* Pass the correct data to set_attributes_if_different
* Use -j instead -b and pass the attributes as a string instead of a list
* remove debugging message
* Use shell to softly set the attr

Fixes #24408
7 years ago
Abhijeet Kasurde b266204afa Fix JSON parsing for Python3
Fix corrects the parsing of JSON output in Python 3
environment by using to_text API.

Fixes: #26489

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Nathaniel Case b93878b685 Minor cleanup to nxos_vrrp (#27593)
* Safe changes

* Fold `[0]` into `execute_show_command()`

We only ever execute one command, so only return the one response

* Streamline `results`
7 years ago
Abhijit Menon-Sen 20b0716948 Allow variables to be passed in to template lookup plugin (#18662)
This allows a single template to be evaluated with different values in
the same task. For example, with a template like 'x:{{a}}', one could do
something like this:

    - foo:
        a: "{{ lookup('template', 'x.j2', template_vars=dict(a=foo[item])) }}"
        b: "{{ lookup('template', 'x.j2', template_vars=dict(a=bar[item])) }}"
      with_items:
        - x
        - y

…and "a" and "b" would expand to different strings based on what we
passed in to the template lookup.
7 years ago
Andrew Saraceni 435a562630 Rename win_group_member module to win_group_membership (#27614)
* rename win_group_member to win_group_membership

* adding details to BOTMETA.yml
7 years ago
Jordan Bach 24e393aef1 allow use of jinja2 variables for ec2_group from_port/to_port params (#27145) 7 years ago
Adrian Likins 2b0a7338d4 Handle win style CRLF newlines in vault text (#27590)
When parsing a vaulttext blob, use .splitlines()
instead of split(b'\n') to handle \n newlines and
windows style \r\n (CRLF) new lines.

The vaulttext enevelope at this point is just the header line
and a hexlify()'ed blob, so CRLF is a valid newline here.

Fixes #22914
7 years ago
Toshio Kuratomi 7d2597a68d change the gpl header to single line version and order of imports 7 years ago
Toshio Kuratomi 15902f2496 Fix for ansiballz filenames conflicting with python stdlib modules
The AnsiBallZ wrapper is transferred to the remote machine with
a filename similar to the Ansible-module it runs.  For modules like copy
and tempfile, this can end up conflicting with stdlib modules on the
remote machine depending on how python is setup there.  We have a little
bit of code in the wrapper to deal with this by removing the path that
the ansible module resides in from sys.path.

On MacOSX, that code was having a problem.  The path the module ends up
in included a symlinked directory so we were looking for a path in
sys.path but we had to look for the unsymlinked path instead.

Fix that by using os.path.realpath() instead of os.path.abspath()
7 years ago
Adrian Likins 75a8be9a5d Add back support for vault_password_file config var (#27597)
Got removed in arg parsing updates. Now added back in
setup_vault_secrets().

The default value for DEFAULT_VAULT_PASSWORD_FILE was also
set to '~' for some reason, change to to no default.

Add integration tests.
7 years ago
Matt Davis f19ed387a7 fix non-pipelined output parsing in winrm.py (#27606)
* ensures stdout/stderr are converted to text type in py3 to avoid json serialization failures
7 years ago
Robin Roth b134352d8c WIP: Replace boilerplate (#27554)
* Replace boilerplate

* Enable test on packaging/os
7 years ago
CyberArk BizDev 6aa851c6bc CyberArk InitialSupport (#21764)
* Added cyberarkpassword lookup plugin

Added cyberarkpassword lookup plugin: It allows to retrieve credentials
(password, sshkey) from CyberArk Digital Vault

* Added Modules: cyberark_authentication & cyberark_user

Added Modules:
- cyberark_authentication: Logon/Logoff to CyberArk Vault
- cyberark_user: user management

These 2 modules use CyberArk Privileged Account Security Web Services
SDK

* Update cyberark_authentication.py

* Update cyberark_user.py

* Removed ternary conditional to comply with 2.4

* Replaced usage of iteritems() for items() to comply with python3

* PEP8 Updates

* Fixed Doc Issues

* Doc Fixes

* More Doc Fixes

* Removing cyberark_user module, and cyberark lookup plugin

for initial approval of PR, and continue with 2 different PRs after PR
#21764 is approved.

* PEP8 Fixes

* Moved cyberark modules to identity category

From IRC #ansible-devel recommendation (@bcoca) I moved cyberark to
identity category so the authorized maintainers can provide feedback
and move it forward.

* Updates based on community_review by bjolivot

- Updated description lines to have full stops in the documentation
section.
- changed file to use delimiter-separated words instead of camel case
- Updated AnsibleModule module_spec parameters to use
mutually_exclusive, required_if and required_together parameters to
avoid manual validation of the parameters.
- Added comments for more readability.
- Removed “required”: false as they are implicit.
- Enhanced check_mode handling.

* PEP8 Updates

* Updates based on IRC Feedback June 6

* Fixed description for token item

* Fixed Documentation RETURN string

* Fixed PEP8 W291 trailing whitespace

* Changes based on feedback from community review

* Added import to_text from ansible.module_utils._text

* Updates based on recommendation from community

* Changed Exception for Error in friendly messages in try/except blocks

* Updates based on community review (bcoca & dagwieers)

* Fixed httplib for python3 (http.client)
7 years ago
Ganesh Nalawade 6a0d9d1498 Fix junos_logging integration test failure (#27605) 7 years ago
Adrian Likins 9f57920eab Fix --ask-vault-pass prompt to match old when poss (#27602)
If we don't use more than one vault-id, and we use
--ask-vault-pass, instead of using the new vault prompt
format ('Vault password (my_vault_id): ') we use the old
one ('Vault password: ').

This avoids confusing Tower when it needs to detect an
interactive vault password prompt.

This also potentially could allow vault password prompts
to be customized per vault_id.
7 years ago
saichint 37392318a6 fix nxos_vlan and nxos_switchport issues (#27505) 7 years ago
Adrian Likins a52a4332fd Fix aruba_config flake8 failures (#27603)
* Fix aruba_config flake8 failures

* fix intefaces_file build/flake8 fail
7 years ago
Sloane Hertel d8eccdda3a [cloud] make ec2 paging() more functional and add paging to ec2_lc_facts (#27355) 7 years ago
Sloane Hertel ad2c1e1838 [cloud] ec2_customer_gateway: add routing option to allow bgp_asn to be optional (#27276)
fixes #27157

 add routing option to allow bgp_asn to be optional
7 years ago
Nathaniel Case ec8cbbf926 Fix aruba boilerplate 7 years ago
Sloane Hertel 61ebb89fe3 improve cloudformation failures (#27427) 7 years ago
jhawkesworth a43af128cf Add mac address to windows facts (#25803) 7 years ago
Roman Belyakovsky 42039cd436 New module: manage debian network interfaces file /etc/network/interfaces (system/interfaces_file) (#25295)
* Added new module interfaces_file

* interfaces_file: added unit tests

* interfaces_file: added golden files for unit tests

* interfaces_file: moved to system modules

* interfaces_file: fixed code formatting and convention issues
7 years ago
Brandon Davidson 4ec8744b8b Ignore main route table association when determining which associations to remove. (#23781)
They can't be removed anyway, and will just throw an error if you try to disassociate them.
7 years ago
Jens Carl cc72dead45 New module: Add module to collect facts for Amazon Redshift Cluster (cloud/amazon/redshift_facts) (#22615)
* New module redshift_facts

Gather facts about aws Redshift cluster(s).

* Fix she-bang, PEP8 violations, and ansible metadata.

* Bump version_added to "2.4"

* Fix some typos and add supporting check mode

* Fix type of RETURN fields

Fix type of RETURN fields number_of_nodes and
automated_snapshot_retention_period from integer to int.

* Add traceback information to fail_json()
7 years ago
Nathaniel Case c017d0c7c0 Fix fortios & netscaler boilerplate
Sorry
7 years ago
Trishna Guha 407dc2dc68 fix nxos_vrf removal failure (#27547)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Gaurav Rastogi 23ec711494 Added flags for Federated objects used in GLSB (#27531) 7 years ago
Ganesh Nalawade c4e06a1735 ios implementation for net_interface (#27459)
* ios implementation for net_interface

*  ios_interface implementation
*  ios_interface integration test

* net_interface integration test for ios and other refactor

* Update boilerplate and minor refactor
7 years ago
Ganesh Nalawade 70ce394840 Persistent connection timer changes (#27272)
*  Add command_timeout timer that defines the amount
   of time to wait for a command or RPC call before
   timing out.
*  Remove connect_retries and connect_interval configuration
   varaible and replace it with connect_retry_timeout to control
   the timeout value of connection to local scoket.
*  Make required changes to netowrk action plugins and relevant
   network files in module_utils.
*  Required documentation changes.
7 years ago
James Mighion 4dd8f281d6 Adding aruba_config module (#27130)
* Adding aruba_config module.

* Fixing documentation.

* Forgot action plugin.
7 years ago
George Nikolopoulos f204e7cb33 New module: manage Citrix Netscaler content switching virtual server configuration (network/netscaler/netscaler_cs_vserver) (#26245)
* Add netscaler_cs_vserver

* Correct version_added
7 years ago
QijunPan 402ac47549 Contributing lib/ansible/modules/network/cloudengine/ce_bfd_session.py module to manage HUAWEI data center CloudEngine (#26069)
* add bfd session module

* update return doc
7 years ago
George Nikolopoulos 36537186e3 New module: manage Citrix Netscaler content switching policy configuration (network/netscaler/netscaler_cs_policy) (#26189)
* Add netscaler_cs_policy

* Correct version_added
7 years ago
Ken Celenza 7a51c5f4df make panos security rule more idempotent (#26573) 7 years ago
benthomasson fb1583b2c2 Add last line of LLDP data (#26451) 7 years ago
George Nikolopoulos e329c9da8c New module: manage Citrix Netscaler servicegroup configuration (network/netscaler/netscaler_servicegroup)) (#26183)
* Add netscaler_servicegroup

* Correct version_added
7 years ago
George Nikolopoulos 7df14bd2b0 New module: manage Citrix Netscaler load balancer virtual servers configuration (network/netscaler/netscaler_lb_vserver) (#26144)
* Add netscaler_lb_vserver

* Correct version_added
7 years ago
John R Barker 727a7e8a1c Correct version added 7 years ago
George Nikolopoulos ac0c5dec2f Add netscaler_lb_monitor (#26143) 7 years ago
QijunPan 17e64f876d add bfd view module (#26070) 7 years ago
QijunPan 5b2373df16 add bfd global module (#26068) 7 years ago
Dennis Israelsson d7202e6155 Add fabricpath support for nxos_vlan (#26013)
* Add files via upload

Fix for issue #25720

* nxos_vlan fabricpath (#25720)

Fix for issue #25720

* Add files via upload

* Add files via upload

* Delete nxos_vlan.py

* Add files via upload

* Add files via upload
7 years ago
Ganesh Nalawade 448c461940 Convert port value to integer (#25939)
Fixes #25175

convert port value to integer explicitly
7 years ago
techhelper1 a25c6b9478 ios_facts: Fixed Retrieving All IPv4 Addresses on L3 Interfaces (#25462)
* Fixed Retrieving All IPv4 Addresses on L3 Interfaces

The ios_facts module retrieving the interface subnet, would only get the primary IPv4 address on the interface and would not capture all the secondary IPs (ones that I would be set by "ip address x.x.x.x x.x.x.x secondary").

This was tested and confirmed to work on a Cisco 6500 with IOS 15.1(2)SY6.

* Fixed whitespace and if statement issues for sanity.

* Fixed spacing because sanity.
7 years ago
ikelos 03d3c6135d Convert the src entry to a templated entry. (#24026) 7 years ago
jpvrenen b13d547621 Added result responses (#23336)
Return value 'responses' is now created in result, so it can actually be
called/used.
7 years ago
numone213 25b3f194f8 Contributing lib/ansible/modules/network/cloudengine/ce_vrrp.py module to manage HUAWEI data center CloudEngine (#22344)
* add ce vrrp

add ce vrrp

* metadata_version

* fix CI issue
7 years ago
Benjamin Jolivot 753b26ccf9 Manage Fortios/Fortigate Address (#21542)
* New module fortios_address

* Add module_utils required_if + fix Doc

* Merge spec & required_if from module_utils

* Fix pep8

* Py2.5 compat , cosmetic changes

* Fix param timeout

* Fortios_address module + integration tests

* add netaddr library in requirements for integration tests

* Pep8 problems

* ANSIBLE_METADATA.version -> ANSIBLE_METADATA.metadata_version
7 years ago
Adrian Likins 17ab546c48 Add 2.0-2.3 facts api compat (ansible_facts(), get_all_facts()) (#27294)
* Add 2.0-2.3 facts api compat (ansible_facts(), get_all_facts())

These are intended to provide compatibilty for modules that
use 'ansible.module_utils.facts.ansible_facts' and
'ansible.module_utils.facts.get_all_facts' from 2.0-2.3 facts
API.

Fixes #25686

Some related changes/fixes needed to provide the compat api:

* rm ansible.constants import from module_utils.facts.compat

Just use a hard coded default for gather_subset/gather_timeout
instead of trying to load it from non existent config if the
module params dont include it.

* include 'external' collectors in compat ansible_facts()

* Add facter/ohai back to the valid collector classes

facter/ohai had  gotten removed from the default_collectors
class used as the default list for all_collector_classes by
setup.py and compat.py

That made gather_subset['facter'] fail.
7 years ago
Chris Houseknecht 3db768f393 Removes container-enabled warning (#27578) 7 years ago
Gaurav Rastogi dc5b826af8 New Module: Manage Avi Networks ServerAutoscale Policy (#27544) 7 years ago
Gaurav Rastogi d3ed3dd7c3 New Module: Manage Avi Networks HardwareSecurityModuleGroup (HSM) (network/avi/avi_hardwaresecuritymodulegroup) (#27541) 7 years ago
Gaurav Rastogi 6f12abe517 New Module: Manage Avi Networks PoolGroupDeploymentPolicy (nettwork/avi/avi_hardwaresecuritymodulegroup) (#27542) 7 years ago
Gaurav Rastogi d78d3931a1 New Module: Manage Avi Networks Traffic Clone profile (network/avi/avi_trafficcloneprofile) (#27543) 7 years ago
Gaurav Rastogi 5fe82c6b4a New Module: Manage Avi snmptrapprofile (network/avi/avi_snmptrapprofile) (#27583) 7 years ago
Gaurav Rastogi eae1e9a351 New Module: Manage Avi Networks Scheduler (network/avi/avi_scheduler) (#27582) 7 years ago
Gaurav Rastogi 4d1bd424f4 New Module: Manage Avi Networks Backupconfiguration (network/avi/avi_backupconfiguration) (#27580) 7 years ago
Gaurav Rastogi 833d3dd5f9 New Module: Manage Avi Networks Webook (network/avi/avi_webhook) (#27579) 7 years ago
Gaurav Rastogi 279c50e43f New Module: Manage Avi Networks PriorityLabels (network/avi/avi_prioritylabels) (#27576) 7 years ago
Ganesh Nalawade 97a34cf008 Add options sub spec validation (#27119)
* Add aggregate parameter validation

aggregate parameter validation will support checking each individual dict
to resolve conditions for aliases, no_log, mutually_exclusive,
required, type check, values, required_together, required_one_of
and required_if conditions in argspec. It will also set default values.

eg:
tasks:
  - name: Configure interface attribute with aggregate
    net_interface:
      aggregate:
        - {name: ge-0/0/1, description: test-interface-1, duplex: full, state: present}
        - {name: ge-0/0/2, description: test-interface-2, active: False}
    register: response
    purge: Yes

Usage:
```
from ansible.module_utils.network_common import AggregateCollection

transform = AggregateCollection(module)
param = transform(module.params.get('aggregate'))
```

Aggregate allows supports for `purge` parameter, it will instruct the module
to remove resources from remote device that hasn’t been explicitly
defined in aggregate. This is not supported by with_* iterators

Also, it improves performace as compared to with_* iterator for network device
that has seperate candidate and running datastore.
For with_* iteration the sequence of operartion is
load-config-1 (candidate db) -> commit (running db) -> load_config-2
(candidate db) -> commit (running db) ...

With aggregate the sequence of operation is
load-config-1 (candidate db) -> load-config-2 (candidate db) -> commit
(running db)

As commit is executed only once per task for aggregate it has
huge perfomance benefit for large configurations.

* Fix CI issues

* Fix review comments

*  Add support for options validation for aliases, no_log,
   mutually_exclusive, required, type check, value check,
   required_together, required_one_of and required_if
   conditions in sub-argspec.
*  Add unit test for options in argspec.
*  Reverted aggregate implementaion.

* Minor change

* Add multi-level argspec support

*  Multi-level argspec support with module's top most
   conditionals options.

* Fix unit test failure

* Add parent context in errors for sub options

* Resolve merge conflict

* Fix CI issue
7 years ago
Will Thames 5f73bdc3bf [cloud] Improve Camel to Snake conversion in EC2 module_utils (#25015)
* Make camel_to_snake work on capitalized plurals

`TargetGroupARNs` should become `target_group_arns`, not
`target_group_ar_ns`

Promote `camel_to_snake` to top layer function but prefix
it with an underscore.

Add tests for improved `_camel_to_snake` function.

Reduce use of `re.compile` as it makes no sense when the
compilation result is not reused.

* Remove unused LooseVersion check

* Fix PLURALs case for camel_to_snake

Also renamed EXPECTED_CAMELIZATION to EXPECTED_SNAKIFICATION
7 years ago
Ganesh Nalawade 60676add33 iosxr implemetation for net_interface (#27513)
* iosxr implemetation for net_interface

*  iosxr_interface implementation

* Add integration test

*  iosxr_interface integration test
*  net_interface intergration test for iosxr

* update boilerplate
7 years ago
ossark 3290c2fc3c Added priority attribute for pool members (bigip_pool_member module) (#23128)
* Added priority attribute for pool members (bigip_pool_member module)

* Line break missing

* Change from 'priority' to 'priority_group'

* Update bigip_pool_member.py

* Update bigip_pool_member.py
7 years ago
Ganesh Nalawade bb998a3cd2 Add fix to read correct socket path recieved from ansible-connection (#27560)
Currently socket path is send from `ansible-connection` (running as background
process) over stdout. This can conflict with debug logs that are also send on
stdout resulting in incorrect socket path received by the main process.

To avoid this add a socket path delimiter string which is recevied by
main process and socket path is retrieved based on delimiter string.

This implementation will change in future when ansible-connection
framework is made more robust.
7 years ago
hyperized 00ef894f6c Add module to list S3 buckets (#27322)
* Add module to list S3 buckets

* Move check for boto3 before boto3 is attempted to be used
7 years ago
Nikita Chernyi 889495bf7f skippy callback plugin: hides banner for skipped tasks (#18621)
* Modified skippy callback plugin

* Added original skippy.py, moved plugin to full_skip.py

* Full skip: fixed code style
7 years ago
Jiangge Zhang 891a8ad2fe Proposed new notification module: BearyChat (#21947)
* Add new notification module: BearyChat integration

BearyChat (https://bearychat.com) is a Slack alternative service.

* Remove implicit args and change position of module.fail

* Update the metadata of bearychat module
7 years ago
Will Thames f972994662 [cloud] fix VPC behavior for ec2_group module, improve integration tests (#27038)
* Add tests for group in a VPC

* Improve ec2_group output and documentation

Update ec2_group to provide full security group information
Add RETURN documentation to match

* Fix ec2_group creation within a VPC

Ensure VPC ID gets passed when creating security group

* Add test for auto creating SG

* Fix ec2_group auto group creation

* Add backoff to describe_security_groups

Getting LimitExceeded from describe_security_groups is definitely
possible (source: me) so add backoff to increase likelihood of
success.

To ensure that all `describe_security_group` calls are backed off,
remove implicit ones that use `ec2.SecurityGroup`. From there,
the decision to remove the `ec2` boto3 resource and rely on the client
alone makes good sense.

* Tidy up auto created security group

Add resource_prefix to auto created security group and delete
it in the `always` section.
Use YAML argument form for all module parameters
7 years ago
Jordan Borean 7a7a0cae94 win_service: added support for paused services (#27216)
* win_service: added support for paused services

* change pausable service for local computers

* more fixes for older hosts

* sigh

* skip pause tests for Server 2008 as it relies on the service
7 years ago
Pilou 49b8bd0358 Fix broken import in utilities.helper._accelerate (#27088)
* Fix py3 compatibility using six.moves.socketserver

* Remove useless call to str
7 years ago
Jordan Borean 1517db06c5 fix to alllow the winrm plugin to send input with Python 3 (#27474) 7 years ago
Chris Houseknecht e2651d4bac Give precedence to user supplied --roles-path option (#27524) 7 years ago
Ozi Boms 16d23e96c5 Add reference to VNET resource group (#26052)
* Add reference to VNET resource group

When creating a new virtual machine, added new parameter to allow creation of VM in a resource group using virtual network from another resource group

* Fixed white space errors

Was getting compialtion errors with code and just went around and cleaned up extra white spaces and such.

* Re-fixed more white space issues

* Fixed Version Number for new parameter

* specified exceptions

Use clouderror instead of exceptions for finidng virtual network

* Simplified code lines

created a local variable to either use the VNET resource group or the VM resource group and then used whichever was available as a parameter

* fixed syntax issue with newline

...hopefully

* removed superfluous default/required from docs

* fix vm_size default
7 years ago
Ganesh Nalawade 7cf4416c9c Fix junos_netconf integration test failure (#27528) 7 years ago
Toshio Kuratomi 0b9a78f0b3 Remove wildcard, add boilerplate and get rid of get_exception
* smaller collections of database modules
* Some of the smaller collections of network modules
7 years ago
Ryan Sabatini f65f3570a8 Add Ability to Exlude Paths from Archive
Archive.py allows you to pass a glob path of files to archive.
This allows end users to glob a dir, and exlude a list of dirs
from the archive which are not necessary.
7 years ago
Andrew Saraceni 7b3d893f2d New Module: Manage Windows local group membership (win_group_member) (#26307)
* initial commit for win_group_member module

* fix variable name change for split_adspath

* correct ordering of examples/return data to match documentation verbiage

* change tests setup/teardown to use new group rather than an inbult group
7 years ago
Matt Davis 91f4c37ed7 rename legacy PS module_utils to remove PowerShell prefix (#27495) 7 years ago
Brian Coca b79744f282 make random_choice more error resilient (#27380)
* make random_choise more error resilient

fixes #27373

* missing imports

* PEEP 16
7 years ago
Gaurav Rastogi e575ff8d8d New Module: Manage Avi Networks Microservicegroup (network/avi/avi_microservicegroup) (#26209) 7 years ago
Gaurav Rastogi 69c4f90f7d New Module: Manage Avi Networks VRF Context Objects (networks/avi/avi_backup) (#26204) 7 years ago
Gaurav Rastogi 202cbd3421 New Module: Manage Avi Networks Serviceengine (network/avi/avi_serviceengine) (#26210) 7 years ago
Gaurav Rastogi 51ff3dba68 New Module: Manage Avi Networks IPAM DNS provider profiles (network/avi/avi_ipamdnsproviderprofile) (#26207) 7 years ago
Gaurav Rastogi 1e6fd571e1 New Module: Manage Avi Networks Cluster objects (networks/avi/avi_cluster) (#26205) 7 years ago
Gaurav Rastogi 0424919fe6 New Module: Manage Avi Networks AlertSyslogConfig (network/avi/avi_alertsyslogconfig) (#26215) 7 years ago
Gaurav Rastogi 1da76772f8 New Module: Manage Avi Networks AlertScriptConfig (network/avi/avi_alertscriptconfig) (#26214)
* New Module: Manage Avi Networks AlertScriptConfig (network/avi/avi_alertscriptconfig)

* updated example to not include python import as it fails sanity test
7 years ago
Gaurav Rastogi d2ec5462bc New Module: Manage Avi Networks AlertEmailConfig (network/avi/avi_alertemailconfig) (#26213) 7 years ago
Gaurav Rastogi 2589d640dd New Module: Manage Avi Networks AlertConfig (network/avi/avi_alertconfig) (#26212) 7 years ago
Gaurav Rastogi a8caff169e New Module: Manage Avi Networks ActionGroupConfig (network/avi/avi_actiongroupconfig) (#26211) 7 years ago
John R Barker 66adb3d993 Correctly reference variables (#27486) 7 years ago
Martin Krizek 19d119f43c Pass server_hostname from task to subscription-manager (#27420) 7 years ago
saichint 350018de73 nxos_vxlan_vtep fixes and integration tests (#27405)
* fix issue 27404

* conflict resolve
7 years ago
Dag Wieers 97aaf103e8 ACI module_utils library for ACI modules (#27070)
* ACI module_utils library for ACI modules

This PR includes:
- the ACI argument_spec
- an aci_login function
- an experimental aci_request function
- an aci_response function
- included the ACI team

* New prototype using ACIModule

This PR includes:
- A new ACIModule object with various useful methods
7 years ago
Abhijeet Kasurde e419a55c71 Add correct URL for docker guide (#27465)
Fixes : #27463

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
7 years ago
Toshio Kuratomi 4109a82d0a remove wildcards and add boilerplate
* cloud/centurylink
* source_control
* cloud/google
* notification
* cloud/rackspace
* cloud/vmware
7 years ago
Toshio Kuratomi 9a55487dff Remove get_exception usage from amazon modules 7 years ago
Toshio Kuratomi 8de6cff2b1 more wildcards 7 years ago
Toshio Kuratomi 1ee08c0f06 Get rid of more wildcard imports and add boilerplate to more modules
This commit cleans up the following module categories:
* messaging
* inventory
* crypto
* commands
* clustering
* cloud/webfaction
* cloud/docker
* cloud/digital_ocean
7 years ago
Toshio Kuratomi 4e6cce354e Remove wildcard imports
Made the following changes:

* Removed wildcard imports
* Replaced long form of GPL header with short form
* Removed get_exception usage
* Added from __future__ boilerplate
  * Adjust division operator to // where necessary

For the following files:

* web_infrastructure modules
* system modules
* linode, lxc, lxd, atomic, cloudscale, dimensiondata, ovh, packet,
  profitbricks, pubnub, smartos, softlayer, univention modules
* compat dirs (disabled as its used intentionally)
7 years ago
Toshio Kuratomi 0a2cdb2585 New tests for copy recursive with absolute paths
Absolute path trailing slash handling in absolute directories

find_needle() isn't passing a trailing slash through verbatim.  Since
copy uses that to determine if it should copy a directory or just the
files inside of it, we have to detect that and restore it after calling
find_needle()

Fixes #27439
7 years ago
giovannisciortino 7cfd02097c add_hosts.py: Fix add_host does not recognise 'host' alias (#27418)
* add_hosts.py: Fix add_host does not recognise 'host' alias

* add_hosts.py: add note in documentation that 'hosts' alias of name parameter is only available on >=2.4
7 years ago
Adrian Likins 934b645191 Support multiple vault passwords (#22756)
Fixes #13243

** Add --vault-id to name/identify multiple vault passwords

Use --vault-id to indicate id and path/type

 --vault-id=prompt  # prompt for default vault id password
 --vault-id=myorg@prompt  # prompt for a vault_id named 'myorg'
 --vault-id=a_password_file  # load ./a_password_file for default id
 --vault-id=myorg@a_password_file # load file for 'myorg' vault id

vault_id's are created implicitly for existing --vault-password-file
and --ask-vault-pass options.

Vault ids are just for UX purposes and bookkeeping. Only the vault
payload and the password bytestring is needed to decrypt a
vault blob.

Replace passing password around everywhere with
a VaultSecrets object.

If we specify a vault_id, mention that in password prompts

Specifying multiple -vault-password-files will
now try each until one works

** Rev vault format in a backwards compatible way

The 1.2 vault format adds the vault_id to the header line
of the vault text. This is backwards compatible with older
versions of ansible. Old versions will just ignore it and
treat it as the default (and only) vault id.

Note: only 2.4+ supports multiple vault passwords, so while
earlier ansible versions can read the vault-1.2 format, it
does not make them magically support multiple vault passwords.

use 1.1 format for 'default' vault_id

Vaulted items that need to include a vault_id will be
written in 1.2 format.

If we set a new DEFAULT_VAULT_IDENTITY, then the default will
use version 1.2

vault will only use a vault_id if one is specified. So if none
is specified and C.DEFAULT_VAULT_IDENTITY is 'default'
we use the old format.

** Changes/refactors needed to implement multiple vault passwords

raise exceptions on decrypt fail, check vault id early

split out parsing the vault plaintext envelope (with the
sha/original plaintext) to _split_plaintext_envelope()

some cli fixups for specifying multiple paths in
the unfrack_paths optparse callback

fix py3 dict.keys() 'dict_keys object is not indexable' error

pluralize cli.options.vault_password_file -> vault_password_files
pluralize cli.options.new_vault_password_file -> new_vault_password_files
pluralize cli.options.vault_id -> cli.options.vault_ids

** Add a config option (vault_id_match) to force vault id matching.

With 'vault_id_match=True' and an ansible
vault that provides a vault_id, then decryption will require
that a matching vault_id is required. (via
--vault-id=my_vault_id@password_file, for ex).

In other words, if the config option is true, then only
the vault secrets with matching vault ids are candidates for
decrypting a vault. If option is false (the default), then
all of the provided vault secrets will be selected.

If a user doesn't want all vault secrets to be tried to
decrypt any vault content, they can enable this option.

Note: The vault id used for the match is not encrypted or
cryptographically signed. It is just a label/id/nickname used
for referencing a specific vault secret.
7 years ago
James Mighion a328e96455 Adding aireos_config module (#27408)
* Adding aireos_config module.

* Fixing pep8 W291.
7 years ago
Toshio Kuratomi cce06c5a3b Fix _get_file_contents to return bytes and checking that a different file exists than it opens 7 years ago
fredericve 095560771c Fixes #17958: use stderr instead of the default stdout for fatal errors (#17962)
* add a callback plugin that sends failures to stderr

* fix warnings
7 years ago
Ganesh Nalawade 43bd993fac Fix fetch configuration in junos_command (#26392)
* Fix fetch configuration in junos_command

Fixes #26358 Add support to fetch configuration
from device in `xml`, `text`, `json`, `set` display
format.

* Add error message if set display is not supported

* Throw error in case of warning for show commands
7 years ago
Mike Wiebe 07b097af7c Fix nxos portchannel force option (#27190)
* Add integration tests

* Fix force option

* Enable nxos_portchannel test

* Satisfy ansibot demands
7 years ago
Nathaniel Case fb2b3de5e4 Fix nxos_vtep_vni typo 7 years ago
Marko Stanković 0ebc80cbd6 Fix a typo in win_iis_webapplication.ps1 (#27417)
introduced with https://github.com/ansible/ansible/pull/26082/files#diff-bd862e2bbcb44c9c332df7b6cacf6adaR74
7 years ago
David Newswanger c594f1e1c9 fixed nontype error (#27428) 7 years ago
David Newswanger 3b1f2aeb16 Iosxr attribute error #27122 (#27425)
* WIP fixing iosxr_logging idempotency

* remove debug stuff from module, add teardown section to start of test
7 years ago
Martin Krizek 36c6d0f748 fetch: fail if flat=yes and dest=existing-dir w/o trailing slash 7 years ago
Trishna Guha 6d1bd33aa5 fix iosxr_banner (#27378)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Simon Dodsley 26c9007c2d Add Pure Storage Volume module (#26357)
Update documentation to fix typos and define the extend feature
Force size to be a required variable on create as requested.
Change type to bool
7 years ago
Sloane Hertel 91781487ab aws_kms: don't append to unicode - fixes #25786 (#27352)
* AWS key management service fix; statement may not have a principal, and if there is only one AWS principal it will not be a list as expected. Fixes 25786.

* remove len(), only catch exception in function for json.dumps() failure

* use a defined variable and make formatting python 2.6 compatible
7 years ago
Yanis Guenane 9e41fd399b Removing openssl_publickey from pep8 legacy files (#27414) 7 years ago
Trishna Guha a49c419651 fix nxos_vrf_af nxapi & cli (#27307)
* fix nxapi failure #27142

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

* fix nxos_vrf_af nxapi and cli

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
Matt Clay 51bd07204b Revert "Revert "Allow ini plugin to load file using other encoding than utf8." (#27407)"
This reverts commit 520696fb39.
7 years ago
Toshio Kuratomi 520696fb39 Revert "Allow ini plugin to load file using other encoding than utf8." (#27407)
* Revert "Update conventions in azure modules"

This reverts commit 30a688d8d3.

* Revert "Allow specific __future__ imports in modules"

This reverts commit 3a2670e0fd.

* Revert "Fix wildcard import in galaxy/token.py"

This reverts commit 6456891053.

* Revert "Fix one name in module error due to rewritten VariableManager"

This reverts commit 87a192fe66.

* Revert "Disable pylint check for names existing in modules for test data"

This reverts commit 6ac683ca19.

* Revert "Allow ini plugin to load file using other encoding than utf8."

This reverts commit 6a57ad34c0.
7 years ago
Toshio Kuratomi 30a688d8d3 Update conventions in azure modules
* Remove wildcard imports
* Update GPL header to the one-line form
* Add from __future__ imports
7 years ago
Toshio Kuratomi 6456891053 Fix wildcard import in galaxy/token.py 7 years ago
Yannig Perré 6a57ad34c0 Allow ini plugin to load file using other encoding than utf8.
- New option for ini plugins: encoding
  - Add a new option encoding to _get_file_contents
  - Use replace option in test/runner/lib/util.py when calling decode on stdout/err
    output when diff have non-utf8 sequences
7 years ago
Josh Bradley 31b27819e1 adding lookup plugin for chef_databags (#18403)
* adding lookup plugin for chef_databags

* add missing classes for code-smell
7 years ago
mzizzi 9817ec84a0 [cloud] cast tag values to strings in ansible_dict_to_boto3_tag_list utility (#27396)
* ansible_dict_to_boto3_tag_list cast tag values to string

* ansible_dict_to_boto3_tag_list cast with to_native
7 years ago
David Newswanger 81151ef02c Remove Deprecated Template network modules (#27076)
* removed deprecated networking template modules

* update changelog

* update changelog
7 years ago
mesk41in 0fb64214a4 add support of nested groups in group_by 7 years ago
Trishna Guha 7351ee9a76 fix nxos_interface multiple issues (#27106)
* fix execute_show_command

* fix pep8 issues

* fix AttributeError #26562

* legacy-file remove

* modify execute_show_command output

* fix admin_state up doc

* fix admin_state for all interfaces doc

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
7 years ago
saichint 9b9a8749da Add integration tests and fix nxos providers (#26913)
* fix issues with python3.x

* Add integration testa and fix for nxos_evpn_vni

* add nxos_evpn_vni to nxos.yaml

* fix get_vtp_config()

* add new integration tests

* fix rollback

* add integration test files
7 years ago
Nathaniel McAuliffe c94c2831da extracting list from CustomerGateways to match create (#24897)
* Limiting CustomerGateway to dictionary within list of CustomerGateways

* Copying CustomerGateways[0] to CustomerGateway only if it exsits
7 years ago