* Make ansible adhoc work with include_role
Fix logic condition so that include_role works
without
```
ERROR! 'async_val' is not a valid attribute for a IncludeRole
The error appears to be in 'None': line 0, column 0, but may
be elsewhere in the file depending on the exact syntax problem.
(could not open file to display line)
```
* Add include_role test for adhoc
* remove external grep call and parse with python
* use function for repeated code
* use module.get_bin_path() for iscsiutil on HPUX
* some code opt for HPUX
* clean up non-module code, module being defined is a requirement for this code
* import get_bin_path() directly and use without module prefix
* Add integration tests for AIX and HP-UX
* add changelog fragment
* Apply suggestions from code review
Co-Authored-By: mator <matorola@gmail.com>
* Apply suggestions from code review #2
Co-Authored-By: Sam Doran <sdoran@redhat.com>
* Remove strict requirement on executable to exist for get_bin_path() as
it will allow facts gathering to continue without an error. Almost all
other files under facts do not have "required=True" (except 2 files,
which should be probably fixed). And check return value for
get_bin_path() , before run attempt.
* add check for AIX lsattr run_command return code
* nxos_snmp_traps: fix 'group: all' for N35 platforms
- `group: all` attempts to enable traps for all features defined in the module's `feature_list`
- `N35` platforms do not support `snmp-server enable traps bfd`; so removing `bfd` from the `feature_list` for that platform
- Minor cleanup in `sanity.yaml` test file
* whitespace lint fix
* Fixes Netconf_config single parameter bug
Fixes 56022
fixed get_config to not require multiple parameters to just run a backup
* Add Integration test for netconf_config
Associated with #56022
tests backup through netconf only using one parameter.
* Added debug to the begin and end of file
* Fix formatting of save config. #56022
* removed blank line at end: #56022
* add vmware_evc_mode module
* alter result message for absent/absent
* Apply suggestions from code review
Co-Authored-By: CastawayEGR <36353334+CastawayEGR@users.noreply.github.com>
* add idempotency test
* change result dict to evc_mode_msg
* refactor to use pyvmomi class
* fix update to only process task on update
* minimize update code
* add single quotes around vars to match other code
* pass datacenter to cluster find
* add check_mode to disable test
This gives us a little more structure to our console logs, which make it
easier for machines / humans to parse. It will be helpful once the
ansible network team starts importing this data into elastic-recheck.
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This has been broken for some time, but only noticed recently. Because
vyos_command isn't supported on ansible_connection=local, update our
testing to account for that.
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Otherwise, we get the following error:
ERROR: ncclient 0.6.4 requires selectors2>=2.0.1, which is not installed.
when running ansible-test.
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Refactoring of the following roles to make use of the new
`prepare_vmware_tests` role.
- `vmware_resource_pool`
- `vmware_resource_pool_facts`
- `vmware_target_canonical_facts`
- `vmware_vcenter_settings`
- `vmware_vcenter_statistics`
- `vmware_vm_facts`
- `vmware_vm_host_drs_rule`
- `vmware_vm_vm_drs_rule`
- `vmware_vmkernel`
- `vmware_vmkernel_facts`
- `vmware_vspan_session`
- `vmware_vswitch`
- `vmware_vswitch_facts`
This patch depends on: https://github.com/ansible/ansible/pull/55719
Original PR: https://github.com/ansible/ansible/pull/54882
* Fix loading namespaced doc_fragments
The syntax for specifying a different fragment name was already
using '.' as a separator, so the code needed to be tweaked to
avoid choking on names like `testns.testcoll.fragname` and
`testns.testcoll.fragname.altvar`.
`get_plugin_class()` returns 'docfragment' for the fragment loader;
mangling `subdir` provides consistent alignment with the normal plugin
directory names and avoids needing special handling of plugin types
with 'module' in the name.
* Add changelog entry
Refactoring of the following roles to make use of the new
`prepare_vmware_tests` role.
- `vmware_drs_group`
- `vmware_drs_group_facts`
- `vmware_drs_rule_facts`
- `vmware_drs_portgroup`
- `vmware_drs_portgroup_facts`
- `vmware_dvs_portgroup_facts`
- `vmware_dvswitch`
- `vmware_dvswitch_pvlans`
This patch depends on: https://github.com/ansible/ansible/pull/55719
Original PR: https://github.com/ansible/ansible/pull/54882
Refactoring of the following roles to make use of the new
`prepare_vmware_tests` role.
- `vmware_inventory`
- `vmware_local_role_facts`
- `vmware_local_role_manager`
- `vmware_local_user_facts`
- `vmware_local_user_manager`
- `vmware_maintenancemode`
- `vmware_portgroup_facts`
- `vmware_resource_pool`
- `vmware_resource_pool_facts`
This patch depends on: https://github.com/ansible/ansible/pull/55719
Original PR: https://github.com/ansible/ansible/pull/54882
* `nxos_acl` may fail with `IndexError: list index out of range` while attempting to delete a non-existent ACL.
The failure occurs when the `acl` var is an empty list.
* nxos_acl: catch 501 'Structured output unsupported' when no ACLs present
With some older image versions, `show ip access-list | json` will raise a 501 error indicating `'Structured output unsupported'` when there are no access-lists configured. This change turns off the `check_rc` and then looks for the failure condition.
* Fix kwarg
* Fix lint issues
* Implement a framework for having common code for release scripts
* Release scripts will go through hacking/build-ansible. build-ansible is
a pluggable script which will set a directory that has common code for
non-enduser scripts. It will then invoke the plugin which implements
that subcommand. Uses straight.plugin for loading each sub-command.
* We're going to add tools which are needed to test ansible (the changelog
generation, for instance) so we need to include the pieces relevant to
that in the tarball.
* Add straight.plugin to the sanity test requirements for the same
reason
* Skip compile test just for build-ansible plugins which won't be run as
part of sanity tests.
Refactoring of the following roles to make use of the new
`prepare_vmware_tests` role.
- `vmware_guest`
- `vmware_guest_boot_facts`
- `vmware_guest_custom_attribute_defs`
- `vmware_guest_customization_facts`
- `vmware_guest_disk_facts`
- `vmware_guest_facts`
- `vmware_guest_find`
- `vmware_guest_move`
- `vmware_guest_powerstate`
- `vmware_guest_snapshot`
- `vmware_guest_snapshot_facts`
- `vmware_guest_tools_wait`
This patch depends on: https://github.com/ansible/ansible/pull/55719
Original PR: https://github.com/ansible/ansible/pull/54882
A couple sanity tests require the packaging module. The azure tests are
dragging it in but list it explicitly in sanity so we don't run into
problems if those are ever split up
* add multi-node manipulation, delete on xpath match only and count capability to win_xml
* fix pep8 and yamllint errors identified by ci tests
* fixed bugs when handling multiple elements, multiple attribute nodes and handling for attribute nodes when using xpaths that only select attributes like //@lang. Added more tests and tweaked documentation.
* fixed line-too-long error
* fixed trailing space errors
* trailing whitespace expunged
* bump version_added to 2.9 for new changes
* fix PSAvoidUsingPositionalParameters sanity check failure
* refix sanity check as it broke the msg return value
* Check variables are defined before using combine filter
* Add tests for the combine filter
* Remove dependencies that should already be installed
* relocate the function to recursively check for undefined vars
add another test
* changelog
This does not fix the tests themselves, only the syntax (converting from playbooks to roles).
The aix_devices test fails due to use of unsupported state values.
* Add custom action class for version info
* Use args from CLI as prog for ArgumentParser object
* Make prog a required parameter of create_base_parser() and update all uses to pass in the newly required parameter.
* Add unit test for checking ansible --version
* Update other related unit tests
* Remove unnecessary delegate_to in tests.
* Remove incorrect delegate_to in tests.
* Remove unnecessary use of local_action in tests.
* Remove incorrect use of local_action in tests.
* Remove unnecessary use of local_action in tests.
* Remove incorrect use of local_action in tests.
* Remove unnecessary use of local_action in tests.
* Use delegate_to instead of local_action in tests.
* Use setup_remote_tmp_dir instead of TMPDIR.
* Support using importlib on py>=3 to avoid imp deprecation
* Add changelog fragment
* importlib coverage for py3
* Ansiballz execute should use importlib too
* recursive module_utils finder should utilize importlib too
* don't be dumb
* Fix up units
* Clean up tests
* Prefer importlib.util in plugin loader when available
* insert the module into sys.modules
* 3 before 2 for consistency
* ci_complete
* Address importlib.util.find_spec returning None
The vmware test roles do a lot of similar operation to prepare
the environment. This role will be used to reduce the amount of
duplicated code.
The role can prepare an environment on a baremetal environment, this
in addition to vcsim.
Original PR: https://github.com/ansible/ansible/pull/54882
* nxos_ospf_vrf:sanity: ignore no default-metric idempotence tests when I7 images
This is a sanity test cleanup to handle a known image bug with (N9K) I7 images.
The I7 image rejects 'no default-metric' configs, so we're skipping the idempotence
tests that involve this bug.
Tested on N9K images: 9.2(2), 7.0(3)I7, 7.0(3)I2
* simplify check for I7
This is a sanity test cleanup to handle a known image bug with (N9K) I7 images.
The I7 image fails to enable some snmp trap link configs causing an idempotency failure in the sanity, so we're skipping the idempotence tests that involve this bug.
Tested on N9K images: 9.2(2), 7.0(3)I7.
* Start of migration to argparse
* various fixes and improvements
* Linting fixes
* Test fixes
* Fix vault_password_files
* Add PrependAction for argparse
* A bunch of additional tweak/fixes
* Fix ansible-config tests
* Fix man page generation
* linting fix
* More adhoc pattern fixes
* Add changelog fragment
* Add support for argcomplete
* Enable argcomplete global completion
* Rename PrependAction to PrependListAction to better describe what it does
* Add documentation for installing and configuring argcomplete
* Address rebase issues
* Fix display encoding for vault
* Fix line length
* Address rebase issues
* Handle rebase issues
* Use mutually exclusive group instead of handling manually
* Fix rebase issues
* Address rebase issue
* Update version added for argcomplete support
* -e must be given a value
* ci_complete
-Add: Test cases for ansible_parent_role_names and ansible_parent_role_paths
-Add: ansible_parent_role_names/paths variables for when a role is being included by another role.
Ensure inventory plugin loading rel to play
fixes#51033
* clarify paths
* now adding dirs funciton in loader
* better warnings
* each cli should handle adding dirs depending on context
* Use module_utils.compat.ipaddress where possible.
* Simplify reverse pointer computation.
* Use dummy for unused variables.
* Remove from ignore list.
* Adjust fix.
* Fix text handling for Python 2.
* Add changelog.
* - initial commit for the modules and tests
* initial implementation based on ec2_asg
* docstring implemtation and further methods initial implementation
* refactoring and pylint changes
* further implementation and integration tests
* added examples and parameter documentation
* removed files that were essentially templates
* added waiter for delete and updated the tests
* removed unit test
* fixed pep8 failure
* fixed pep8 failure
* fixed pep8 password field issue
* fixed pep8 password field issue
* fixed syntax issues
* fixed pep8 defaults
* password property documentation was breaking yaml
* fixed pep8 defaults
* fixed lack of defaults for wait parameter
* added default to boolean parameter
* pep8 fix
* fixed author entry
* adding type to wait parameter
* adding type to wait parameter
* fixed linting issues
* updated description and removed default from docs
* added metaclass
changed default for boolean
* changed declared defaults
* - fixe the delete function
- solved the yaml syntax issue
* added missing defaults for timeout, retry and removed the one for endpointtype as it should be None, becasue parameter is Required anyway
* fixed RETURN documentation issue
* trying to fix the import placement error
* trying to fix the doc error for missing params
* pep8 issues
* added endpoint aliases
* - added documentation
* pep8
* changed to unsupported tag
* changed no_log fact to yes in the integration tests
* added suggested changes to the integration tests
* - making severname use resource_prefix as well as a more generic domain
- removing test fact
* General test improvements.
* Adjust tests to older docker-py versions.
* docker_swarm_server_info: work around problems with older docker-py versions
* Bump minimal docker-py version for options network_filters and disk_usage.
* More general test improvements.
* Correct usage of docker_image.
* Put files into output directory.
* Speed up test.
* Remove old check.