* 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 fe2eb2ae4a.
* 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.
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
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.
* Prevent IndexError when deleting multiple lines
The old code will raise `IndexError: list assignment index out of range` when deleting multiple lines because the indexes of the original and the copy get out of sync. Solved by deleting from the high indexes first so the lower ones remain stable.
* Don't load configuration if nothing to load
Instead of sending an empty candidate config (for example because the candidate only consisted of `delete` lines, and all of them were filtered out by `filter_delete_statements`) just return. JunOS seems to get confused by empty changes, and if the candidate config is empty then it's a no-op anyway.
1) Examples: Remove double space between "option:" and "value"
2) Documentation: Fix rendering usses
3) Documentation: Remove `required: true` to match argspec
* Change default port for aos_login and force type to Integer
* Add check to make sure aos-pyez is present and has the right version
* Update min version requirement in doc
* Change default port in documentation as well
* adding module to control management of sensu silence entries
* adding doc stanza
* fixing some issues
* more cleanup
* fixing defaults
* fixing more doc issues
* fixing examples
* more fixes
- Removed alias autoclean from autoremove.
- Added independent execution of apt-get autoclean/autoremove
- Continued to support --auto-remove as a flag to install/remove
Fixes#22222#24718
Fix adds check for values provided by user for
name and value in sysctl module.
While providing name and value as in-line params,
check for blank values
Fixes#20176
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
the selinux fact is boolean false when the library is not installed,
a dictionary/hash otherwise, but this is ambigous
added new fact so we can eventually remove the type dichtomy and normalize it as a dict
`variable_manager` is passed to the constructor of `PlayIterator`,
and then used to access the fact cache when fact gathering.
Make `_variable_manager` an attribute of the `PlayIterator` class
* Use double-quotes for expect integration tests
* Cast user input to string for expect integration tests
* Remove usage of cmp() for python3 compatibility
- Add code smell test to look for cmp usage
- Fixes#24756
* docker_container: add working_dir (fixes#20044)
Added a working directory option that will get passed with the other
docker container parameters. This is optional and addresses feature
request #20044.
* apk: Allow update and upgrade in same task
* apk: Add repository option
* apk: Add available option
* apk: Add stdout and stderr output where possible
* apk: Add packages return with list of changed packages
* Add doc for password
* Add example to change user password
* Add dot at the end of the doc for password
* Add disclaimer in documentation for password
* Correct provider option name in description
* eos python3 changes
* changes to convert response from byte to text
* Add dellos6 python3 changes
Make `execute_command` arguments and its
return value complaint to PY3 changes
made in PR #24431
* Fix py3 prompt issue for invalid show command
* Fix review comments
* Add generic fix for error prompt in py3
* Fix CI issue
* Fix network_cli unit test failure
* Added timeout to jenkins_script POST request
The timeout value is passed to fetch_url to allow a custom timeout
bigger than the predefined 10 seconds.
* Added version, removed no_log
* Fix expect for python 3
- Change generator next to python 3 compatible
- Added tests for expect
* Add pexpect to integration.txt
- add pexpect library to requirements for integration tests
* Use ansible_python_interpreter in integration tests for expect
* Use double-quotes for expect integration tests
* Cast user input to string for expect integration tests
* Cast user input to string earlier in expect integration tests
* Use ansible.module_utils.six.moves input for expect integration tests
* Fix yamllint errors in the expect test
* Use cat to trigger timeout for expect integration tests
* Use realpath filter in expect integration tests
* draft new inventory plugin arch, yaml sample
- split classes, moved out of init
- extra debug statements
- allow mulitple invenotry files
- dont add hosts more than once
- simplified host vars
- since now we can have multiple, inventory_dir/file needs to be per host
- ported yaml/script/ini/virtualbox plugins, dir is 'built in manager'
- centralized localhost handling
- added plugin docs
- leaner meaner inventory (split to data + manager)
- moved noop vars plugin
- added 'postprocessing' inventory plugins
- fixed ini plugin, better info on plugin run group declarations can appear in any position relative to children entry that contains them
- grouphost_vars loading as inventory plugin (postprocessing)
- playbook_dir allways full path
- use bytes for file operations
- better handling of empty/null sources
- added test target that skips networking modules
- now var manager loads play group/host_vars independant from inventory
- centralized play setup repeat code
- updated changelog with inv features
- asperioribus verbis spatium album
- fixed dataloader to new sig
- made yaml plugin more resistant to bad data
- nicer error msgs
- fixed undeclared group detection
- fixed 'ungrouping'
- docs updated s/INI/file/ as its not only format
- made behaviour of var merge a toggle
- made 'source over group' path follow existing rule for var precedence
- updated add_host/group from strategy
- made host_list a plugin and added it to defaults
- added advanced_host_list as example variation
- refactored 'display' to be availbe by default in class inheritance
- optimized implicit handling as per @pilou's feedback
- removed unused code and tests
- added inventory cache and vbox plugin now uses it
- added _compose method for variable expressions in plugins
- vbox plugin now uses 'compose'
- require yaml extension for yaml
- fix for plugin loader to always add original_path, even when not using all()
- fix py3 issues
- added --inventory as clearer option
- return name when stringifying host objects
- ajdust checks to code moving
* reworked vars and vars precedence
- vars plugins now load group/host_vars dirs
- precedence for host vars is now configurable
- vars_plugins been reworked
- removed unused vars cache
- removed _gathered_facts as we are not keeping info in host anymore
- cleaned up tests
- fixed ansible-pull to work with new inventory
- removed version added notation to please rst check
- inventory in config relative to config
- ensures full paths on passed inventories
* implicit localhost connection local
Reads the directory_mode param as 'raw' type to mirror the same behavior as mode.
This'll cause non-quoted values to be represented as an int, rather than a str.
Covered by 'assert recursive copied directories mode' test.
Fixes#24202
* nxos_evpn_global refactor
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
* ansibot told me to do this
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>