* Add AWSRetry when describing VPCs to help stabilize integration tests
* Add retry on create_tags because it is possible to reach this API call before the VPC is finished creating
* now get_url and other modules default to module temp dir
also fixed 'bare' exception
* allow modules to work with older versions
* updated docs per feedback
* Bug in del(list) logic. Say you have a list of 4 elements a[0-3]
and you have to remove index 1 and 3, if you remove index 1 first
then list is cut short a[0-2] and does not have index 3
Fix: Remove indexes in reverse sorted order e.g. 3 and 1 in above
example so that order of indexes remain preserved even after deleting
fix is to remove indexes in reverse sorted order
* Add test cases for failed case
In short, it enables portage module to emit emerge
command with --jobs and --load-average options
with and without argument.
To emit emerge with such CLI argument without
a value, the user must set the corresponding
module option to 0.
By default, if these arguments are missing from
playbook they are omitted.
Misc changes:
* Use to_native to ensure crosspython compat
* Adjust jobs and LA options to accept 0 as reset
* Add docstring to emerge_packages
* Explicitly note in doc that False will work as 0
PR #36355 by @webknjaz
* If inventory file isn't able to be parsed by aws_ec2, return an empty dict instead of None
* Raise an AnsibleParserError instead
* remove extra lines
* aws_ec2 inventory plugin - fix path matching logic
Unified tmp accidentally removed the containing tmpdir from the list of
files to fix the permissions on when we're becoming a different
unprivileged user. This resulted in a visible bug for script but not
for patch. This is because patch also uploads the module to the same
temporary directory and the uploaded module also ends up calling
fixup_perms2() which includes the temporary directory. So by the time
patch needs to access the temporary patch file, the directory is
appropriately set.
script's breakage was visible because script does not upload a module
(it's akin to raw in this way). Therefore, we only call fixup_perms2()
once in script and so leaving out the tmpdir in script means that the
containing directory never has its permissions set appropriately.
Fixing both because it does not cause an extra round trip for patch so
any speedup would be minimal and it's better to fix the perms as close
as possible to where we know we need it. Otherwise, changes to
seemingly unrelated code later could end up breaking it.
Fixes#36398
This PR includes:
- A fix for a recently introduced issue wrt. error handling
- Added integration tests for provoked errors
- Influence standard return values using aci library for aci_rest
- Add proxy support documentation
- Documentation update related to #34175
* Allow to deactivate authz objects. Currently only after success.
* Making sure cleanup is done even when module fails (except if fetch_url() fails).
* Make deactivate_authzs eat exceptions so that all authzs are deactivated in case of errors.
This fix adds a common API for getting host system managed object
from either cluster name or host system.
Fixes: #36010
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Remove module from ignore lists and some documentation fix in
digital_ocean_block_storage and digital_ocean module.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* fix nxos_l3_interface tests as n35 doesn't support ipv6
* add terminal dont-ask to nxos_feature and nxos_lldp
* put interfaces in L2 mode for N35
* fix nxos_feature unit-tests
send_command already performs the to_bytes safely on prompts (checking
for None). Without this check the literal 'None' became a subprompt trigger!
Fixes#35662
* Add eos_command doc with more examples
* More examples using cli and eapi transport
* Example on how to handle json output
* Example on handling result output in wait_for
* Fix typo
This fixes, cloning operation where template or existing VM
does not have network or DVPG. Also, adds some strict type checking in
network parameters.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This PR includes:
- Rename 'protocol' parameter to 'url_protocol'
- Add limited integration tests (as we have no public firmware access)
- Add missing examples
ansible-console was calling setup_vault_secrets
twice. Once directly and once via _play_prereqs()
The direct invocation was not setting auto_prompt=False.
However, the direct invocation isn't need at all so
this removes it so only _play_reqs() is used.
That fixes the unrequested vault password
prompting.
Fixes#33027
Start using this to construct shade OpenStack Cloud objects in a
consistent manner. This will let us centralize things like dealing with
password arguments and whatnot. It also allows us to introduce the
ability to pass a fully formed config dict directly to the module.
Migrate all OpenStack modules to use openstack_cloud_from_module.
Have it return the shade library since it's responsible for
importing shade and shade is needed for the exceptions.
Only pull specific OpenStack arguments for the constructor
Rather than passing **module.params to the shade constructor, pull out
only the values that make sense. This should prevent the issues with
module parameters stepping on shade parameters.
Replace module.params.pop with module.params.get
We don't need to pop these anymore since the shade constructor is now
using opt-in values.
Using real urls is ungood. Use example.com domains. Also, get rid of the
antiquated port numbers.
When ACI modules are being used for querying MOs, we should not return
the previous state, as there is no previous state, there's only the
current state.
This impacts a lot of tests that were used to testing the current state
as 'previous'.
* fix loop_control templating
- properly template ALL properites for loop_control
- loop_control inherits from base, it should not, but needs validate/attribute functionality
fixes#24719
* add export option
* added 'export mode' to ansible-inventory
this optimizes the output for exporting inventory vs representing the 'ansible view'
fixes#30877
* added group priority when needed
We identified an incompleteness to parameter dependencies that affects
querying all domain-related objects.
This PR also includes:
- Improvements to integration tests
- Add missing vm_provider types
- Fix examples
This relates to #36131
* adding support for loopback interface
currently the loopback interface lo is not supported with vyos_l3_interface, this commit fixes that. Right now there is a limit of loopback interfaces to just lo, if you want more interfaces you need to use a dummy interface https://wiki.vyos.net/wiki/Dummy_interfaces
* fixing spacing as per pep8 test
fixing issues for sanity test
lib/ansible/modules/network/vyos/vyos_l3_interface.py:120:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:122:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:126:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:128:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:131:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:133:19: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:137:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:140:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:145:15: E111 indentation is not a multiple of four
lib/ansible/modules/network/vyos/vyos_l3_interface.py:148:15: E111 indentation is not a multiple of four
* ugh, missed on spacing issue
* getting rid of continuation lines, the CI system does not like it
This PR includes:
- A fix to the module where domain_type without domain caused havoc
- A fix to the integration tests when querying all binding objects
- Improvements to integration tests
Since we pass information directly to ACI, we sometimes get error messages back to the user that require some additional information or context.
This PR includes:
- Changes to the default error output so the error is easier to find
when searching in e.g. Google
- 3 specific error messages that we have encountered and has confused
our users before
The error message as it was confused me when the value was 'enabled' and
there was also a module parameter named 'enabled'.
enabled is not a valid boolean. Valid booleans include: yes, on, 1, true, ...
So by clearly describing it as a value, the confusion would have been
avoided.
The value 'enabled' is not a valid boolean. Valid booleans include: yes, on, 1, true, ...
* Added metrics_collection management to ec2_asg module to switch ASG metrics on and off.
* Fixed typo in documentation of ec2_asg module
* Removed extra blank line in ec2_asg.py
* Docs fixes for ec2_asg module
* Added integration test for ec2_asg metrics flag
* Trying different syntax for ec2_asg test
* Fix vrf parsing in eos_vrf and eos_eapi module
Fixes#30250
Fix logic to parse vrf when interface value in `show vrf`
command output spans on multiple lines
* Add idempotent test case
* Revert "commented out check tests (#35788)"
This reverts commit 3df2561405.
* `discard_changes()` now uses `exit discard`
instead of just `discard`. Also a slight tweak to avoid a second `exit` after
`exit discard`
This fix adds an additional check if there is no snapshot available
in VM. `rootSnapshotList` is None, if no snapshot is taken.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* hardcoded API profiles in azure_rm_common
* changed azure_rm_securitygroup module to use api_profiles, dynamic models, kwargs on all SDK methods
* changed azure_rm_containerinstance module to use api_profiles, dynamic models, kwargs on all SDK methods
* fixed polling performance issue in azure_rm_securitygroup (default poll interval was 30s)
* Stabilize ec2_vpc_route_table
Wait for route table to be present before attempting to use it
Sleep before getting the final state of the route table in case modifications are incomplete
* Conditionally wait if changes were made
* Simplify logic
This PR includes:
- Fixes related to the recent merge of #31637 and #34537
- A generic fix for a reference for assignment issue
- Fixes to aci.boolean() in order to catch exception
This PR includes:
- payload output on failure, when requested
- add additional kwargs to aci.exit_json()
We may want to enable some of this debug output by default on failure ?
* Exclude parent when copying included task to avoid memory issues. Fixes#35796
* Simplify implicit block squashing to pre-group, instead of post re-parenting
Implement the `v2_playbook_on_handler_task_start()' method in the json
callback plugin to correctly include handlers in the results.
This fixes a bug where the last task in the results returned by
json callback would be wrong if an unconditional handler was triggered,
since the result of that handler would overwrite the result of the last
task.
Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
* Initial (re)implementation of dimensiondata_vlan module.
This module was rewritten because the original implementation was imperative rather than declarative (which is the preferred style, and consistent with our other modules).
Credit for the original module implementation goes to Aimon Bustardo (@aimonb).
* Remove unused imports.
* Improve error message and documentation around expansion of a VLAN's private IPv4 network.
* Split message string over 2 lines.
* Add check_mode support to dimensiondata_vlan module.
ansible/ansible#21218
* Fix errors / warnings reported by Ansible sanity tests.
ansible/ansible#21218
* Remove 'metadata_version' key from documentation.
ansible/ansible#21218
* Return changed=True when changes would be made.
ansible/ansible#21218
* add protocol mapper dict argument spec, documentation for protocol mappers, and documentation for attributes
* reformat docs to stay in line length limit
* better formatting/highlighting for docs
* ooops
copy currently fails if you specify a destination without any directory
component. This is because we take the dirname of the destination for
some processing and no dirname causes issues.
This corrects that by prepending "./" if there is no directory component
in dest.
* basic: allow one or more when param list having choices
* add unit tests
* optimize a bit
* re-add get_exception import
* a number of existing modules expect to be able to get it from basic.py
* Fixing eos_config save option. Was removed when deprecated. Fixing other deprecation documentation. Adding unit tests.
* Fixing removed_in_version for force.
* First bit of fixing temporary to have one source of truth
* Fix pep8
* Remove explicit make_tmp_path() in copy
The copy action plugin sets TRANSFER_FILES=True so it does not need to
set the temporary directory explicitly; the base class's run() method
will do that for us.
* Fix for calling a module's run when a shell has already created a temp path.
* Remember to inform the rest of the world when tempdir is removed
* New strategy for how to warn on passing tmp
Now we just warn when calling the parent class run() early. If the
module does a late call to the parent run() and doesn't make use of the
temporary directory, then we don't check for the possibility that the
user mistakenly is sending tmp in. If we truly deprecate this (rather
than ignoring it forever) then we might want to switch back to checking
for someone passing a value in as tmp.
* Remove tmp parameter from _execute_module as well
* Port all action plugins to not send tmp explicitly
This is now handled inside of _execute_module via the
_connection._shell.tempdir attribute.
Also update warnings and docs to tell people to set the attribute
instead of using _execute_module's tmp parameter.
* Always set local tempdir variable
* [git] Fix fetching branch of shallow clone
* Use absolute file:// paths to make sure git uses shallow clones
* Improve tests
* Fix sanity errors
* Match style according to other (depth) tests
* Improve tests
Now they will fail without the fix of this PR
AWS (and Boto3) supports VPN TunnelOption keys to be specified for VPNs. Specifically (at least at the moment), the options for 'TunnelInsideCidr' (str) and 'PreSharedKey' (str) are particularly noteworthy. One or both may be specified within a 'dict' object (max 2 dicts). AWS defaults shall apply in absence of said parameters.
this was causing issues with keep remote files as the 'local cleanup' would trump the setting.
it will revert back to using the 'remote path' setti.ng for 'localhost' actions.
fixes#35724
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.
* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.
* Addressed ansible-test sanity pep8 and validate-modules errors.
* Added oneandone_public_ip cloud module for oneandone cloud provider. Removed extra modules to adhere to one module per PR.
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.
* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.
* Addressed ansible-test sanity pep8 and validate-modules errors.
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.
* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.
* Addressed ansible-test sanity pep8 and validate-modules errors.
* Added oneandone_private_network cloud module for oneandone cloud provider. Removed extra modules to adhere to one module per PR.
* Updated check mode scenario for remove members, using proper wait_for method in remove_network, renamed private_network_id argument to private_network.
* Fixing validate-modules issue - Documented datacenter.
* Added oneandone_private_network cloud module for oneandone cloud provider. Removed extra modules to adhere to one module per PR.
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.
* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.
* Addressed ansible-test sanity pep8 and validate-modules errors.
* Removed extra modules to adhere to one module per PR.
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.
* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.
* Addressed ansible-test sanity pep8 and validate-modules errors.
* Removed extra modules to adhere to one module per PR.
* New module - elb_target
* Work to add deregister functionality
* Add jurajseffer work on waiting for status change
* List the set of statuses as a choices list
* default target_status_timeout is 60
* Add 'unavailable' as a target status choice per API docs
* Add support to remove targets that are in unused state
* add support for availability zone selection
Fix deregistering targets from used target groups
Fix waiting for unused state for targets that have started deregistering
This fixes a bug when parent's local vars where not available in nested
includes. The bug can only be seen with jinja>=2.9 which changes
how the variable scopes work.
Fixes#34886
* add interfacce_type to absent required if...not sure how this would work without it
* move fex requirement to required_if
* Fix incorrect documentation about port_channels
This patch fixes repeated attempts that the module would make to
re-create an API object. The change stores a copy for later lookup
instead. This prevents uncontrolled tokens from being created.
* Wildcard imports should be taken care of. Enable the pylint check for them
* Remove wildcard import code-smell test as we're now checking via pylint
* Add unused-wildcard-import as ignored in our compat code.
These three files use wildcard imports so that they can export
symbols in a compatible location. The real code lives elsewhere.
So disable the pylint tests for the relevant sections of code.
* aws ssm parameter lookup test case - fails demonstrating no exception when parameter missing
* aws ssm parameter lookup - fail in case parameter doesn't exist
* aws ssm parameter lookup test case - failing case for nice return from path lookup
* aws ssm parameter lookup - convert incoming taglist to a key-value dictionary
* aws ssm parameter lookup - pep8 / style clean up
* aws_ssm lookup plugin rewrite for more standard interface
* aws_ssm module and lookup - introduce integration test and fix:
* aws_ssm module and lookup - error case integraton test and many PEP8 and other cleanups
* aws ssm parameter lookup - Various fixes in response to review + recursive fix & test
* aws ssm parameter lookup - more in response to review - shertel/abadger
* aws ssm parameter lookup unit test - move to mocker according to abadger
* aws ssm parameter lookup - integrate with new documentation fragment
* aws ssm parameter lookup - accept either aws_profile or boto_profile
* aws ssm parameter lookup - eliminate lookup document fragment until env vars are fixed later
* Added server_type parameter - defaults to K8S
* Changed server_type default value to cloud.
* Added server_type entry to documentation and updated server_type choice K8S to k8s_node
* Added support for overriding the default ONEANDONE_API_URL, and custom wait_timeout period for wait_for methods.
* Added firewall_policy, load_balancer, and monitoring_policy cloud modules for oneandone provider.
* Updated OneAndOneResources class and argument specs for monitoring policy and load balancer.
* Addressed ansible-test sanity pep8 and validate-modules errors.
* Removed extra modules to adhere to one module per PR.
* Fixed a typo
the hostname parameter is wrong. It will throw an error: "Unsupported parameters for (vyos_system) module: hostname Supported parameters include: domain_name, domain_search, host, host_name, name_server, password, port, provider, ssh_keyfile, state, timeout, username" It is supposed to be host_name. Only the example for documentation seems to be wrong in the module.