* Import from urllib and not url
In Python 3, the correct way to import
urlparse is through urllib.parse.
* Use six module to import urlparse
Import urlparse from ansible.module_utils.six.
This way, the import statement is compatible both
with Python 3 and Python 2.
* Fix urlparse import using six module
The correct import is:
from six.moves.urllib.parse import urlparse
* Import six from ansible.compat
* Import from six.moves. Don't make six global.
Prevent code smell by not making six available
in the global namespace and instead importing from
one of its subpackages.
* moved the logging statement
moved the logging statement before the actual action
* added status code check
In the existing implementation when the ssh command fails the command
result is silently discarded. It hides the fact that the disconnection
did not go as expected. Effectively the intended action was not
successful, but the play continues.
* Revert "added status code check"
This reverts commit fe2eb2ae4aeb4812fa2f59ccdfabc9efc677e657.
* added command status code check
In the existing implementation the command is checked for the success.
As a result failed execution is silently discarded. The change tests for
return code and fails if it did not work.
* s3 integration tests
* Make s3 integration tests work in standard integration setup and with fish as current shell
see also https://github.com/ansible/proposals/issues/62 if you don't like this much
* test_s3 integration test - substitute command instead of shell where simple
* test_s3 integration test - random contents + complete elimination of use of shell module by moving to tempfile
* move s3 to integration test targets
* Add a couple more test for . in bucket names
Tidy syntax
remove reference to legacy credentials.yml
remove posix/cli/cloud/aws
* remove from legacy testing
* remove dependencies that aren't used
Refer to 689f135 for similar fix in s3 module. This change makes `OrdinaryCallingFormat` default for handling S3 connections.
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
* New module = elb_target_group
* Update elb_target_group.py
Adds support for adding and removing targets from a target group
* Better error handling
* Bump version_added
* Minor fixes
* Scope ec2 imports, add better doco, fix up examples, allow for both upper and lower case in protocol
* Yaml fixes
* ci fix
* Added targets parameter to doc and added new modify_targets flag to prevent runs from modifying targets
* Update to metadata_version
* Update to metadata support
* Remove defaults for some params. Add tags parameter
* Use paginator to get target groups
* Add tag support
* Add tg attributes to module
* Quote multilines
* Remove unnecessary defaults. Fix multiline
* Fix line ending
* New module = elb_application_lb
* Update elb_application_lb.py
Adds support for rules, adds wait option for ALB creation, adds support for using target group names instead of ARNs when referencing target groups in rules. All additional features should be idempotent.
* Better exception error messages. Bump version_added. Pep8 fixes
* Add missing full stop to description
* Review changes and fixes
* Fix pep issues
* Fix up examples
* Fix pep8
* half way through sorting elb attributes
* Add access logs enabled param
* Finish implementing elb attributes
* Use paginator to get elbs
* Dont snake_case the tags
* Add listeners to return output and fixed up examples
* review changes
* fix line lengths
* pep8 fixes
`e.message` is a string, and `camel_dict_to_snake_dict` fails when
given a string. The intended code is to run `camel_dict_to_snake_dict`
on `e.response`, the result of which includes a `message` key.
Make exception handling lines more consistent and wrap for slightly
shorter lines.
* win_firewall_rule: Small idempotency fix
This PR includes the following changes:
- an idempotency fix when `profile: any`
- better difference output to debug idempotency issues
- documentation fixes (remove `required: false`)
- Parameter handling fixes
- RDP example that matches default RDP rule
- Renamed parameter 'enable' to 'enabled' (kept alias)
- Renamed parameter 'profile' to 'profiles' (kept alias)
* Rewrite module completely
The logic is still intact, but various changes with a single goal:
- Make the module idempotent
- Implement check-mode
- Implement diff-mode
- Adapted integration tests
This fixes#18807 and #23455.
* Change casing to lowercase
* Improve the logic wrt. diff
This is required for modules that may return a non-zero `rc` value for a
successful run, similar to #24865 for Windows fixing **win_chocolatey**.
We also disable the dependency on `rc` value only, even if `failed` was
set.
Adapted unit and integration tests to the new scheme.
Updated raw, shell, script, expect to take `rc` into account.
* apt: include arch in check for installed packages on multi-arch systems
Thanks: Stefan Löwen <stefan.loewen@gmail.com>
Fixes: #24673
* add an integration test for apt's multi-arch handling
The `when` condition templating warning should only happen
if the condition itself contains templating, not if variables
in the condition are themselves composed through templating
Before
```
vars:
x: hello
y: "{{ x }}"
tasks:
- debug: msg=hello
when: y
```
would fire a warning because `y` would get expanded to `{{ x }}`.
This checks whether a warning is required prior to expansion.
* Simplify apply_key_map
* Fix nxapi
* Clean up get_value
* Fix missing non-values
* Add test for existing bgp_af case
* Fix small issues with bgp_neighbor_af
By default, client encoding is determined either from the LANG_*/LC_*
environment variables or using encoding of the database.
Containers used in the CI don't define a default locale, then encoding
of default databases was SQL_ASCII.
This task is only executed when the playbook has already been executed
once, for example using 'ansible-test integration' with '--retry-error'
switch when the first run fails.
This modification allows to recreate default databases (postgres,
template0 and template1) using the same encoding that the one used by
the Debian package.
Default encoding is 'SQL_ASCII' when default locale is not set in
/etc/default/locale.
When an unchanged MD5-hashed password was used and passlib was
unavailable, an useless 'ALTER USER' query was executed.
Once this useless query avoided, the last 'SELECT' query becomes
useless too.