Commit graph

16485 commits

Author SHA1 Message Date
Adrian Likins
56b7483b85 More statvfs info for mount facts rebase 12073 (#25454)
* Add more mount point statvfs info including sizes

Based on https://github.com/ansible/ansible/pull/12073

facts.utils.get_mount_size() now returns a dict of most
of the posix statvfs data, including block_size and inode
counts.

Update the facts.hardware classes that use get_mount_size() to
use the new info by mount_info.update(mount_statvfs_inof) to merge.

* add back unit tests for LinuxHardware mount/fs facts

* add test cases for facts.utils.get_mount_size
2017-06-13 15:31:41 -04:00
Sloane Hertel
3bba43a487 [cloud] ec2.py: region is documented as optional; allow endpoints to be used - fixes #24382 (#24470)
* region isn't required for ec2.py; allow endpoints to be used

* move where aws_connect_kwargs is set

* remove camel_dict_to_snake_dict and display error message
2017-06-13 15:12:47 -04:00
jctanner
58db0da5a5 Fix pep8 extra lines error (#25666) 2017-06-13 13:59:23 -04:00
Dag Wieers
bf43eb92f5 win_firewall: check-mode support, integration tests (#25127)
* win_firewall: check-mode support, integration tests

This PR includes:
- Check-mode implementation
- Documentation improvements
- Ensure module output is consistent (no matter what profiles are provided)
- Fixed indentation
- Cosmetic changes
- Integration tests

* win_firewall: check-mode support, integration tests

This PR includes:
- Check-mode implementation
- Documentation improvements
- Ensure module output is consistent (no matter what profiles are provided)
- Fixed indentation
- Cosmetic changes
- Integration tests
2017-06-13 17:32:22 +01:00
Brian Coca
4ee348e564 draft constructed groups plugin (#23374)
* draft constructed groups plugin

can use fact cache as vars source

* pw4er5e
2017-06-13 10:46:40 -04:00
Brian Coca
37acb7423b add deprecation notice for sudo/su cli options (#23983)
* add deprecation notice for sudo/su cli options

* updated as per feedback
2017-06-13 10:46:09 -04:00
Brian Coca
c4169d93e8 add validation to fetch for source/dest
also added missing display
2017-06-13 10:37:14 -04:00
Brian Coca
13d3b27a0a Get warnings/deprecations per item in loop
warnings and deprecations were only returned for the top level of a task, this now deals with them in loop
deduplication still occurs so only unique ones will be shown to user.

fixes #25258
2017-06-13 09:54:00 -04:00
Toshio Kuratomi
90b1d780eb Fix redis cache for python3
According to the redis-py docs, zrank will return the 0 based index for
the value in the sorted set.  So the logic here wasn't right to begin
with (It just means that a value at the 0-th position would never show
up as cached).  Need to compare against None to know if the value
exists in the cache.

https://redis-py.readthedocs.io/en/latest/#redis.StrictRedis.zrank

Fixes #25590
2017-06-13 09:50:46 -04:00
Brian Coca
498aea8acc Revert "Add log_only to debug messages (#25545)"
This reverts commit 9e8cc26720.
2017-06-13 09:29:18 -04:00
Sloane Hertel
00d5de3dec fix return value (#25611)
document the returned
2017-06-13 09:18:58 -04:00
Ganesh Nalawade
9e8cc26720 Add log_only to debug messages (#25545)
Fixes #25544
When `debug` is enabled the debug messages triggered
from `bin/ansible-connection` should be logged only to file
and not on stdout.
2017-06-13 18:41:33 +05:30
Abhijeet Kasurde
f65ced0438 cloudstack: Use errortext from router in cs_router (#25634)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-13 11:11:53 +02:00
Abhijeet Kasurde
b7558f5018 Add missing msg keyword in fail_json (#25635)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-13 11:11:11 +02:00
jhawkesworth
e017bf964e Small improvement to the way the powershell code lines render in win_say module (html rendering only, still does not break lines properly in ansible-doc) (#25624) 2017-06-13 08:18:32 +01:00
netservers
d5becd728e Have cs_host search both name and ipaddress fields when fetching the host from listHosts. (#25628)
Make ip_address an alias of name to allow playbooks to more clearly make
use of IP addreses.
2017-06-13 07:30:59 +02:00
Simon Staszkiewicz
eb7530df95 Correct link to DescribeInternetGateway docs (#25622)
Old link pointed to DescribeRoutingTable documentation instead of DescribeInternetGateway documentation.
2017-06-12 20:30:30 -04:00
Abhijeet Kasurde
0770b1018c Correct variable name in vca_nat module
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 19:36:08 -04:00
Abhijeet Kasurde
a4f1738082 Fail module instead of returning boolean value
Fix added to fail module instead of returning boolean value
which raises AttributeError.

Fixes #21770

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 17:55:22 -04:00
ademmers
025b52938e system/service module initctl location usage (#19712)
* Call initctl version based on initctl's retrieved location

* Remove the use of start/stop/restart in favor of initctl

* Provide correct argument order for initctl usage
2017-06-12 15:29:08 -04:00
Sloane Hertel
3f0c47196e [cloud] s3: deleting a nonexistent bucket should not give a traceback Fixes #25445 (#25487)
* trying to delete a nonexistent bucket should not fail

* Improve error handling for deleting s3 bucket

* Allow successful deletion

* Add test for deleting a nonexistent bucket

rename integration test target from s3 to aws_s3
2017-06-12 13:52:25 -04:00
Abhijeet Kasurde
7521be73c1 Add missing import for get_exception
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 13:18:54 -04:00
Brian Coca
ff4c308359 fixed issue with empty string 'packages'
also cleaned up unused imports/vars
fixes #25582
2017-06-12 12:59:16 -04:00
Abhijeet Kasurde
077a2df1d6 Return exception as string
Pyodbc returns exception as Python Exception class,
typecast as string for fail_json.

Partially fixes: #25010

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 11:26:54 -04:00
Abhijeet Kasurde
da6f6d27e8 Add Description parameter in os_user
Fixes #18914

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 10:56:34 -04:00
Monty Taylor
45f07fdeae Make auto_ip in os_server not always return changed (#25540) 2017-06-12 16:48:46 +02:00
Alan Loi
3ac9273507 Fix hash_key_name to be optional for delete (#25009) 2017-06-12 10:25:43 -04:00
Alan Loi
c23e3c1913 Fix version_added for tags and wait_for_active_timeout params (#24993) 2017-06-12 10:19:41 -04:00
Vinay Dandekar
45019e440f Add Linux Mint to Debian OS family in setup facts 2017-06-12 09:27:03 -04:00
Abhijeet Kasurde
e160bcf237 Correct fail_json call in rpm_key
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 09:11:03 -04:00
willricardo
dd1f5d7acd ec2 module conver basestring to string_types (#25503) 2017-06-12 08:48:38 -04:00
Will Thames
16b877e2b3 ec2_asg and ec2_asg_facts module improvements (#25166)
* ec2_asg and ec2_asg_facts module improvements

Return target group information for both ec2_asg and ec2_asg_facts
modules

Provide RETURN documentation for ec2_asg module

PEP8 fixes for ec2_asg_facts

* ec2_asg: use pagination when describing target groups

In case an ASG has 100s of target groups, ensure that
we get the full result using build_full_result
2017-06-12 07:15:04 -04:00
Abhijeet Kasurde
b89cb95609 Fix spelling mistakes (comments only) (#25564)
Original Author : klemens <ka7@github.com>

Taking over previous PR as per
https://github.com/ansible/ansible/pull/23644#issuecomment-307334525

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-12 07:55:19 +01:00
Pilou
460d932aa8 postgresql_user: fix bugs related to 'expires' option (#23862)
* Factorize tests related to no_password_change using an include task

* Refactor: deduplicate tasks

* postgresql_user: test 'expires' parameter

* Change 'valid until' even it's the only updated field

* value is changed when another value is provided

* value isn't returned when unset

* Remove unused variable

* psycopg2.extras.DictRow is able to handle comparison

* postgresql_user: simplify helper method

* postgresql_user: define variable just before using it

* Fix comparison between user input and applied configuration

* new test: adding an invalid attribute

* Refactor, add cleaning task

* Check that using same attribute a 2nd time does nothing

* Always try to remove created user

* postgresql_user: fix pep8
2017-06-11 14:48:39 -07:00
Abhijeet Kasurde
301cbc1f5b Remove unreachable code from cron module (#25577)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-11 07:35:46 +02:00
Matt Martz
23eebb62e6 Convert docker cmd output to native, early 2017-06-10 07:09:04 -07:00
Matt Clay
a18cc45778 Fix PEP 8 issue. 2017-06-10 14:07:15 +08:00
Brian Coca
5717f4f161 updated cache descriptions 2017-06-09 23:48:47 -04:00
Brian Coca
cdcbd84088 refactor of virtualbox plugin, fixed cache use 2017-06-09 23:48:47 -04:00
Matt Martz
392934f1b9 Fix pep8 issue in lib/ansible/inventory/manager.py (#25562) 2017-06-09 18:40:36 -05:00
Brian Coca
cc66bd4ad0 moved general pattern cache into object
no real reason this is a class global
2017-06-09 15:30:11 -04:00
Adrian Likins
4befefd78c Try to show original exception info for yaml (and other) errors (#24468)
* show original exception for yaml (and other) errors

In places where we need to catch a yaml error and raise
an AnsibleError, add the orig yaml exc to the AnsibleError
via the orig_exc arg.

When the AnsibleError is displayed it will now include the
AnsibleError (AnsibleParserError for example) and the type
and message from the original yaml exception.

This provides more detail to the error messages related to
yaml errors.

This also improves errors from dataloader (for example,
previously if a wrong password was used for a vault encrypted
yaml file, the error was very vague and suggested yaml errors,
but now the message includes the original exception from vault
indicating the password was incorrect or missing).

Add a text note to playbook helper asserts. For playbook
syntax/layout errors that aren't yaml errors, but errors
indicating invalid data structures for a playbook/task/role/block,
we now include some info about where the assert was and
why it was raised.

In places we raise an AnsibleParserError in an except
clause, pass the original exception to AnsibleParserError via
orig_exc arg.

Make assorted error messages a little more specific (like
the playbook helper load methods)

* Revert "Include the original YAML error in syntax error messages"

This reverts commit 781bb44b02.
2017-06-09 13:13:15 -04:00
Abhijeet Kasurde
ccc7f788c0 Fix import for get_exception (#25551)
Fixes #25549

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-06-09 11:58:18 -05:00
René Moser
29817ab115 cloudstack: add tests, fix pep8 (#25518)
* cloudstack: cs_zone: fix pep8

* cloudstack: cs_zone: add tests
2017-06-09 18:48:53 +02:00
René Moser
76c598f044 cloudstack: cs_zone: fix missing type bool for params (#25552) 2017-06-09 18:10:32 +02:00
James Cammarata
81998b963d Re-adding missing os import to wait_for 2017-06-09 10:57:17 -05:00
Chris Atkinson
62fa2019c6 [cloud] Allow IAM certificate secrets, body, chains to be strings (e.g. sourced from ansible-vault) (#24206)
* Allow cert and private pem information to be passed in via string, eg when obtaining sensitive key details from anisble-vault at runtime

* Allow cert chain body to be passed as a string

* Ensure the new options are set in parameters

* Dont publish the private key in logs

* Set the version_added documentation

* Update documentation inline with review

* Removes file based certificates in favour of string only as suggested in feature review

* Documentation changes as suggested by review
2017-06-09 11:32:22 -04:00
Sloane Hertel
b376bde4d7 [cloud] ec2_eni module - allow attaching a new instance - fixes #19452 (#22377)
* fix bug attaching instances

* pep8
2017-06-09 11:31:42 -04:00
Tim Rupp
61684f7313 Updates gtm wide ip module to be feature complete (#25502)
This module is used to manage GTM wide ips on a bigip.
Previously, this module only included a small subset of functionality
primarily related to editing a wide ip that already existed. Additionally
it used the SOAP api for its communication. this patch completes the
feature set of wide ips and refactors the code to use the F5 python SDK
and the REST API.

Unit tests are provided. Integration tests can be found here

https://github.com/F5Networks/f5-ansible/blob/devel/test/integration/bigip_gtm_wide_ip.yaml#L23
https://github.com/F5Networks/f5-ansible/tree/devel/test/integration/targets/bigip_gtm_wide_ip/tasks
2017-06-09 16:07:14 +01:00
Ted
416d9774ce New module: Add Bcf switch module. (network/bigswitch/bcf_switch) (#24261)
* Make access_token type str, remove alias, and make validate_certs default value true

* Remove comma

* Add bcf switch module

* Remove white space in blank line

* Fix yaml

* Try removing the RETURN just like in the other modules
2017-06-09 08:14:28 -06:00