* Fix wrong example, remove strictness and fix tests
It was obvious that (because of an incorrect example) people were using
the **xml** module incorrectly, specifying the `attribute` parameter
where it was not supported (i.e. ignored).
While this functionality would have been useful, it currently returns as
if the information was requested from the parent, so we cannot simply
make it to what would be expected.
Therefor the real solution is to provide a warning when we find
incorrect use, and deprecate this use. Then later we could implement
this functionality correctly.
While troubleshooting this issue, I found that in some cases our
integration tests were not being run when we expected it.
This fixes#53459
* Change warning
* Fix weird sanity test error
* Add a comment to the deprecate-test
* Initial commit for static route module
- Create and query functionality in place today
* Enabled querying both all routes and single route
* Bug fixes and idempotency check
- Requires new idempotency code to validate, blocking on that
* Enabled test cases
* Documentation fixes
* Whitespace fix
* Major improvements based on Dag's commments
- Improved documentation and examples
- Fixed fixed IP assignments and reserved range parameters
- Improved integration tests
- Made check mode work
* Rename str to string in documentation
* Move back to str
* Fix indentation
* Fix documentation for example of fixed_ip_assignments
- Removed default=None for args
* Add support for notes
* Add test for notes
* Device notes changes
- Renamed from notes to note
- Modified tests to work
* Comment device test since it only works once
* Remove assertion stanza and move assertion to existing one
* Add version_added to note documentation
* Converted from tabs to spaces
* Added changelog fragment
* Remove changelog file since it's a feature
* Add changelog fragment
* basic plugin loading working (with many hacks)
* task collections working
* play/block-level collection module/action working
* implement PEP302 loader
* implicit package support (no need for __init.py__ in collections)
* provides future options for secure loading of content that shouldn't execute inside controller (eg, actively ignore __init__.py on content/module paths)
* provide hook for synthetic collection setup (eg ansible.core pseudo-collection for specifying built-in plugins without legacy path, etc)
* synthetic package support
* ansible.core.plugins mapping works, others don't
* synthetic collections working for modules/actions
* fix direct-load legacy
* change base package name to ansible_collections
* note
* collection role loading
* expand paths from installed content root vars
* feature complete?
* rename ansible.core to ansible.builtin
* and various sanity fixes
* sanity tweaks
* unittest fixes
* less grabby error handler on has_plugin
* probably need to replace with a or harden callers
* fix win_ping test
* disable module test with explicit file extension; might be able to support in some scenarios, but can't see any other tests that verify that behavior...
* fix unicode conversion issues on py2
* attempt to keep things working-ish on py2.6
* python2.6 test fun round 2
* rename dirs/configs to "collections"
* add wrapper dir for content-adjacent
* fix pythoncheck to use localhost
* unicode tweaks, native/bytes string prefixing
* rename COLLECTION_PATHS to COLLECTIONS_PATHS
* switch to pathspec
* path handling cleanup
* change expensive `all` back to or chain
* unused import cleanup
* quotes tweak
* use wrapped iter/len in Jinja proxy
* var name expansion
* comment seemingly overcomplicated playbook_paths resolution
* drop unnecessary conditional nesting
* eliminate extraneous local
* zap superfluous validation function
* use slice for rolespec NS assembly
* misc naming/unicode fixes
* collection callback loader asks if valid FQ name instead of just '.'
* switch collection role resolution behavior to be internally `text` as much as possible
* misc fixmes
* to_native in exception constructor
* (slightly) detangle tuple accumulation mess in module_utils __init__ walker
* more misc fixmes
* tighten up action dispatch, add unqualified action test
* rename Collection mixin to CollectionSearch
* (attempt to) avoid potential confusion/conflict with builtin collections, etc
* stale fixmes
* tighten up pluginloader collections determination
* sanity test fixes
* ditch regex escape
* clarify comment
* update default collections paths config entry
* use PATH format instead of list
* skip integration tests on Python 2.6
ci_complete
Currently, if we try to stop or start a network two time in a row, the
second call will fail. With this patch:
- we don't recreate a network, if it exists
- we only stop a network if it's active, and so we avoid an exception
saying the network is not active
* test: mock libvirt
* add integration tests for virt_net
* test: enable virt_net test on RedHat 7 and 8
* ci: use the unsupported alias
* tests that require privileged mode are run in VM
* virt_net/create raise unexpected libvirt exception
* import mock from units.compat
* virt_net: do not call create() on "active" network
* virt_net func test: only clean up the libvirt packages
* test: virt_net: don't use assert_called()
* virt_net: add the destructive alias
* move the test in virt_net dir
* test/virt_net: clean up the network at the end
* win_shell: Implement option 'profile', allowing the user to control powershell profile sourcing before running a command
* Set version_added to 2.8
* Make sure profile directory exists before writing profile file
* Changes to make tests immutable and align with ps args
* Use locking for concurrent file access
This implements locking to be used for modules that are used for
concurrent file access, like lineinfile or known_hosts.
* Reinstate lock_timeout
This commit includes:
- New file locking infrastructure for modules
- Enable timeout tests
- Madifications to support concurrency with lineinfile
* Rebase, update changelog and tests
We need to specify ansible_python_interpreter to avoid running interpreter discovery and selecting the incorrect interpreter.
Remove the import of lock in known_hosts since it is not used.
* Fix service integration test python selection.
* Clean up source in ansible_test_service.
* Rename script to include in python tests.
* Make shebang templating sanity friendly.
* Fix checksum.
* Use realpath of python to avoid selinux issues.
* Added support for types parameter
- Parameter is used to specify multiple network types
* Fix documentation
* Apply suggestions from code review
Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
* Reworked type parameter to be a list so types isn't needed
* Re-add tags documentation
* Fix documentation around compatibility
* Convert tags to list from string
* Add changelog fragment
* Adding cnos_user module to Ansible
* Update cnos_user.py
* Adding Functional test cases and unit test cases.
* Fixing Bug found in testing with Lenovo Mars.
* Review comments incorporated
* Review comments implemented.
* Copy paste mistake
When using before and after in combination, the opposite behavior was induced. This PR makes the the replacement happen between the specified patterns as intended.
* Added integration tests
* Add changelog, porting guide entry, and minor doc fixes
* Removed required_together, updated tests
Since required_together: privatekey_path -> friendly_name, is not always
required it has been removed.
Updated openssl_pkcs12 integration tests to be in line with other
openssl_* modules, and added a test for export with no privatekey_path.
* linter fixes
* Removed cryptography from tests
* Added changelog fragment
* Removed non-necessary select_crypto_backend
* Adding networks_cli_compatible option.
* Move network tests into own test file.
* Extend tests (for networks_cli_compatible=no).
* Adding tests for networks_cli_compatible=yes.
* There seems to be no way to create a container without at least one network attached.
* Integrate networks / purge_networks with comparisons.
* Speed up tests.
* Removing double dot.
* Add changelog.
* Use comparisons value only if the networks option has been specified. purge_networks on the other hand also removes networks if it has not been specified.
* add missing integration tests for postgresql_schema module
* add missing integration tests for postgresql_schema module
* postgresql_schema: add CI test with function in module from #54237
* postgresql_schema: add CI test with function in module from #54237
* add DROP SCHEMA test with check_mode=yes #54185
* Add the constructed config with legacy settings enabled to match the script
* Add interesting characters in tags and security group names
* add strict to config
* Add a stopped instance in inventory
* Create symlinks in the test
* Add reservation details to mock
* run script and plugin with a virtual env
* call the script with ansible-inventory
* Fix code coverage collection.
* Add write helper.
* Adjust modules (except openssl_certificate).
* Adding tests for mode (with openssl_privatekey).
* Add openssl_certificate support.
* Never, ever remove the output file before actually trying to generate new content for it.
Removal is only allowed when state=absent, or when the object has been regenerated and the result needs to be written to that place.
* Add changelog.
* Extend test.
* Add documentation for tags and network access
* Documentation changes from dag and sam
* Change examples to include proper YAML and not dict
* Update lib/ansible/modules/network/meraki/meraki_admin.py
Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
* New cryptography backend for openssl_certificate
load_* functions in module_utils/crypto.py now have a backend paramter
which when set to 'cryptography' will return cryptography objects so
they can be used for both pyopenssl and cryptography backends.
Added a select_message_digest function too returning a cryptography
digest hash from `cryptography.hazmat.primitives.hashes`
Added new classes for Cryptography backend
* Run test with various backends.
* Prefixing tests.
* Make sure we have the correct backend available.
* Linting (flake8).
* Moved cryptography import to separate try/except
* Make sure certificate is actually valid at some time in the past.
* Improve error handling.
* Trying to fix validation for cryptography backend.
* Fixed issue with keyUsage test in assertonly
* Fixed CI/Lint issues
* Fix private key problem for OwnCA.
* Cryptography backend doesn't support v2 certs.
* issue an expired cert with command when using cryptography backend
* Added warning when backend is auto and v2 cert is requested
* Bumped min cryptography version to 1.6
* Correctly check for failure when backend is cryptography and cert is v2
* Use self.backend where possible
* Use secp521r1 EC when testing on CentOS6
* Fixed pylint issue
* AcmeCertificate support for both backends
* Review fixes
* Fixed missing '(' when raising error
* Fixed date_fmt loop
* Updated docs and requirements with cryptography
* Add openssl_certificate to changelog.
Fixes#40060
* Fix coding style errors
* Use CONNECTION LIMIT (no underscore)
* From review done by amenonsen and bcoca - Set default at None, make the change detection less confusing
* Added EXAMPLE on how to apply a database specific connection limit
* Added some basic tests for conn_limit applied to a database
* Check that conn_limit has actually been set / updated to 200
* Add changelog fragment regarding postgresql_db conn_limit parameter
* cs_volume: add volumes extraction and upload features
* cs_volume: Update doc, remove deprecated code
* cs_volume: Add unit tests for extract and upload features
* Move check_type_str() out of basic.py
* Move check_type_list() out of basic.py
* Move safe_eval() out of basic.py
* Move check_type_dict() out of basic.py
* Move json importing code to common location
* Move check_type_bool() out of basic.py
* Move _check_type_int() out of basic.py
* Move _check_type_float() out of basic.py
* Move _check_type_path() out of basic.py
* Move _check_type_raw() out of basic.py
* Move _check_type_bytes() out of basic.py
* Move _check_type_bits() out of basic.py
* Create text.formatters.py
Move human_to_bytes, bytes_to_human, and _lenient_lowercase out of basic.py into text.formatters.py
Change references in modules to point to function at new location
* Move _check_type_jsonarg() out of basic.py
* Rename json related functions and put them in common.text.converters
Move formatters.py to common.text.formatters.py and update references in modules.
* Rework check_type_str()
Add allow_conversion option to make the function more self-contained.
Move the messaging back to basic.py since those error messages are more relevant to using this function in the context of AnsibleModule and not when using the function in isolation.
* Add unit tests for type checking functions
* Change _lenient_lowercase to lenient_lowercase per feedback
* #50877:
* add support to postgresql_privs to use "FOR { ROLE | USER } target_role"
in "ALTER DEFAULT PRIVILEGES"
* fix sanity errors
* #50877: fix documentation and add a check for correct usage
of target_roles
* #50877: fix missing absent option for default privs with target_role
* #50877: add clear description, when target_roles can be used
* #50877: fix conflicts, formatting, and add a changelog fragment
* #50877: fix sanity error E335
* #50877: swap conditions and fix error to warning msg
* #50877: add tests for default privileges
* #50877: fix tests for default privileges
* #50877: fix tests for default privileges on centos 6
* * `reconcile_candidate()`
* old code searched the ip route configs for a given prefix+nexthop and then tried to remove the route based on prefix+nexthop only; this would fail when a static route was configured with `track` values.
* new code still looks for prefix+nexthop but uses the route config it finds on the device to remove it; e.g.
* search for: `ip route 192.168.20.64/24 192.0.2.3`
* find: `ip route 192.168.20.64/24 192.0.2.3 track 1 10`
* remove: `no ip route 192.168.20.64/24 192.0.2.3 track 1 10`
* logic cleanups:
* old code did a `show run` for every prefix. This can be a lot of data when there are large configs.
* new code uses filters to only return the static route configs.
* The filters now allow a common code path so no need for default vs vrf code paths
* `sanity` test: 100% Pass rate on N9K,N7K,N6K,N3K
- Bugfix Pull Request
`nxos_static_route`
* filter() does not return a list with python3
`filter()` was breaking pytest when it ran with python3, since it returns
an iterable instead of a list with python3.
Found that I didn't really need `filter()` anyway so just removed it
* restore var names /w/want/
The unstable alias wasn't intended for slow but otherwise stable
tests. However, the alternatives are to either dedicate an entire
test group to this one test or mark it unsupported.
Marking it unstable at least permits the test to run when changes
are made to the integration test or the module itself, which is
better than not running the tests at all.
* [WIP] Additional DevTest Lab modules
* updates
* try global schedule again
* dtl schedule
* try full dtl schedule test
* fixing schedule
* fixed problem
* another fix
* fixed test
* different time format
* fixed absent state
* test policy idempotence
* more updates
* updated devtestlabpolicy
* fixed syntax
* updated dtl policy test
* updated image id
* fixed test
* fixed bug
* fixed bugs and docs
* fixed bug
* + small cleanup
* reenabled tests but disabled leaking tests
* disabled test
* Adding cnos_system module to Ansible.
* Adding UT, Functional test required for cnos_system. Bugs came up are fixed
* Adding more files to the cnos_system suit.
* Fixed another problem where `group-timeout` was processed before `ip igmp snooping` was enabled
* `sanity` playbook:
* N6K: `show ip igmp snooping | json` succeeds on the device but doesn't return any data in body; added a skip to the sanity playbook to keep it out of CI
* Added a setup task to do initial cleanup on the device
* initial commit
* fix execute and \r\n
* \r attempt 2
* updated with integration tests and using new csharp import
* Apply suggestions from code review
Co-Authored-By: rcanderson23 <rcanderson23@gmail.com>
* fixed small docuement inaccuracies wrt returns
* removal of state in feature result
* removal of rc
* small fixes suggested in code review
* fixed variable assigning to result
* addition of comments on conditionals for clarity on matching
* swap logic of check_mode
* set $reboot_required so it is always returned
* removal of extraneous return information
* addition of integration tests
* set installation of parent features to true
* remove 2008 from tests
* changed test for TelnetClient from NetFx3
* change of tabs to spaces
* Add test check for OS version
* Use local dummy repo for flatpak_remote integration tests
* Excludes versions of Ubuntu older than 16.04 from tests
Since there are no flatpak packages available for these Ubuntu versions
* Adds handler that removes temporary symlink
* win_dns: Initial work
* win_dns: initial commit
* Renaming win_dns -> win_dns_record
* win_dns_record: Fix record leakage in output
* win_dns_record: Fix erroneous minimums enforcement
It is apparently completely legitimate to specify a TTL that is below
minimum; it will just get ignored in favor of the server's minimum.
* win_dns_record: Fix new-host changes reported incorrectly
* win_dns_record: Fix TTL changes reported incorrectly
* win_dns_record: Fix existing records not recognized
* win_dns_record: Remove obsolete object
* Refactorize check mode
* Add computer_name parameter
* Refactorize diff and changed to read DNS end state
* Fix pslint tests PSUseDeclaredVarsMoreThanAssignments and PSAvoidUsingCmdletAliases
* Minor fix, misnamed variable.
* win_dns_record: Fix "changed" state in check mode
* win_dns_record: cleanups
* win_dns_record: fix TTL update not changed regression
* Add initial integration tests
* win_dns_record: integration tests
* win_dns_record: Reverted 9cf5f2d8e6
The approach from that commit breaks check mode.
* win_dns_record: de-scope some records
These are either esoteric (meaning limited realworld testing)
or require additional thought to do properly (eg MX, which
has its "priority" level).
* win_dns_records tests: Ensure DNS services are installed
* Update lib/ansible/modules/windows/win_dns_record.py
Co-Authored-By: johnboy2
* Update lib/ansible/modules/windows/win_dns_record.py
Co-Authored-By: johnboy2
* Aggregated suggestions from dagwieers
* Fix bad powershell test argument
* win_dns_record partially converted to new Powershell module interface
win_dns_record converted to new Powershell module interface, except diff
and required_if
* win_dns_record: convert diff support
* win_dns_record: convert diff support to after-before style
* Don't test for Add-WindowsFeature
* win_dns_record: Fix diff
When check mode is used diff changes must be simulated.
* Style consistency/clean-ups
* Fix integration test typos
* Improve readability of diff output
The original intention of the diff output was to resemble zone file records
(except that the zone-name is added onto each record). In that light, the
missing *record class* information (always "IN" in our case) was an oversight.
This just makes the diff output more "instantly readable" for DNS gurus.
* win_dns_record: Add diff tests
* Fix ansible-test sanity check fails
* Apply suggestions from code review
Added suggestions from dagwieers
Co-Authored-By: johnboy2 <john@jnelson.ca>
* win_dns_record: Skip 2008 and friends
* Reword error messages so they start capitalized.
* Fix sanity error
* win_dns_record: Document ttl range
* win_dns_record: Additional supportability barriers in tests
* win_dns_record: Typo
* win_dns_record: Sanity fix
* win_dns_record: Use OS-test only for compat checking
* Add an option to parse botocore.endpoint logs for the AWS actions performed during a task
Add a callback to consolidate all AWS actions used by modules
Added some documentation to the AWS guidelines
* Enable aws_resource_actions callback only for AWS tests
* Add script to help generate policies
* Set debug_botocore_endpoint_logs via environment variable for all AWS integration tests
Ensure AWS tests inherit environment
(also remove AWS CLI in aws_rds inventory tests and use the module)
* New module postgresql_facts: Gathers facts about remote PostgreSQL instances
* New module postgresql_facts: fix default values of function
* New module postgresql_facts: add extension support
* New module postgresql_facts: fixed typo
* New module postgresql_facts: added integration test
* New module postgresql_facts: fix test error
* New module postgresql_facts: add info about min server version
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: added repl stat tables checks
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: fix
* New module postgresql_facts: ansible_facts -> postgresql_facts
* New module postgresql_facts: fix ci
New module postgresql_facts: revision for review
New module postgresql_facts: revision for review, fix
* fix doc
* New module postgresql_facts: add data types to param dict
* New module postgresql_facts: code refactoring
* # This is a combination of 3 commits.
# The first commit's message is:
New module postgresql_facts: incl_subset => filter
# This is the 2nd commit message:
New module postgresql_facts: fix a typo
# This is the 3rd commit message:
New module postgresql_facts: fixes
* New module postgresql_facts: incl_subset => filter
New module postgresql_facts: fix a typo
New module postgresql_facts: fixes
Various cosmetic and doc changes
* New module postgresql_facts: fix filter type
* New module postgresql_facts: fix sanity
* New module postgresql_facts: change ansible_facts to postgresql_facts
* New module postgresql_facts: fix tests
* New module postgresql_facts: fixes
* New module postgresql_facts: fixes
* New module postgresql_facts: fixes
* New module postgresql_facts: doc fixes
* New module postgresql_facts: added pretty_val
* New module postgresql_facts: added pending restart
* New module postgresql_facts: fix documentation
* New module postgresql_facts: fix documentation
* New module postgresql_facts: fixes by KN
* New module postgresql_facts: fixed sanity
* New module postgresql_facts: fixed tests
Include path in role with directory which has 'tasks' as end.
For example, roles/sometasks/templates is now considered while searching path.
Fixes: #42585
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
The cloudscale_floating_ip module failed if no server was assigned to
the floating IP. This also adds a test to avoid a regression.
The only way to have a floating IP without a server assigned is to
delete the server where the floating IP is currently assigned. Under
normal circumstances it's not possible to have an unassigned floating
IP.