Commit graph

20911 commits

Author SHA1 Message Date
Mat Wilson
8eb94ccbd5 Add support for dzdo flags Fixes #38766 2018-04-16 23:28:51 -04:00
Jordan Borean
f1c16438c1
win_updates: fix when failed is not present in output (#38856) 2018-04-17 10:45:53 +10:00
Brian Coca
3b7f5aef07 name cron 2018-04-16 19:02:14 -04:00
Brian Coca
135ec86eb5 fix exception on lookup ignore error
no log, so only_log ...
2018-04-16 18:04:52 -04:00
Gaudenz Steinlin
0ea7329553 Fix zabbix_host for Zabbix Server versions < 3.0 (#38665)
The tls_* parameters are not present in Zabbix Server versions prior to
3.0. Thus the API response does not contain these keys and the
zabbix_host module failed. This commit adds checks if the parameters are
present in the API response and otherwise just completely ignores these
parameters. The documentation already states that they are not supported
for Zabbix Server versions below 3.0.
2018-04-16 17:57:57 -04:00
Matt Martz
354aa8d602
Skip self._parent on dynamic, defer to grandparent for attr lookup (#38827)
* Skip self._parent on dynamic, defer to grandparent for attr lookup

* Revert _inheritable

* Add tests for include inheritance from static blocks

Fixes #38037 #36194
2018-04-16 16:46:47 -05:00
jctanner
068b9ac523 keep track of original inventory hostname in play context (#38818)
this change further enables the ansible-vcr project to collect fixtures per host in
situations where the host context is totally lost due to delegation.

* Keep some original pre-delegate values in connection options
2018-04-16 17:16:57 -04:00
Brian Coca
265d838ec9 fix displaying group vars in graph 2018-04-16 15:24:31 -04:00
Brian Coca
5828023e54 bool 2018-04-16 15:22:44 -04:00
Brian Coca
1d58585945 minor fixes, also handle 'values' passed to dscl 2018-04-16 15:22:44 -04:00
Adam Furbee
790a117b21 added support for hidden users on macOS 2018-04-16 15:22:44 -04:00
Matt Martz
f474195a3b
Attempt 4: Prevent reparenting a block with itself (#38747)
* More concisely reparent, ensuring we don't go too shallow or too deep in this process. Fixes #38357

* More explicit reparenting, with a short circuit for a common case

* We need new_block to have a parent, otherwise we lose context with this approach

* Remove duplicate parent assignment

* Change callers of Block.copy to not use exclude_parent=True, when including the parent, exclude tasks
2018-04-16 12:33:08 -05:00
Ondra Machacek
8c49c867d2 ovirt_host_networks: Fix removing of network attachments (#38816) 2018-04-16 10:54:19 -04:00
Brian Coca
bdbb89378f
centralize doc/config plugin lists (#38775)
* centralize doc/config plugin lists

also update list for generation in docsite
added note to ensure they are in sync

* updated shell page to list plugins

added some more docs hinting at plugins being configurable

* fix edit link for plugins
2018-04-16 09:29:49 -04:00
Victor Bocharsky
a30befa609 Remove duplicated "instead" word (#38800)
* Remove duplicated "instead" word

* Actually fix the message
2018-04-16 09:23:43 -04:00
Ryan Brown
40b7a63d1a Add docs to AnsibleAWSModule.client retry settings (#38689) 2018-04-16 08:48:10 -04:00
Abhijeet Kasurde
ae7e391dab Minor fixes in terraform module (#38438)
This fix adds following -
* Check for None or blank value in project_path
* Make terraform binary path as required

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-16 08:43:13 -04:00
Abhijeet Kasurde
9ebad79f40 influxdb: Add condition for retries argument (#38441)
'retries' argument was added to InfluxDBClient in version 4.1.0,
versions lower than this fails if retries are specified.
This fix adds a conditional to check if version is greater than equal to
4.1.0 and depending upon that adds 'retries' option.

Fixes: #38204

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-15 22:05:51 -04:00
Martin Krizek
1ff5e975d9 yum: docs: name is not required (#38758) 2018-04-16 07:15:57 +05:30
Sébastien Portebois
f2b65fc5fe Fix documentation for aws_ssm and aws_ssm_parameter_store (#38352)
Fix typos aws ssm vs aws_ssm and quotes
2018-04-14 13:29:47 +10:00
Brian Coca
b4d235ca8d minor fixes 2018-04-13 18:50:42 -04:00
Simon Dodsley
c5b3a5edbe Add new Pure Storage module to discover facts for FlashArray (#37263) 2018-04-13 17:22:30 -05:00
Stanislav Simovski
a00abcb003 [terraform] Fixed typo in preflight_checks (#38740)
The function was incorrectly reporting project path when it failed to find binary.
2018-04-13 16:32:41 -04:00
Job Evers‐Meltzer
636e705260 fix user module error when generating ssh keys w/o a home (#29055)
* Fixes https://github.com/ansible/ansible/issues/29028

* raise Exception when no home directory
2018-04-13 16:22:53 -04:00
abelbabel
c1e4ef39cb fix of some problems with user modification with skeleton informations under FreeBSD (#34694)
* respect skeleton argument in usermod mode for FreeBSD

* use FreeBSD's own (more sophisticated) home creation function rather than ansible's create_home(), which does not handle skeleton files correctly for FreeBSD
2018-04-13 16:22:17 -04:00
Lutz Reinhardt
d512bed495 fix bug in modules/system/user.py (#37552)
for freebsd tool "pw" use date not days in "modify_user"
2018-04-13 16:21:22 -04:00
Abhijeet Kasurde
9b139baacb
VMware: Set default network type as 'dhcp' (#38518)
If user does not specify any network type then set network type
to dhcp. There are additional checks around 'ip', 'netmask' and
'type' in network spec.

Fixes: #38466

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-13 23:21:39 +05:30
Ryan S. Brown
53a3b8b602 [cloud] Use correct string types for comparisons in ec2_instance 2018-04-13 10:29:53 -04:00
Abhijeet Kasurde
2367130ba3
VMware: correct documentation for datacenter (#38718)
This fixes documentation related to datacenter in vmware_guest_find
module.

Fixes: #38290

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-13 18:34:45 +05:30
Vinay Dandekar
bed5f7317d Remove boolean check for underscore in IAM role (#38664)
Underscore is a valid character in an IAM role, per the docs https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html
2018-04-13 08:46:26 -04:00
Trishna Guha
ed25b56772
Pattern to catch string post to ERROR nxos terminal plugin (#37237)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-13 06:55:49 -04:00
saichint
1d975bdc93 fix nxos_ntp_options (#38695) 2018-04-13 06:17:32 -04:00
Ondra Machacek
efa7ebb8a5 ovirt_disks: Fix fail condition for LUN disk (#38726)
Fixes: https://github.com/ansible/ansible/issues/38661
2018-04-13 05:54:18 -04:00
Andreas Nafpliotis
8f5320435f Use correct esxi host variable in vmware_cfg_backup (#38721)
Fixed bug where hostname could not be found and minor documentation changes.
2018-04-13 14:21:37 +05:30
Ganesh Nalawade
88662d0c56
Fix in eos get_config cliconf api (#38682)
If format is passed as None to get_config api, wrong command is
genereted ie. `show running-configuration | None | section interface`.
Add format type in command only if format value is either not `text`
or  `None`.
2018-04-13 13:20:23 +05:30
Deepak Agrawal
6de49f084c
doc for _config backup argument (#38650) 2018-04-13 12:48:49 +05:30
Abhijeet Kasurde
f1cd254265 nmcli: change default value of autoconnect (#38676)
There was discrepancy between documentation and actual code.

Fixes: #38671

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-12 12:10:40 -04:00
Andreas Nafpliotis
c0243a8a31 fixed documentation to include esxi host (#38668) 2018-04-12 10:18:04 -04:00
Bajczi Levente
cdb064289b Fixing minor typo (#38662)
[...] the grafana_api_key only belong to one organisation [...] -> [...] the grafana_api_key only belongs to one organisation [...]
2018-04-12 10:12:35 -04:00
Maxim Kurganskiy
9f3491d035 Examples: Edit mistake (#38657) 2018-04-12 10:04:32 -04:00
Ewoud Kohl van Wijngaarden
d303c0706c Make the foreman callback more defensive (#36527)
* Foreman: Make the foreman callback more defensive

This ensures the ssl_verify attribute is always set. It also handles
None in _disable_plugin.

* Foreman: Handle ints in verify_certs

The default value for verify_certs is 1 which is an int. That has no
lower() function. By casting it to a str we can handle it later in
_ssl_verify().

* Foreman: Clean up coding style

* Foreman: Use get_option in favor of _plugin_options
2018-04-12 09:58:57 -04:00
Pilou
db80504839 firewalld: fix AttributeError (#38442)
Error was:
  File "/tmp/ansible_qY_BMb/ansible_module_firewalld.py", line 703, in <module>
    main()
  File "/tmp/ansible_qY_BMb/ansible_module_firewalld.py", line 548, in main
    module.fail(msg='firewall is not currently running, unable to perform immediate actions without a running firewall daemon')
AttributeError: 'AnsibleModule' object has no attribute 'fail'
2018-04-12 08:43:00 -05:00
Brian Coca
a4046d3424
better error when wrong type passed to import_play (#36592)
fixes #36576
2018-04-12 09:37:04 -04:00
Brian Coca
d78da403b6
allow user control of lookup error behaviour (#35932)
* allow user control of lookup error behaviour

this does not affect undefined vars, only other exceptions raised by a lookup

i.e lookup('file' ..) not finding a file
2018-04-12 09:35:00 -04:00
Alex Stephen
9de9633cac [GCP] New module GCP DNS Resource Record Set (#35920) 2018-04-12 07:31:43 -04:00
Jordan Borean
2fc3ac3516 win_setup: fix for machine sid to work in domains with lots of users (#38646) 2018-04-12 06:01:16 -04:00
leongold
b9d97d85f6 Add options field to bond structure. (#38512)
This change allows users to pass bond options
alongside bond mode, in order to allow greater
flexibility for bond creation. Previously,
bond options were derived from bond mode, e.g.
"miimon" was set to 100 for mode 3 (load-balance),
however a user may want to use 200.
2018-04-12 04:09:50 -04:00
Ryan Currah
91da1653e0 Added sumologic callback plugin (#38297)
* Added sumologic callback plugin

* Better comments
2018-04-12 00:34:48 -04:00
Will Thames
3b74dc2f6e Improve aws_ec2 plugin documentation (#37689)
* Better formatting
* More examples
2018-04-11 23:01:18 -04:00
flowerysong
b345b79dcd aws_ec2 inventory: add support for tag values as hostnames (#35880) 2018-04-11 19:34:06 -04:00
Sam Doran
90a7b3bef3
Change version added to 2.5.1 (#38604)
A bugfix backported to 2.5 also contained the new toggle option. The release
manager approved backporting this added feature to the dot release, so updating
devel to accurately reflect when the fetaure was added.
2018-04-11 17:52:27 -04:00
Brian Coca
6ef389617a
check types for template parameters (#37257)
this should give a better error than when failing on random methods when parameters where the wrong type.
2018-04-11 14:00:18 -04:00
Yuwei Zhou
8a0c192c36 Fixes new created lb doesn't return anything (#38560) 2018-04-11 13:22:27 -04:00
Brian Coca
cc1c7c63db
ensure 'home' translations (#36755)
* ensure 'home' translations

* removed slash as it created issues on diff plats
2018-04-11 11:53:05 -04:00
Brian Coca
d9430b79f9
Ensure non ansilbe exceptions keep tracebacks (#37523) 2018-04-11 11:52:12 -04:00
saichint
ed42331105 fix nxos_igmp_snooping issues (#38566)
* fix nxos_igmp_snooping issue

* shippable error fix
2018-04-11 10:14:27 -04:00
Samer Deeb
0d79268a6d issue:38321 fix onyx_config module failed while using python = 3.5 (#38343) 2018-04-11 08:01:54 -06:00
Simon Dodsley
d9b3b3f745 Add module to configure Pure Storage FlashArray Directory Services (#37350) 2018-04-11 08:17:25 -05:00
Matthew Stone
5b1a8ee1e8 Adding slx_command module and supporting module_utils. (#38235)
* Adding slx_command module and supporting module_utils.

This commit adds the slx_command module and tests as well as the
required slxos module_utils.

* Update copyright in header

* Adding missing module init

* Cleaning up shebangs/licensing.

* Incorporating feedback

Removing reference to `waitfor` alias in `slxos_command` module.
Adding `Extreme Networks` to `short_description` of `slxos_command` module.

* Adding cliconf tests

* Fixing 3.X tests

* Adding docstrings to test methods for slxos cliconf tests

* Adding slxos terminal tests

* Adding slxos module_utils tests

* Adding Extreme Networks team members to BOTMETA.yml
2018-04-11 12:59:34 +01:00
Maish
8f6ee2a5ca Added empty default for name parameter (#38514)
* Added empty default
Fix for issue https://github.com/ansible/ansible/issues/38482
2018-04-11 17:21:06 +10:00
Ganesh Nalawade
16c2d3717e
Add junos connection type check (#38527)
junos_netconf works only with connection=netconf
Add check to report appropriate error if any other
connection type is used.
2018-04-11 12:07:56 +05:30
Ganesh Nalawade
53d3e7e306
Add troubleshooting URL for persistent socket path related issue (#38542)
* Add troubleshooting URL for persistent socket path related issue

socket path timeout related error messages are not displayed on the
console as the ansible-connection process does not have access to it.
Until this is fixed need to point to troubleshooting URL so that
users can take corrective actions.

* Fix CI issue
2018-04-11 11:23:23 +05:30
Brian Coca
72b0ed8cb4 fix handling of some exceptions for mail plugin
redid the flow to simplify and dedupe code, also now we capture extra exceptions previouslly  causing traceback
see https://groups.google.com/forum/?#!msg/ansible-project/qhalnkYZMfI/93n8hlEpBAAJ
2018-04-10 22:17:33 -04:00
Brian Coca
886c4edfb9
avoid caching invetnory sources in loader (#38242)
* fix inventory plugin source caching

 - avoid caching invetnory sources in loader in base
 - same fix for yaml plugin
 - idem for 'auto' plugin

fixes #37162

* fix mock dataloader func sig
2018-04-10 22:15:52 -04:00
Brian Coca
399cba1c84 dict2items filter 2018-04-10 18:46:30 -04:00
Brian Coca
2e852fcd6d return empty host list when pattern is empty
fixes #37894
2018-04-10 18:43:29 -04:00
Brian Coca
fda9312379
actual error reporting on failed galaxy clone (#36788)
actual error reprting on failed galaxy clone

also allow debugging to see stdout/stderr from command
handle output for all commands on error
also use std temp dir instead of random
2018-04-10 17:26:17 -04:00
Brian Coca
32cf79c044 show changed in online 2018-04-10 17:25:24 -04:00
Brian Coca
5a333859fe allow for parameterized string functions
now also allow for ending parens

from following, 1, 2, 4 and 5 match, rest are ignored.

	{doc | to_nice_json}}
	{{(doc | to_nice_json)}}
	{{doc | to_nice_json| from_json}}
	{{doc | to_nice_json()}}
	{{doc | to_nice_json(indent=2)}}
	{{doc | to_nice_json(indent=2) | from_json()}}
	{{doc | to_nice_json(indent=2) | from_json}}

fixes #37579
2018-04-10 17:24:27 -04:00
Brian Coca
0c2e7fd841
made missing cli tools non fatal (#37194)
* made missing cli tools non fatal

* remove bare exceptions

these shoudl not be there as they can prevent 'wanted' exits
2018-04-10 17:23:29 -04:00
Brian Coca
42912e1ac8 minimize loading files/plugins
avoids some repetitive loading
 - read config file only once
 - now cache the ini parser per file
 - optimize shell plugin loading

tried to 'optimize' vars_plugins loading but it creates issues with precedence,
probalby due to iterator not being reset, will look into it in subsequent fix/PR
2018-04-10 17:22:31 -04:00
Brian Coca
34c002c771 give hint to users when a file is not found 2018-04-10 17:19:03 -04:00
Brian Coca
eef70d028f
restrore showing stderr on script success (#38177)
* restrore showing stderr on script success

accidentally removed during transition to plugin, with toggle for those
who prefer the quiet way

fixes #33776

* stderr display if no other errors capture first
* fixed issue with error encoding
2018-04-10 17:16:12 -04:00
Brian Coca
1850bb752f
ignore version when deciding callback loading (#38281)
* ignore version when deciding callback loading

The code already defaulted to load the callback if the properties are not present
there was no need for us to also check the version

fixes #38270

* fix error msg on set optoins to use correct name
2018-04-10 17:15:28 -04:00
Andrew Gaffney
95ce00ff00 Allow loading dirs from role defaults/vars (#36357)
This commit moves code to look for vars files/dirs to a common place and
uses it for loading role defaults/vars. This allows things such as
'defaults/main' or 'vars/main' being a directory in a role, allowing
splitting of defaults/vars into multiple files. This commit also fixes
the role loading unit tests for py3 when bytestrings are used for paths
instead of utf8 strings.

This fixes #14248 and #11639.
2018-04-10 17:14:38 -04:00
Simon Dodsley
cc250156c4 Update Pure Storage FlashArray hostgroup module (#38503)
Allow for deletion and additon of hosts and volumes to a
volume group.
2018-04-10 16:06:51 -05:00
Ryan S. Brown
d4e5e385ca [docs][cloud] Include volume_size in ec2 module docs 2018-04-10 16:57:04 -04:00
Simon Dodsley
f97f81ec2e Update Pure Storage FA Host module to allow for mixed protocol hosts (#37078) 2018-04-10 15:50:43 -05:00
Brian Coca
c679186f17 better handling of diff key types in compose
also made separator configurable
fixed some exception types
better error msgs
2018-04-10 15:15:52 -04:00
Philippe Makowski
0f9a66a32c urpmi module improvements (#37596)
* fix urpmi.update path #37432

* improve urpmi

* use get_bin_path rather than hard coding the path

* fix pep8 issue

* avoid using global

* - `RPM_PATH`, `URPMIUPDATE_PATH`, `URPME_PATH`) aren't constants, they should be lowercase rather than uppercase
- shorten too long lines
- remove unused import

* revert removed imports

* use lowercase rather than uppercase

* update doc

* update doc

* update doc after sanity check
2018-04-10 13:10:56 -04:00
Matt Martz
0507c907a9
get_url should accept headers as a dict, instead of only a complicated string (#35470)
* get_url should accept headers as a dict, instead of only a complicated string

* update headers description text

* Add headers string and dict tests for get_url

* Add intg test for string header format parsing error

* Adjust deprecation version ahead 1 release, add the version dict format was added in to description
2018-04-10 11:50:39 -05:00
Daniel Andrei Mincă
89d6c36584 Optimize file handling in the find module (#38192)
* Optimize file handling

Use the best practice of opening and doing operations on an opened file

Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>

* Fix docstring to Sphinx type

- update the docstrings to Sphinx type, as suggested by Toshio
- Move the pattern object assignment outside the context manager, as
  suggested by Matt

Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
2018-04-10 09:01:44 -07:00
Matt Martz
450cfa8776
Handle duplicate headers in the uri module (#33792)
* Handle duplicate headers, and make it easier for users to use cookies, by providing a pre-built string

* Ensure proper cookie ordering, make key plural

* Add note about cookie sort order

* Add tests for duplicate headers and cookies_string

* Extend tests, normalize headers between py2 and py3

* Add some notes in test code

* Don't use AttributeError, use six.PY3. Use better names.
2018-04-10 09:26:51 -05:00
Matt Martz
f1082af73f
Error if a module is found to shadow a reserved keyword (#34649)
* Error if a module is found to shadow a reserved keyword

* Add test for shadowed module

* Bring in functools.wraps for the decorator

* Drop the decorator, make _find_plugin the real function, find_plugin now holds the shadow logic

* Swap order of functions for bottom to top execution order

* Only error for modules

* Add test for loading a lookup plugin that shadows a keyword
2018-04-10 09:26:27 -05:00
Martin Krizek
d97952dbf4
apt: allow for --allow-unauthenticated in upgrade (#38381)
* apt: allow for --allow-unauthenticated in upgrade

* Style fix

* Another style fix

* Add trailing comma
2018-04-10 15:37:41 +02:00
Ryan Brown
56cd8f2d48 Retry creation of tags when DHCP optionset is not found (#38528) 2018-04-10 09:08:41 -04:00
saichint
361437b042 fix nxos_igmp issues (#38496) 2018-04-10 00:05:58 -04:00
saichint
dabe5e6d07 fix nxos_hsrp issues (#38410)
* fix nxos_hsrp issues

* shippable fix

* add examples for md5 auth
2018-04-09 23:54:05 -04:00
Nate
c38617a736 fix for when status codes are provided as a comma separated list (#38080)
* fix for when status codes are provided as an array of strings

* convert status codes to int, additional tests
2018-04-10 12:25:08 +10:00
Will Thames
85d5901b31 Fix broken links in module documentation (#38469)
* Reflect updated names of the aws_batch_job modules
* Remove mention of `lambda_invoke` module which has yet to make it to
  Ansible.
* Update broken rst link in win_dsc module
2018-04-10 11:20:14 +10:00
Jordan Borean
22f2388ef1 winrm: added flag handler for kinit to request forwardable ticket when delegation is set (#37815) 2018-04-09 18:00:19 -07:00
Sloane Hertel
0fe778105b
Fix sporadic errors in ec2_vpc_subnet integration tests (#38473) 2018-04-09 17:03:36 -04:00
Jordan Borean
ccc56e138a
win_updates: handle if module failed to run (#38363) 2018-04-10 05:25:25 +10:00
THIERRY SALLE
6300e71903 Fix authot github account 2018-04-09 14:31:31 -04:00
David Resnick
283ccaa252 lastpass filter: add example 2018-04-09 14:20:21 -04:00
Matt Martz
6332beef65
Add unit tests for ansible.module_utils.urls (#38059)
* Start of tests for ansible.module_utils.urls

* Start adding file for generic functions throughout urls

* Add tests for maybe_add_ssl_handler

* Remove commented out line

* Improve coverage of maybe_add_ssl_handler, test basic_auth_header

* Start tests for open_url

* pep8 and ignore urlopen in test_url_open.py tests

* Extend auth tests, add test for validate_certs=False

* Finish tests for open_url

* Add tests for fetch_url

* Add fetch_url tests to replace-urlopen ignore

* dummy instead of _

* Add BadStatusLine test

* Reorganize/rename tests

* Add tests for RedirectHandlerFactory

* Add POST test to confirm behavior is to convert to GET

* Update tests to handle recent changes to RedirectHandlerFactory

* Special test, just to confirm that aliasing http_error_308 to http_error_307 does not cause issues with urllib2 type redirects
2018-04-09 10:17:43 -05:00
Rémy Léone
eccccfe77f Initial commit for Scaleway Compute (#38285) 2018-04-09 09:00:48 -05:00
Seuf
72120c3cac Grafana datasource module : tls_ca_cert or tls_skip_verify options (#36945)
* Allow to set tls_ca_cert or skip verify for grafana datasources

* version_added in documentation for new options tls_skip_verify

* Added default value for tls_skip_verify option in doc

* Fixed author git account

* Updated author
2018-04-09 14:41:09 +01:00
Ryan Brown
546a406a14
[docs] Add examples to ec2_instance docs (#38479) 2018-04-09 09:14:42 -04:00
Ganesh Nalawade
e10e0d42d8
Fix junos transport check (#38460)
For connection=local check only if the transport value in
provider is cli and the respective module support cli
transport. If not report back appropriate error message.
2018-04-09 16:22:09 +05:30
Martin Krizek
bb6f90ff6f
apt: properly set changed for autoremove/autoclean (#38329) 2018-04-09 11:10:42 +02:00
Martin Krizek
81a8c42115
Give hint when lookup fails on one element list (#38406)
* Give hint when lookup fails on one element list

* Mention wantlist first

* Fix pep8...
2018-04-09 11:08:04 +02:00
Yanis Guenane
99497ce54c openssl_certificate: Handle dump() in check_mode (#38386)
Currently, when ones run the module in check_mode it tries to retrieve
values from the actual certificate generated in the generate() function.

Since in check_mode we call dump() without calling generate(), self.cert
is None, leading to self.cert.get_notBefore(), self.cert.get_notAfter()
and self.cert.get_serial_number() raising an error.

>  NoneType' object has no attribute 'get_notBefore'

The solution is to have two way to handle dump() method, whether its run
in check_mode=True or check_mode=False leading to different way the
information is retrieved.
2018-04-09 09:26:02 +01:00
Abhijeet Kasurde
57738a3ab4
New module: digital_ocean_certificate_facts (#36731)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-09 12:57:11 +05:30
tobald
7f99876274 remove duplicate declaration (#38449)
result['uid'] is already defined at line 2213 in user.py module.
2018-04-08 22:24:32 +05:30
Beni Cherniavsky-Paskin
0c5f03d3f4 manageiq_provider: don't send top-level null fields on creation (#38448)
* manageiq_provider: method docstrings fixes

* manageiq_provider: refactoring step towards DRY

`resource` is now same in `edit_provider()` and `create_provider()`,
to be extracted to main later.

* manageiq_provider: Fix creation of openshift provider

Fixes #38331.
Sending `api_version` to openshift provider would cause error:
"OpenShift api_version cannot be modified"
due to https://github.com/ManageIQ/manageiq-providers-kubernetes/blob/gaprindashvili-2/app/models/manageiq/providers/kubernetes/container_manager.rb#L37

In `edit_provider` we `delete_nulls()` on the whole data being sent
so `api_version` was omitted if not specified.
In `create_provider()` we only did it on endpoints list so `api_version`
was always sent - now doing on whole data.
2018-04-08 12:36:51 -04:00
Pilou
ffee906c54 lvg: don't fail if an unknown physical device is encountered (#38446)
Physical devices are listed using 'pvs' command. Then, for
'/dev/dm-*' devices 'dmsetup' command is used to find pv_name.

An error occurs when 'pvs' command list an unknown device:

$ pvs --noheadings -o pv_name,vg_name --separator ';'
  /dev/dm-0;vg_var
  /dev/mapper/sdb3_backups;vg_data_backups
$ dmsetup info -C --noheadings -o name /dev/dm-0
Device dm-0 not found

Then the module fails:
{
  "changed": false,
  "err": "Device dm-0 not found\nCommand failed\n",
  "msg": "Failed executing dmsetup command.",
  "rc": 1
}

This failure can be avoided when the unknown device isn't used in
module parameter 'pvs'.
2018-04-08 05:04:28 -04:00
Brian Coca
42d15671d0
clarifying docs with first_found (#36951)
better examlpes as this was never really a task loop, but contained inside the lookup itself
2018-04-06 17:19:15 -04:00
Nathaniel Case
e05cad785e
Fall back to ValueError if JSONDecodeError is not available (#38276) 2018-04-06 16:28:39 -04:00
Julien Vey
bab947d854 Migrate s3_bucket module to boto3 (#37189) 2018-04-06 14:33:58 -04:00
Dag Wieers
9bb1ee30bf Required changes to support redirects on HTTP 307/308 (#36809)
* Required changes to support redirects on HTTP 307/308

This ensures HTTP 307 and 308 will redirect the request to the new
location without modification.

* Fix the unused newheaders reference

* Be more compliant

* Add integration tests for follow_redirects=all

* Improve other tests for new behaviour

* Make follow_redirects values more strict
2018-04-06 13:17:14 -05:00
Erwan Quélin
49aac5f8c7 Added module win_pester and relatives integration tests (#37343)
* Added module win_pester and relatives integration tests

* Corrected issues as stated by ansible-test

* Added defaults variable in integration tests

* Added task to install Pester if needed in the integration test

* Corrected error in win_psmodule task

* Added Pester installation with Chocolatey when Powershell version < 5

* Get facts...

* Disabled invoke-pester output

* Added pester_result type

* Added jhawkesworth changes proposal

* Corrected documentation linting

* Corrected linting

* Added dagwieers recommendations

* Added dagwieers recommendations

* Corrected linting errors and task error in integration test

* Corrected error in integration test

* Added dagwieers recommendations

* Corrected requirements in the DOCUMENTATION block
2018-04-06 11:48:45 +01:00
Ondra Machacek
fc7a68875a ovirt_templates: Add new attributes (#38211)
- operating_system
 - memory
 - memory_guaranteed
 - memory_max
2018-04-06 05:04:20 -04:00
René Moser
af3598343d doc: apt, yum: add example with package lists (#38333) 2018-04-06 10:58:51 +02:00
Artem Tiumentcev
fa8b047039 Corrected a parameter name (#38385) 2018-04-06 10:58:01 +02:00
saichint
1bf29651af fix nxos_acl issues (#38283)
* fix nxos_acl issues

* typo fix

* typo fix in sanity.yaml

* another typo fix in sanity.yaml
2018-04-06 00:57:13 -04:00
Abhijeet Kasurde
f355eb621a VMware: Documentation update vmware_guest_snapshot (#38083)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-05 21:23:18 -04:00
Julien PRIGENT
1f3b480142 ec2_snapshot_copy: Add wait_timeout module parameter (#38072) (#38243)
* ec2_snapshot_copy: add wait_timeout parameter
2018-04-06 10:40:16 +10:00
Brian Coca
2afb1090b1 allow incremental update for vars in loop for set_fact/include_vars (#38302)
* fix set_fact/include_vars looping

* tests for all behaviours affected

* add tests with injection off/on
2018-04-06 09:57:34 +10:00
Brian Coca
1b9879ccbf remove unused optoins from inventory cli
fixes #31929
2018-04-05 18:40:24 -04:00
AlanCoding
153c9bd539 Reduce recursion within group methods
This offers an optimization that allows loading larger
inventories of various structure by improving the
scaling laws involved for adding hosts and groups.

The primary speed benefit is the elimination of duplicate
recusion from traversing converging paths.
2018-04-05 18:38:44 -04:00
Jordan Borean
71e8527d7c powershell: display non-ascii characters in command outputs (#37229) 2018-04-05 14:59:51 -07:00
Jordan Borean
fd4d264253
win_setup: Added connection name to interfaces (#37327) 2018-04-06 07:36:38 +10:00
jhawkesworth
ad94d03ba1 Tolerate win line endings on windows module_util load (#37291)
* tolerate windows line endings when loading windows module utils.  Helpful for old custom windows modules.

* add test modules to demonstrate win line ending module load behaviour.

* attempt to fix sanity check failures

* pep8 fix

* explict skip of test modules from shebang check (core modules must still have expected unix style line endings)

* switch to rstrip() following core team meeting feedback
2018-04-06 07:13:31 +10:00
Eric Brown
4e38036bbd Replace the hard-coded temp path in gunicorn module (#38349)
The gunicorn module has a hard-coded reference to '/tmp' which may
or may not be the actual temp directory for an operating system.

This patch replaces '/tmp' with module.tmpdir which should
resolve to the correct temp directory for the OS.

Fixes Issue #36953

Signed-off-by: Eric Brown <browne@vmware.com>
2018-04-05 16:31:21 -04:00
Matt Martz
b794fa4fe7 Expose verbosity as a var, dedupe attr list. Fixes #36170 2018-04-05 16:06:01 -04:00
Ed Costello
0d31d1cd24 [cloud]Add aws_ses_identity_policy module for managing SES sending policies (#36623)
* Add aws_ses_identity_policy module for managing SES sending policies

* Add option to AnsibleAWSModule for applying a retry decorator to all calls.

* Add per-callsite opt in to retry behaviours in AnsibleAWSModule

* Update aws_ses_identity_policy module to opt in to retries at all callsites.

* Add test for aws_ses_identity_policy module with inline policy.

* Remove implicit retrys on boto resources since they're not working yet.
2018-04-05 15:11:12 -04:00
Renato Orgito
dca61cc397 Update docs to reflect support for CDP neighbors (#38051) 2018-04-05 19:14:55 +01:00
Brian Coca
f630d420c6 clarify os x password with user module (#38344)
also removed pointer to non existing example

fixes #36427
2018-04-05 14:13:22 -04:00
angystardust
1f54775581 Clarify the "refresh_inventory" meta task when using a dynamic inventory script (#37575)
Clarify the "refresh_inventory" meta task when using a dynamic inventory script since it was somehow documented in this old mailing list message:
https://groups.google.com/forum/#!topic/ansible-project/ImhePKKDBZM
2018-04-05 10:49:51 -07:00
Andrew Gaffney
8673e1e661 Support for module param defaults (#22648) 2018-04-05 11:44:51 -04:00
Chaitanya Deshpande
f9bd29fe4d Added module for Autoscale Launch Config (#37345)
* Added module for Autoscale Launch Config

* Fixed review comments
2018-04-05 15:51:39 +01:00
Kevin Breit
d5cfc54ef4 Validate SSL in panos_import (#36972)
* Fix bug 36936

* Added version_added to argument and fixed whitespace

* Update panos_import documentation

Update parameter documentation and add note.

* Add type documentation

* added version number for documentation

For real

* Integrated recommended changes

- Added recommended changes from PR

* Changed validate_ssl default back to True considering there is a
note at the top of documentation explaining change

* Format changes based on recommendations from gundalow

* Rename validate_ssl to validate_cert

* Change description to remove SSL reference

* Change url default ih documentation

* Integrated small changes from bug report
- Renamed validate_cert to validate_certs
- Changed documentation for disabling cert validation
2018-04-05 13:29:33 +01:00
shadbarton
613f24a346 Fix typo in apt.py (#38332) 2018-04-05 14:06:12 +02:00
James Hogarth
509f52a8ed ISSUE-37945 output not populated on failure (#37952)
* ISSUE-37945 output not populated on failure

This always includes output, but it is empty on failure.

* handle the other failcases as well
2018-04-05 05:49:10 -04:00
Ryan Brown
1c7b9e66b4 AWS WAF module custom waiter (#37026)
Consolidate waiters to a single file

* Add waiter message with token ID
* Add waiter

Add waiter for WAF change tokens

Working waiter for waf_condition module

Add support for waiters to waf_rule

* WAF data model refactor

* Fix ref to self.client

* Add custom waiters to aws_waf_web_acl

* Allow add/remove rule tasks to operate in parallel, then wait for their change tokens to complete

* Move waiter into run_func_with_change_token_backoff since it is generic to all WAF update operations

* Wait for deletes on waf_web_acl

* Remove always-wait

* Remove waiter retry catch
2018-04-05 11:30:57 +10:00
Milan Ilic
5b703a2a53 Add OpenNebula one_image_facts module (#38169)
* Add OpenNebula one_image_facts module

`one_image_facts` - module for gathering facts about OpenNebula images
Add integration tests

* Add an alias for ids
2018-04-04 22:53:31 +02:00
Martin Krizek
92bb3c2788 Fix grafana CALLBACK_VERSION 2018-04-04 11:26:22 -04:00
Colin Rymer
893b4e9116 Fix spelling of "lookup" across docs and src comments
PR #38273 by @colinrymer
2018-04-04 15:52:55 +02:00
Roman Bolshakov
3c53e2f8ea openvswitch_db: Split key-value pairs correctly (#33335)
Map values can contain commas, e.g.
    - name: Configure OVN bridge mapping
      openvswitch_db:
        state: present                                                                                                                                                                                                                                table: open_vswitch                                                                                                                                                                                                                           record: .                                                                                                                                                                                                                                     col: external_ids                                                                                                                                                                                                                             key: ovn-bridge-mappings
        value: '"vmnet-static:br-vmnet-st,vmnet-dynamic:br-vmnet-dyn"'

Previous behaviour was splitting the value and raised an exception.
2018-04-04 07:49:01 -06:00
Evgeny Fedoruk
5e990301bb Fixing lack of failure when uploaded source is invalid (#37461)
Checking the response status for 400 and throwing exception.
Unit tests updated.

Fixes #37406
2018-04-04 07:48:22 -06:00
John R Barker
a4e932ee9f ansible_ssh_pass is the ENV variable (#38035)
* ansible_ssh_pass is the ENV variable

* ansible_ssh_pass then ansible_password

* priority is top(lower)->bottom(higher)
2018-04-04 07:45:57 -06:00
Samer Deeb
72d42bd065 issue:38167 add support for onyx version 3.6.6000 for onyx_linkagg (#38191)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-04-04 07:43:10 -06:00
Daniel Andrei Mincă
19ca1b2b8a Fix typo in Slack Callback plugin (#38268)
`get_options` is an undefined method from CallbackBase

As a result, remove the trailing `s` letter.

Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
2018-04-04 15:29:49 +02:00
Abhijeet Kasurde
ac9dbdeb10 nmcli: check NMClient, NetworkManager availability (#38076)
This fix adds check for NMClient, NetworkManager availability
while using require_version API.

Fixes: #38042

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-04 05:58:38 -04:00
Ganesh Nalawade
3a4fc4af08
Add error handling for junos in case wrong connection type (#38023)
* Add error handling for junos in case wrong connection type

Fixes #37990

If a junos module doesn't support given connection/transport type
return appropriate error message.

* Fix CI issues

* Fix review comment
2018-04-04 09:54:47 +05:30
Jordan Borean
f37a44430f win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets (#37897)
* win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets

* compare username in lowercase for test
2018-04-03 18:28:10 -07:00
Dag Wieers
3a1cd4d45a
Fix incorrect RN used in module (#38245)
This requires backporting to v2.5
2018-04-04 02:43:58 +02:00
Julien Vey
63a8ae94a7 cloudfront_distribution: fix restrictions (#37476) 2018-04-04 10:26:14 +10:00
Rémi REY
71699d5140 Introduce grafana callback plugin. (#34246)
* Introduce grafana callback plugin.

The grafana plugin plublishes annotations to the HTTP API available in
Grafana 4.6+

The callback publishes:
* An annotation on playbook start, tagged with "ansible",
 "ansible_event_start" and playbook name, example:

```
{
    "text": "Started playbook test.yml\n\nFrom 'pc45.home'\nBy user 'remirey'\n",
    "tags": ["ansible", "ansible_event_start", "test.yml"],
    "time": 1514291163000
}
```

* An annotation on error containing the host and task who failed and
  tagged with "ansible", "ansible_event_failure" and playbook name, example:

```
{
    "text": "Playbook test.yml Failure !\n\nFrom 'pc45.home'\nBy user 'remirey'\n\n'TASK: simulate failure' failed on localhost\n\ndebug: {\"changed\": false, \"msg\": \"Some random failure\"}\n",
    "tags": ["ansible", "ansible_event_failure", "test.yml"],
    "time": 1514291165000
}
```

* A region annotation emitted on playbook stats, tagged with "ansible",
  "ansible_report" and playbook name, example:

```
{
    "text": "Playbook test.yml\nDuration: 1.641703\nStatus: FAILED\n\nFrom 'pc45.home'\nBy user 'remirey'\n\nResult:\n{\"localhost\": {\"unreachable\": 0, \"skipped\": 0, \"ok\": 2, \"changed\": 1, \"failures\": 1}}\n",
    "tags": ["ansible", "ansible_report", "test.yml"],
    "isRegion": true,
    "timeEnd": 1514291165000,
    "time": 1514291163000
}
```

Fixes #34225
2018-04-03 18:51:52 -04:00