Commit graph

21073 commits

Author SHA1 Message Date
Will Thames
29770a297a Fail with nice error message if elb target_type=ip not supported (#38313)
* Add helpful failure message if target_type=ip is not supported

Create test case for target_type=ip not supported

* Update elb_target_group module to latest standards

Use AnsibleAWSModule
Improve exception handling
Improve connection handling
2018-05-03 08:36:52 -04:00
wang shuang
918b29f0fc [doc] fix a typo in ec2_eni docs (#36571) 2018-05-03 08:36:30 -04:00
Will Thames
b5488b4e45 Change aws_acm_facts name parameter to be domain_name (#36986)
Match AWS's naming for domain name, but provide backward
compatible alias.
2018-05-03 08:35:55 -04:00
Felix Fontein
cb4db82354 Route53 check mode (#37273)
* Adding check mode for route53.

* flake8
2018-05-03 08:29:57 -04:00
Vinay Dandekar
ada2ea4387 Fix ec2_metadata_facts documentation (#37546)
- ec2_metadata_facts does not extend `url`
- Remove url_argument_spec for ec2_metadata_facts
2018-05-03 08:29:14 -04:00
cahlchang
e2908ae8df [aws] Add aws_iam_role check mode support (#39002)
* Check mode when adding

* Check mode when deleting

* Add check mode
2018-05-03 08:00:36 -04:00
Sloane Hertel
910bc892c6 ec2_ami: Properly delete snapshots (#39606) 2018-05-03 07:48:29 -04:00
Ganesh Nalawade
afdc2364f2
Fix eos_vlan associated interface check (#39661)
* Fix eos_vlan associated interface check

Fix eos_vlan associated interface check by comparing
the interface in want and have without converting the
interface name to lower

* Update eos_vlan docs
2018-05-03 17:07:30 +05:30
Loïc Blot
88df583af7 New module: AWS storage gateway facts (#39491)
* Add a module to get storage gateway facts

* Review fixes

* Last review fixes

* Add filtering gathering & some fixes

* doc fix

* API error handling

* Remove ec2_argument_spec import

Use imported BotoCoreError and ClientError rather than botocore.exceptions
2018-05-03 07:10:05 -04:00
aaronk1
ca36e07be0 update win_psmodule.py (#39631)
<!--- Fix minor typo in Powershell version requirement -->

+label: docsite_pr
2018-05-03 14:51:00 +10:00
vab2048
8d84039aa8 [ec2_vpc_route_table] Use 'network_interface_id' rather than 'interface_id' (#38499)
Updated documentation to refer to 'network_interface_id' rather than 'interface_id' as the latter results in an error: 'Parameter validation failed: Unknown parameter in input: \"InterfaceId\"'
2018-05-02 22:28:08 -04:00
Alex Stephen
b6aa132033 New module: GCP Compute Backend Services (#38611) 2018-05-02 16:59:27 -04:00
Alex Stephen
394abba1b9 New module: GCP Compute Backend Buckets (#38610) 2018-05-02 14:57:00 -04:00
Ryan S. Brown
9a607283aa Terraform module: pass plan_file argument correctly
Per #39611 the `terraform` module wasn't properly building plan-only
files.
2018-05-02 13:45:24 -04:00
Abhijit Menon-Sen
0a119c391a Only expand '~' based on become_user/remote_user
Change brought forward from #00c023e in stable-2.5.

Closes #39281 (bug report)
Closes #39540 (PR with substantially the same change)
2018-05-02 22:50:41 +05:30
Brian Coca
70d89b5487 use actual ssh executable as it might not be ssh 2018-05-02 12:10:25 -04:00
wznoinsk
f2db9d59c7 Update set_stats.py
<!--- Your description here -->

+label: docsite_pr
2018-05-02 11:10:52 -04:00
Ganesh Nalawade
eb5e15e7e0
Fix fetching ios default running config (#39475)
If default option is enable in that case only
add 'all' or 'full' flag
2018-05-02 19:27:56 +05:30
Michele Zuccala
9577cef3ba [cloud] route53_zone: create public zones associated to a reusable delegation set (#39502)
* Add option to specify reusable delegation set while creating public zones

* Add mutual exclusion argument spec for delegation set and VPC/private zone

* Get zone delegation set ID when updating a public zone
2018-05-02 09:25:15 -04:00
Ondra Machacek
17928ff666 ovirt_vms: Fix the module to work with check mode (#37916)
Fixes: https://github.com/ansible/ansible/issues/36712
2018-05-02 08:47:30 -04:00
Sharon Gratch
8bfc92fb27 Add Numa support. (#35838) 2018-05-02 03:52:16 -04:00
Yanis Guenane
dc420fc5fa Allow non-inclusion of setup task in junit report
The JUnit callback pushes every tasks in the report. Even the setup
tasks that - sometime - might clutter the report rather than being
useful, based on one needs.

This PR allows one to specify whether or not the setup tasks should be
part of the final report, defaulting to True to be backward compatible
to what is already in place today.
2018-05-02 00:00:36 -07:00
Adam Miller
69affddc7f
Add firewalld Rich Rule port forwarding example (#39534)
Example provided by Mike Cardwell (@mikehardenize) in an issue
comment 28349#issuecomment-385354551

Signed-off-by: Adam Miller <admiller@redhat.com>
2018-05-01 16:33:34 -05:00
Jordan Borean
04ae0c3312
winrm: removed old exec_command that is no longer used (#39572) 2018-05-02 07:04:53 +10:00
Dennis Conrad
77f5a8f422 Add AWS Inspector Target Module (#37464)
* Add AWS Inspector Target Module

* "ansible-test sanity" Fixes

* * Rename module
* Add integration test
* Incorporate feedback from s-hertel
2018-05-01 16:04:03 -04:00
Ondra Machacek
88b3b14a9c ovirt: fix quota_id check (#39568) 2018-05-01 14:26:34 -05:00
Eike Frost
6b554deb28 keycloak_client: add aliases for module options (matching API) (#39507)
* add aliases for module options which match API endpoint

* directAccessGrantsEnabled fixed in docs
2018-05-01 14:10:41 -05:00
Eric O'Callaghan
c11248c456 Update redhat_subscription.py (#39512)
fixed small typo of depracated to deprecated in redhat_subscription doc

+label: docsite_pr
2018-05-01 14:09:13 -05:00
Matt Martz
65049b6c42
Set default=no in import_role and include_role for private. Fixes #21077 (#39566) 2018-05-01 12:19:04 -05:00
Matt Martz
6acdc36317
Ensure we don't overwrite handlers from include_role when loading a play. Fixes #18140 (#39563) 2018-05-01 12:18:36 -05:00
Sam Doran
5a6bdef76b Only change expiration date if it is different (#38885)
* Only change expiration date if it is different

Modify user_info() method to also return the password expiration.
Compare current and desired expiration times and only change if they are different.

* Improve formatting on user tests

* Add integration test for expiration

* Add changelog fragment

* Improve integration test

Skip macOS and use getent module for validating expiration date.

* Fix expiration change for FreeBSD

* Don't use datetime since the total_seconds method isn't available on CentOS 6

* Use better name for expiration index field

Use separate tasks for verifying expiration date on BSD

* Use calendar.timegm() rather than time.mktime()

calendar.timegm() is the inverse of time.gmtime() and returns a timestamp in UTC not localtime
Add tests that change the system timezone away from UTC

* Mark tests as destructive and use test for change status

* Fix account expiration for FreeBSD

Use DATE_FORMAT when setting expiration date on FreeBSD. Previously the argument passed to -e was an integer of days since epoch when the account will expire which was inserted directly into master.passwd. This value is interpreted as seconds since epoch by the system, meaning the account expiration was actually set to a few hours past epoch.

Greatly simply comparing desired  and current expiration time by using the first three values of the struct_time tuple rather than doing a whole bunch of manipulations of the seconds since epoch.
2018-05-01 11:19:01 -04:00
Brian Coca
b9f7f582d1
remove properties from vars in include_role (#38968)
* remove properties from vars in include_role
* also from_ args
2018-05-01 10:16:59 -04:00
Dag Wieers
e9270fb100 mail callback: Exception info less important
So it seems on failure the last raised (but handled) exception is being
added to the task failure result, which makes it often unrelated to the
actual failure.

Since we assumed the exception was always related, using the exception
information for the subject is plain wrong (and let me to debug
completely unrelated ghost issues).

Also the exception details are now moved back in the output. Maybe we
should not show it unless there's no other information ? But at least it
should not be the mail's subject.
2018-04-30 21:45:10 -04:00
Toshio Kuratomi
81b2529159 Fix when template paths contain non-ascii chars and using the path in ansible_managed
Fixes #27262
2018-04-30 16:47:27 -07:00
Matt Martz
cca96b8c9d
Pass vars from import_playbook in early (#39521)
* Pass vars from import_playbook in early, as they may be needed to parse the imported plays. Fixes #33693

* Add test for import_playbook vars
2018-04-30 16:13:43 -05:00
Ryan Brown
269d682f70 Move camel2snake and snake2camel to common/dict_transformations.py (#39498)
Since it will be used outside just AWS modules, this commit moves
`camel_dict_to_snake_dict` and `snake_dict_to_camel_dict` functions into
a new module_utils file under common/ to match their wider usage.
2018-05-01 06:50:32 +10:00
David Davis
2d21c7da17 Allow the galaxy client to fetch from a url in role version data (#39396)
Currently if the ansible-galaxy client fetches a role from a galaxy
server, it then fetches the role from Github. This change allows a
galaxy server to provide an alternate source url that points to an
archive that contains the role version.
2018-04-30 15:47:43 -05:00
Matt Martz
c0043444c9
Remove unneeded imports in load_list_of_blocks (#39523) 2018-04-30 15:39:10 -05:00
Adam Miller
5eaf043711
refactor firewalld module, add firewalld module_util (#37603)
* refactor firewalld module, add firewalld module_util

This change is meant to enable the addition of advanced feature
specific firewalld modules that will have different module option
patterns than what fits in the current firewalld module, while
keeping as much common code as possible in the module_util

Signed-off-by: Adam Miller <admiller@redhat.com>
2018-04-30 15:33:28 -05:00
Matt Martz
240b060c02
Use the computed role name instead of 'role'. Fixes #38838 (#39516) 2018-04-30 14:41:13 -05:00
Tim Rupp
5f9b7046ed
Adds bigip management route module (#39520)
This module can be used for managing the management routes on a bigip
2018-04-30 12:30:13 -07:00
Sloane Hertel
ec9c59f52b [ec2_vpc_net] Add retries to describe_vpc_attribute call (#39256)
* [ec2_vpc_net] Add retries to describe_vpc_attribute call

* Use new AnsibleAWSModule client-based waiters
2018-04-30 15:27:22 -04:00
Will Thames
cc06f4cba1 Improve deprecation message for ec2_vpc_dhcp_options modules (#38459)
Make it clear to user why ec2_vpc_dhcp_options and
ec2_vpc_dhcp_options_facts have been deprecated
2018-04-30 15:17:15 -04:00
Alex Stephen
18b463e17b New module: GCP Container Clusters (#37324) 2018-04-30 15:04:56 -04:00
Tim Rupp
609b1827e1
Adds log publisher module for f5 (#39518)
This module can be used to manage log publishers on a bigip
2018-04-30 11:55:05 -07:00
Tim Rupp
c0cea32f61
Adds log destination module for f5 (#39513)
This module can be used to manage log destinations on a bigip
2018-04-30 11:25:09 -07:00
Artem Goncharov
59b9c5f119 Fixes 30786 - add server response to the failure (#39371)
* Fixes 30786 - add server response to the failure

* replace str(e) with to_native(e) according to code review
2018-04-30 14:18:06 -04:00
Alex Stephen
d39b1ff664 New module: GCP Storage Bucket Access Controls (#37289) 2018-04-30 14:03:02 -04:00
Lars Kellogg-Stedman
ebe7666d71 add 'localhost_warning' configuration option
Add the 'localhost_warning' configuration option. When set to 'false',
this will prevent Ansible from issuing a warning when the inventory is
empty and it is using an implicit inventory with only 'localhost'.

Closes #17086
2018-04-30 13:27:32 -04:00
Tim Rupp
0cb11c61ac
Various f5 module fixes (#39510)
Mainly fixing coding conventions. Also, added ipv6 suppor to pool members
2018-04-30 09:48:41 -07:00
Dag Wieers
6a08b16c37 Ensure remove files work when file was already removed
If a file disappears when you are removing it, this will ensure it
doesn't fail and continues as expected.
2018-04-30 09:10:09 -07:00
KrdLab
f3399a5e34 Add returning values to the rds_subnet_group module (#39077)
* Add return values to rds_subnet_group module
2018-04-30 12:01:47 -04:00
Luke Short
49e3f60c42 ovirt: Update documentation to showcase that the Python SDK 4.2.4 is required. (#39169)
This is related to the GitHub PR#35841. Some documentation was missed and did not get updated with those patches.
2018-04-30 10:01:51 -04:00
Ikrom
b667126d35 Update example in lookup dict.py (#39488)
Typo fixed
2018-04-30 16:06:58 +05:30
Luke Short
65c19c3629 ovirt_vms: Clarified graphical_console arguments. (#39455)
For protocol, it should be a list and all
of the values are expected to be lowercase.
An example is also added to show how to add
both Spice and VNC consoles to a VM.
2018-04-30 05:06:17 -04:00
Jordan Borean
0d1daf4de8
Ansible.ModuleUtils.SID - allow SID as an input to allow people to specify well know SIDs instead of the name (#39400) 2018-04-30 16:18:25 +10:00
Toshio Kuratomi
2976b653ce Need to convert filenames to byte strings before using them in APIs
Under a non-utf-8 locale (for instance, LC_ALL=C), passing a non-ascii
filename to many APIs will traceback.  Fix that by explicitly converting
to byte strings before passing to external APIs.

May fix #27262
2018-04-28 08:56:36 -07:00
Abhijeet Kasurde
3f9e4b16fe
VMware: correct comparison for guest_id (#39291)
This fix corrects the comparison of system generated guest_id with
user provided guest_id. Module used to report change even if the
guest_ids were same. For example, user provided guest id rhel7_64guest
and VMware returned guest id rhel7_64Guest are logically same but
 lexicographically different and due to this module use to report
change even if there is no change applied.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-28 20:27:53 +05:30
Pilou
019decd29a doc: Add missing parenthesis in first_found example (#39420) 2018-04-28 14:59:07 +02:00
Michael Price
fdcece5c38 Update NetApp module_utils to use correct license (#28070)
The NetApp module_utils file should be using a BSD license. This
patch updates the license.
2018-04-28 08:35:19 -04:00
Abhijeet Kasurde
ed141f1eab
VMware: Refactor vmware_vswitch (#36091)
* Update documentation
* Update logic
* Added idempotency
* Added Error handling

Fixes: #36030

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-28 16:31:45 +05:30
Abhijeet Kasurde
57a009d4c7
VMware: vmware.py refactor (#36976)
* Remove unused `find_entity_child_by_path` API
* Remove unused `fetch_file_from_guest` API as this has separate module
  vmware_guest_file_operation
* Remove unused `push_file_to_guest` API as this has separate module
  vmware_guest_file_operation
* Refactor exception variables
* Change GPL License boilerplate to one-liner

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-28 16:11:21 +05:30
Bryan Black
958ba1469b Fix awkward plural in git module (#39399) 2018-04-28 10:25:43 +05:30
Matthew Stone
d2a1c1ffe5 Adding slxos-facts module and tests. (#39121) 2018-04-27 20:58:13 +01:00
Alicia Cozine
4801bf96a5 fixes broken link in aci module docs (#39247)
* fixes broken link in aci module docs

* makes correct fix for aci broken link
2018-04-27 21:24:18 +02:00
Matt Martz
7db5ce2c86
Ensure handlers have proper parent (#39426)
* Ensure role handlers are parented correctly. Fixes #36518

* Add delegate_to test for include_role handlers
2018-04-27 12:03:57 -05:00
Sloane Hertel
9864f874d4 [aws] Increase possible wait time for nonmonotonic subnet attributes (#38960) 2018-04-27 12:10:22 -04:00
Sloane Hertel
44dd9ce80d [aws] Skip ec2_vpc_subnet waiters for old botocore versions (#39171)
Fix ec2_vpc_subnet for botocore versions that do not accept the WaiterConfig parameter
2018-04-27 12:06:26 -04:00
David Passante
200a0bce67 cloudstack: new module cs_role_permission (#37065) 2018-04-27 16:47:07 +02:00
Jordan Borean
25dea1f72c Change except Error when trying to get a missing option 2018-04-27 09:47:18 -04:00
The Fox in the Shell
efe7c20100 LDAP: Refactor and add ldap_passwd module (#33040)
* modules/net_tools/ldap: Refactor shared options
* modules/net_tools/ldap: Refactor shared code
* modules/net_tools/ldap: Add ldap_passwd module
* modules/net_tools/ldap/ldap_passwd: More robust change check
* In some deployments, using compare_s results in spurious “changed” results,
while bind is more reliable.  The downside is that it results in an extra
connection, and the code it more involved.
* ldap_passwd: Rename methods passwd_[cs]
* ldap_passwd: Remove unecessary type=str
* ldap: Factor-out failure cases
* ldap_passwd: Provide more precise error messages
* ldap_passwd: Irrelevant syntax changes
* ldap_passwd: Rename u_con to tmp_con
* ldap_passwd: Keep HAS_LDAP local
* LDAP doc update
* Resolved all copyright related issues
* Resolved self.fail calls
* Update documentation

Signed-off-by: The Fox in the Shell <KellerFuchs@hashbang.sh>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-27 15:54:05 +05:30
Miguel Angel Muñoz González
19e1f41837 Initial commit for fortios_webfilter (#37196)
* Initial commit for fortios_webfilter
2018-04-27 10:47:58 +01:00
Olivier Bourdon
a3f2e99864 Fix for changing method only on specified interface (#39015)
Test added for interface method change
2018-04-27 05:18:19 -04:00
Ryan Brown
86db62c0e9 [AWS] report boto3/botocore versions during fail_json_aws (#39298)
* [AWS] report boto3/botocore versions during `fail_json_aws`

When modules call `fail_json_aws` and boto3 is installed, gather the
boto3 and botocore versions so that any new AWS module issues will
include the user's boto3 installation info. This will make debugging
issues where features aren't available yet easier.

* PEP8

* Switch to `dict` rather than tuple returns
2018-04-27 10:05:41 +10:00
Jordan Borean
4b57fa91d0
win_file: Handle [] in paths, fix touch in check mode (#37901)
* win_file: Handle [] in paths, fix touch in check mode

* Fixed typo for p/invoke command
2018-04-27 07:57:16 +10:00
jctanner
bbfe7a8b2f
more debug logs for free, network_cli, paramiko and add hostname context to debugging messages (#39205)
* Add hostname context to debugging messages
* Set paramiko's channel
2018-04-26 17:10:28 -04:00
Martin Krizek
5dd8977cfa Fix nested noop block padding in dynamic includes (#38814)
* Fix nested noop block padding in dynamic includes

* Address issues from the review

* Fix typo
2018-04-26 15:14:31 -05:00
Matt Martz
4b01b92cfe
Update TaskInclude _raw_params with the expanded/templated path to file (#39365)
* Update TaskInclude _raw_params with the expanded/templated path to file

* Add tests to validate host vars include paths
2018-04-26 14:25:02 -05:00
Matt Martz
2f5161628a
Don't skip conditional exception on includes (#39377)
* task_executor.py: Raise 'conditional exception' in case of 'include_*'

Fixes #33632

Signed-off-by: Patrick Ringl <patrick_@freenet.de>

* Re-organize tests, add static include test with undefined var

* Remove unnecessary conditional
2018-04-26 13:39:44 -05:00
jctanner
05830658bc
task_executor send the task as a kwarg to connections (#39341)
* make taskexecutor send the task as a kwarg to connections

* Fix line length error

* Send just the task uuid
2018-04-26 14:17:16 -04:00
Toshio Kuratomi
7bcbab70f0 Clarify the comments for action_write_locks
Also explain why there's no special optimization for service managers at
the moment
2018-04-26 09:42:18 -07:00
Brian Coca
d76298b5d3 call diff callback also when task diff is true (#39366)
fixes #31129
2018-04-26 12:18:17 -04:00
Toshio Kuratomi
83c1cba511
Fixes for mode=preserve (#39343)
* Fixes for mode=preserve

* Document mode=preserve for template and copy
* Make mode=preserve work with remote_src for copy
* Make mode=preserve work for template
* Integration tests for copy & template mode=preserve

Fixes #39279

* Changed mode option in win_copy to hidden option as it doesn't reflect copy mode
2018-04-26 07:14:37 -07:00
Ryan Brown
33f358383a
[aws][docs] Add AnsibleAWSModule features to AWS developer guidelines (#38978) 2018-04-26 08:26:03 -04:00
Ryan S. Brown
cd39b8263d [aws] fix misspelling in ec2_instance docs 2018-04-26 08:16:37 -04:00
Ondra Machacek
3a60cde14e ovirt: FCP storage domains don't have to have target (#38882) 2018-04-26 06:43:19 -04:00
Dag Wieers
dca6e2d94d nxos_interface: AttributeError: 'NoneType' object has no attribute 'group' (#38544)
This fixes an issue we recently encounteredi with nxos_interface:

```
Traceback (most recent call last):
  File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 777, in main
    have = map_config_to_obj(want, module)
  File "/tmp/ansible_JmLoba/ansible_module_nxos_interface.py", line 606, in map_config_to_obj
    obj['speed'] = re.search(r'speed (\d+)', body).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
```
2018-04-26 12:27:35 +05:30
saichint
2f99a17856 fix nxos_ntp issues (#39178)
* fix nxos_ntp issues

* review comments

* fix idempotent fail case
2018-04-26 12:09:46 +05:30
Jasper Aorangi
08f071eb7a Fix #26755 by ensuring that the first nic in the nic list is primary (#38994)
* Fix #26755 by ensuring that the first nic in the nic list has primary set to True, and all other nics have primary set to False.

* Fix sanity issues and add test for two nics

* Fix typo in test

* fix nic list

* Ensure the niclist variable is used rather than a niclist string

* Add tests just for dual nic, reverting changes to single nic VM creation tests

* Correct idempotency test
2018-04-25 23:16:25 -07:00
Matt Clay
32d786af65 Convert more http links to https. 2018-04-25 23:12:46 -07:00
Ganesh Nalawade
354454ad58
Fix aruba initial prompt issue (#39195)
Fixes #33414

Issue a newline when the initial connection
results in a prompt and expects user input.
2018-04-26 11:06:27 +05:30
Toshio Kuratomi
0b643009db Winrm encoding in exception fix (#39333)
Exceptions need to use native strings.  We need to make sure we're
combining native strings with native strings.
2018-04-26 07:51:53 +10:00
Alex Stephen
dd735b2122 Bug fixes for GCP Dns Managed Zones (#38631) 2018-04-25 16:20:55 -04:00
Jordan Borean
f8853d83e3
windows: removed deprecated features in 2.6 (#38930)
* windows: removed deprecated features in 2.6

* Comma surgery.
2018-04-26 06:13:37 +10:00
Alex Stephen
8d77c6cc16 Adding support for GCP Compute Https Health Checks (#37437) 2018-04-25 16:11:32 -04:00
Will Thames
12f2b9506d [aws]Add VPC configuration to ECS modules (#34381)
Enable awsvpc network mode for ECS services and tasks and
their underlying task definitions

Improve test suite to thoroughly test the changes

Use runme.sh technique to run old and new versions of botocore to
ensure that the modules work with older botocore and older network modes
and fail gracefully if awsvpc network mode is used with older botocore
2018-04-25 15:41:04 -04:00
Alex Stephen
58bf4ae611 New module: GCP Storage Buckets (#37288) 2018-04-25 15:26:13 -04:00
Alex Stephen
39bf7d3655 New module: GCP Compute HTTP Health Checks (#36329) 2018-04-25 15:25:23 -04:00
Ryan Brown
4dfef45449 [s3_bucket] Increase timeout on versioning check, as it seems to take longer to propagate than other properties (#39325) 2018-04-25 15:24:15 -04:00
Rémy Léone
e45a5e1c86 Add a Scaleway dynamic inventory plugin (#38739) 2018-04-25 13:35:54 -04:00