Commit graph

17468 commits

Author SHA1 Message Date
Giovanni Sciortino
ab81c6c0f3 strategy: lost list order using with_items during displaying results Fixes #21008 2017-08-14 10:59:25 -04:00
Nathaniel Case
820d7e805a Streamline nxos_smu (#28030) 2017-08-14 10:54:50 -04:00
rahushen
b9c3329950 nxos_ip_interface: Fixes for #27170, #27172 (#27935)
* Fixes for #27170, #27172

* Add nxos_ip_interface IT tests

* For ipv6 check if ip address configured before doing a no ip address
2017-08-14 10:16:08 -04:00
Arne Demmers
000df2709d Support downgrade to specific version in yum module. 2017-08-14 04:55:39 -07:00
David Newswanger
cfda267b2b fixes pipe issue (#28127) 2017-08-14 17:21:32 +05:30
Trishna Guha
60ce6438e3 fix nxos_overlay_global idempotence (#28150)
* fix nxos_overlay_global idempotence

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

* modify nxos_overlay_global unittest

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-08-14 16:09:53 +05:30
David Newswanger
a01aa6e9df Fix structured output not supported in nxos_pim_interface (#28125)
* fixed unstructured error

* fix unit tests so they accept commands in dictionary form
2017-08-14 12:34:05 +05:30
Trishna Guha
12460dd713 Add ios_vrf declarative intent config check (#28001)
* Add ios_vrf declarative intent config check

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

* add version for delay param

* modify ios_vrf unit test
2017-08-14 12:27:03 +05:30
Ganesh Nalawade
eb33cc88bd Add state intent argument in vyos interface (#28066)
* Add state intent argument in vyos interface

*  State intent argument support
*  Integration test for supported intent arguments

* Add intent testcase

* FIx ci issue
2017-08-14 10:17:41 +05:30
Ganesh Nalawade
711a6b2326 Add common aggregate arguments for junos modules (#28124)
If parameter value in aggregate is not set, fetch it's corresponding
value from top level parameters.
2017-08-14 10:17:03 +05:30
Rafał Osiecki
33e56ca496 typo fix (#27212) 2017-08-14 02:15:00 +02:00
Pierre-Louis Bonicoli
e52096e78a copy: grammar fix 2017-08-13 08:22:22 -07:00
Pierre-Louis Bonicoli
ed8279cce0 copy: fix YAML documentation format 2017-08-13 08:22:22 -07:00
Pierre-Louis Bonicoli
1f5c908370 copy: state behavior when dest is a nonexisting path 2017-08-13 08:22:22 -07:00
Pierre-Louis Bonicoli
16f2e47559 copy: use formatting options 2017-08-13 08:22:22 -07:00
Pierre-Louis Bonicoli
28eb9466c7 copy: document behavior related to dest creation 2017-08-13 08:22:22 -07:00
Ganesh Nalawade
21bd7bcbb0 junos_interface intent arguments (#27947)
* junos_interface intent arguments

*  Add check for intent argument in junos_interface
*  Integration test for intent arguments

* Minor type fixes

* Add delay only if config diff is present

* add enabled configuration argument

* net_interface test case changes

* Minor doc change
2017-08-13 13:18:15 +05:30
Marko Stanković
6e7cf7377b xml: Add example with namespaces and clarify note (#28113)
* xml: Add example with namespaces and clarify note

* Correct the line length
2017-08-13 05:04:35 +02:00
Toshio Kuratomi
394e1e350c Expand wildcard imports and add boilerplate
More amazon modules with no open PRs.
2017-08-12 10:57:01 -07:00
Pierre-Louis Bonicoli
4ecf85392e udm_user: fix broken import
Tested with:
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
n = datetime.now()
assert n + timedelta(days=365) == n + relativedelta(years=1)
2017-08-12 10:45:12 -07:00
Pierre-Louis Bonicoli
c52f355bcb serverless: fix broken import 2017-08-12 10:39:10 -07:00
Pierre-Louis Bonicoli
dbc422ea1c Fix 'module' object is not callable 2017-08-12 10:21:14 -07:00
Pierre-Louis Bonicoli
f9404b0d85 Fix exit_json usage: really call client.auth.logout 2017-08-12 10:21:14 -07:00
Pierre-Louis Bonicoli
b556def4d3 Update DOCUMENTATION metadata 2017-08-12 10:21:14 -07:00
Pierre-Louis Bonicoli
ac05645bce Remove commented statements 2017-08-12 10:21:14 -07:00
Pierre-Louis Bonicoli
f761fc1d1f rhn_channel: fix py3 compatibility (use six)
and remove unused import
2017-08-12 10:21:14 -07:00
Pierre-Louis Bonicoli
5f62a973da docker_secret: fix broken import 2017-08-12 10:16:05 -07:00
Pilou
feff6abd72 os_client_config: fix broken import (#26839)
* os_client_config: fix broken import
* remove wildcards and add boilerplate
2017-08-12 10:07:49 -07:00
Nick Ward
f52a022022 Python3 compatability for elb_application_lb and elb_target_group 2017-08-12 09:01:29 -07:00
Toshio Kuratomi
9a7e23569e Fix wildcard imports, remove get_exception, add boilerplate
Amazon modules that don't have open PRs against them
2017-08-12 07:43:46 -07:00
Toshio Kuratomi
7cd81b802d Fix wildcard imports, remove get_exception, add boilerplate
Fixed for monitoring modules
2017-08-12 03:13:53 -07:00
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
2017-08-12 01:44:39 -07:00
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.
2017-08-12 10:35:16 +02:00
Toshio Kuratomi
ac56a2f138 Remove wildcard imports and get_exception calls
Fixed module_utils
2017-08-12 00:48:53 -07:00
T. Miller
93e1caccb7 ini_file: Match tabs before options (#28102) 2017-08-12 09:17:25 +02:00
Peter Sprygada
5ee7862793 update telnet module (#28100)
* accepts list of prompts to expect
* updates doc strings
2017-08-11 23:50:01 -04:00
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
2017-08-11 22:46:26 -04:00
Toshio Kuratomi
039383d90f Fix symbolic mode usage in unarchive with zip files
Fixes #21090
2017-08-11 19:01:41 -07:00
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
2017-08-11 17:50:49 -07:00
Jacob McGill
8b92369678 Update aci_tenant to support check_mode (#28090) 2017-08-11 18:51:49 -04:00
Jacob McGill
c04349088e update aci module util with methods to support check_mode and idempotency (#28089) 2017-08-12 00:27:29 +02:00
Jason Lingohr
3d29f79e74 Documentation fixes. (#28047)
* Documentation fixes.

* Update win_route.py
2017-08-11 23:41:58 +02:00
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.
2017-08-11 12:36:46 -07:00
Sloane Hertel
3cb1c38ecc [cloud] Allow S3 module to correctly delete objects by groups of <= 1000 (#28068) 2017-08-11 15:30:50 -04:00
Brian Coca
d89dd75769 validate include_role args (#28077)
* validate include_role args

* nicer error msg

* removed unused static

* updated as per feedback

* pepe ATE
2017-08-11 15:21:12 -04:00
Jacob McGill
21dbde0abe fix issue with trailing white space when logging into asa (#28073) 2017-08-11 12:30:57 -04:00
Trishna Guha
aef4e3d8fa fix nxos_snapshot (#27993)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2017-08-11 12:16:37 -04:00
Peter Sprygada
17a259a163 fixes command to be sent over nxapi for nxos_file_copy (#28029)
fixes #27347
2017-08-11 12:14:52 -04:00
Patrick Ogenstad
089226e372 Fixes for broken asa_config module (#27218)
* Fixes for broken asa_config module

* strip() prompt before checking
2017-08-11 11:42:42 -04:00
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()
2017-08-11 11:30:23 -04:00
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
2017-08-11 08:22:02 -07:00
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.
2017-08-11 11:05:52 -04:00
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
2017-08-11 10:21:20 -04:00
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
2017-08-11 10:12:43 -04:00
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
2017-08-11 09:34:33 -04:00
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
2017-08-11 09:31:20 -04:00
giovannisciortino
49209bfcc5 blockinfile: add --diff support in check mode (#27997) 2017-08-11 07:58:45 +02:00
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
2017-08-11 12:36:14 +10:00
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.)
2017-08-11 11:28:13 +10:00
Dave
4cec83471c win_get_url.ps1 - enable TLS1.1/TLS1.2 if they're available but disabled (#26833) 2017-08-11 11:00:34 +10:00
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
2017-08-11 10:23:09 +10:00
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
2017-08-10 17:57:32 -04:00
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
2017-08-11 07:57:07 +10:00
Jordan Borean
44ed891290 win_mapped_drive: new module (#27020)
* win_mapped_drive: new module

* Rebased from upstream and updated copyright text
2017-08-11 07:54:18 +10:00
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
2017-08-11 07:52:07 +10:00
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
2017-08-10 12:10:18 -07:00
Philip Gough
fee42a01d9 Redhat subscription proxy support (#22544) 2017-08-10 20:26:57 +02:00
David Newswanger
d0485779e8 nxos_smu: fix Structured output unsupported error in nxapi (#27976)
* fixed structured output unsupported error
2017-08-10 14:12:15 -04:00
Ricardo Carrillo Cruz
e8f1c1511c Implement purge on eos_vrf (#28013) 2017-08-10 19:59:32 +02:00
Martin Krizek
1c4e491eac yum: do not hide yum's errors (#27696) 2017-08-10 13:57:08 -04:00
Rémi REY
7974ad34f1 add playbook runtime stat in the logstash callback stats (#25785) 2017-08-10 13:43:21 -04:00
Raphael Nestler
ac0202fba1 win_file: Remove 'Create a file' example (#28009)
Fixes #28005
2017-08-10 13:30:37 -04:00
Peter Sprygada
145895dcf0 updates examples and documentation (#24211)
includes better examples of valid and invalid usage of the lines
argument

fixes #22828
2017-08-10 13:09:53 -04:00
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
2017-08-10 12:59:49 -04:00
Brian Coca
2015835759 updated author with github id 2017-08-10 11:42:49 -04:00
Dag Wieers
8451d945aa Add new maintainer 2017-08-10 17:11:55 +02:00
Luke Armstrong
fd18ade465 Documentation - modules/files/unarchive (#27998)
Last example is incorrect and will not run without throwing an error.
2017-08-10 10:32:08 -04:00
Juan Manuel Parrilla
2cfb30fc91 Fixes #24414, Added support for a ETCD folders (#24432) 2017-08-10 07:44:05 -06:00
Adrian Likins
220db9cdd2 Better vault pass prompt behav on EOF, more unit tests (#27981) 2017-08-10 09:34:57 -04:00
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
2017-08-10 09:34:16 -04:00
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
2017-08-10 09:25:56 -04:00
Brian Coca
13d2eb6568 fix incorrect joingin of command for chpasswd
fixes #24638
2017-08-10 09:23:13 -04:00
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
2017-08-10 09:18:44 -04:00
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`
2017-08-10 08:55:43 -04:00
Lukas Bednar
29891bff19 ovirt_templates: fixed typo in doc (#27883) 2017-08-10 08:32:36 -04:00
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
2017-08-10 08:32:25 -04:00
Abhijeet Kasurde
f7321a87ca Pep8 fixes for rabbitmq modules (#24590)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-08-10 11:57:11 +02:00
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.
2017-08-10 10:54:13 +02:00
Dag Wieers
eee09565b1 utilities modules: PEP8 compliancy (#27741) 2017-08-10 09:36:28 +01:00
Simon Dodsley
f30589c91d purefa_volume: Fix typo in required_if (#27921) 2017-08-10 09:34:45 +02:00
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
2017-08-10 04:04:49 +02:00
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
2017-08-10 03:50:58 +02:00
giovannisciortino
064c3b837f Fixes #27836: get_url check if directory exists (#27852) 2017-08-10 09:57:19 +10:00
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
2017-08-10 01:51:13 +02:00
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
2017-08-10 09:06:40 +10:00
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
2017-08-09 18:50:53 -04:00
James Hogarth
7ec34b4cb2 ISSUE 25470 - update patch from review details 2017-08-09 13:38:16 -07:00
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.
2017-08-09 13:38:16 -07:00
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.
2017-08-09 16:36:39 -04:00
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.
2017-08-09 16:34:20 -04:00