original commit:
8efa4cdde9
update module to match current ansible standards
- update version_added
- fix sanity checks
- match docs to module definition of required and default values
- explicit default of 's0' for selevel
- no default for seuser or login
- rename serange->selevel, add alias
- add required imports
- add RETURN info (stolen from sister module)
- add author github handles
- remove star-import, name specific requirements
- handle import error similar to sister modules
- collapse exceptions
- remove IOError, alias for OSError
- https://stackoverflow.com/questions/29347790/difference-between-ioerror-and-oserror
- drop 'required: false' as false is the default
- list dependencies as python-agnostic
- selogin does not support check_mode
- remove unused functions
- require seuser only if state=present
Co-authored-by: James Cassell <code@james.cassell.me>
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
This avoids holding open _new_stdin within the parent process, where
subsequent WorkerProcess forks will duplicate it, producing significant
noise in the FD table of every worker.
Fix by overriding start() and moving the work to there, with a finally:
to ensure parent FD is closed after start().
* Fix bug in data returns for some queries used by facts module
* Add additional query to return all servers (up to 5000)
* Fix key checking in rest_api
* Not all Backings are equal
The class used for the backing is not identical in all cases, and do not have the same properties/methods.
Following backings exists at the time of this writing:
vim.vm.device.VirtualDisk.FlatVer1BackingInfo
vim.vm.device.VirtualDisk.FlatVer2BackingInfo
vim.vm.device.VirtualDisk.LocalPMemBackingInfo
vim.vm.device.VirtualDisk.PartitionedRawDiskVer2BackingInfo
vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo
vim.vm.device.VirtualDisk.RawDiskVer2BackingInfo
vim.vm.device.VirtualDisk.SeSparseBackingInfo
vim.vm.device.VirtualDisk.SparseVer1BackingInfo
vim.vm.device.VirtualDisk.SparseVer2BackingInfo
Fixes#53236
* If dispatch() rpc response has data element
return the xml string from `<data>` element
else return the complete xml string from
`<rpc-reply>`.
* fix AWS plugin credential precedence for environment variables
* Allow aliases in direct plugins options
Consolidate precedence fix just in the doc fragment using aliases for mismatched options
* Access options with the option name rather than alias
* fix indentation
* update unit tests
* Improve readability
* 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.
* Fix for type error
The empty type here should be a dict, not a list as is has a `get` done
on it next.
* Return dict directly to avoid failing key lookup
* tag portgroups and dvs
* Add support for datacenter tagging
* Support for tagging clusters
* Hostsystem tag option
* pep recommendations
* Remove Vmware from VmwareDistributedSwitch object type
* Fix typos in example tasks of vmware_tag_manager
* Add fw via panorama connectivity to panos connection
* updating panos connection as per review comments
* Fixing when 'provider' isn't specified, adding deprecation warning when classic provider params are used
* 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.
* New group `non-leader` to contain all nodes (workers and managers) except the swarm leader
* New group name change, documentation section updates
* New group name change, documentation section more updates
* 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>
All paths in get_bin_path are string type and vboxmanage was byte-string type.
So os.path.join was failing to join these two.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* 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
* Add Bitbucket pipelines variable module
* Add tests
* Remove parameters check for `absent` state
* Update version_added documentation field
* Minor fixes
* A few additional cosmetic changes
* Move to source_control
* Rename lib/ansible/modules/source_control/bitbucket_pipelines_variable.py to lib/ansible/modules/source_control/bitbucket/bitbucket_pipelines_variable.py
* Reflect directory change
* Move these imports as well
* Rename 'key' parameter (API) to 'name' (GUI)
* Add missing __init__.py files to mark modules
* Rename module (pipeline should be singular)
* Adjust module references and variable names after renaming
* 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
changing status option to statuses in the documentation
Adding choices to the argument spec to match the documentation from AWS.
Adding 'REVOKED', 'FAILED' to statuses documentation to match implementation.
Removing E322, E323 ignores for aws_acm_facts
* Fixes flatpak module to work with flatpak >=1.2.0, fixes#51481
This keeps backwards-compatibility for flatpak versions before 1.2.0
* Fixes typeo
Co-Authored-By: oolongbrothers <oolongbrothers@zeibar.net>
* Extend CPU data example and output results
Add "Get CPU Model example" and output result from "Get CPU inventory". Also add example for output of the "Inventory information" to make it easier to use the examples for Ansible beginners.
+label: docsite_pr
* Remove white space from blank line
* 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/
* [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
* Mention Docker SDK for Python instead of docker-py / docker.
* Docs fixes.
* Add myself as docker_container author.
* Use array syntax for running command.
* Break long lines.
* Avoid failure when docker_version is None.
* Improve docker-py vs. docker note in requirements.
* Canonicalize Docker SDK for Python upgrade instructions.
* Split long line.
* Make it clearer which hostnames are meant.
* 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
Adds variable types to docs
Refactors unit tests to remove deprecated parameters
Adds missing Return values to documentation
Removes deprecated modules unit tests
adds ha order, ha group and ha load as failover types
refactors main() function and module manager to accomodate new patterns
updates docs
refactors unit tests
Refactors main() function and module manager in multiple modules in line with recent changes
Adds variable types to docs
Refactors unit tests to remove deprecated parameters
* Revert "changes to clusteR"
This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.
* Revert "changes to clusteR"
This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.
* Revert "Revert "changes to clusteR""
This reverts commit f1104a37b4.
* Revert "Revert "changes to clusteR""
This reverts commit f1104a37b4.
* documentation changes
* Revert "documentation changes"
This reverts commit 02c369d0414fdff492d90865c903bdade3174261.
* Issue with port being removed and added on modify
* Workaround for moby/moby#35437 bug for ansible.docker.swarm library to provide correct leader node IP address
* Adding simple parser to separate IP address from port number for workaround
* Adding simple parser to separate IP address from port number for workaround (inline)
* Different split() method
* adds function to do version checks for bigiq
* adds version limitation to bigiq application modules
Refactors main() function and module manager in multiple modules in line with recent changes
Adds variable types to docs
Refactors unit tests to remove deprecated parameters
* 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
* Moving comparision functions to compare.py from common.py
* Refactors main() function and module manager in multiple modules in line with recent changes
Adds variable types to docs
Refactors unit tests to remove deprecated parameters
* Moving comparision functions to compare.py from common.py
* fixes issue with data group elements containing IPs with Route Domains
refactors main() function and module_manager to accomodate new patterns
updates doc variables
Refactors main() function and module manager in multiple modules in line with recent changes
Adds variable types to docs
Refactors unit tests to remove deprecated parameters
When haproxy is configured to track the status of a server using a
server in another backend it will not report all status as expected.
Using substring matching will solve this.
The CSV will output the server status in the following way:
MAINT: MAINT (via pxname/svname)
UP: UP
DOWN: DOWN
Haproxy doc on trach: https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#5.2-track
* 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
* Fix IP address support for openssl_csr.
* Remove DirName support, which doesn't work as this and seems harder to fix. Also, I don't know of an example of how it actually works.
* Stop repeating names of common config arguments in docker_container.
* Prefer tls_verify over tls for docker modules and docker_swarm inventory plugin.
* tls and tls_verify are no longer mutually exclusive.
* Share setup code between docker_* modules and docker_swarm inventory plugin.
* Add support for more parameters.
* PEP8.
* Fix typo.
* Rename host -> docker_host.
* * Adding new attribute that contains an URI which may be used in other docker swarm modules
* Change host_uri to include_host_uri parameter name
* Adding port detection/override
* Small fixes
* Some general PEP8 adjustments for better code readability
* Changing the parameter type description for clearance
* cloudstack: streamline modules doc (part 4)
* Parameter types added
* Copyright format fixes
* Doc style fixes
* Examples format fixes
* validate-module errors fixes
* cs_network_offering: Rollback of the deletion of the choice list for supported_services param
* * Workaround for Docker bug moby/moby#35437 when in some cases the Leader IP address is 0.0.0.0 instead of correct address
* Changes in docs port 2375 to 2376 to avoid confusion wherever the TLS is mentioned as this is default port for TLS connections in docker
* Imports optimization
* Adjust documentation section to match ansibot parsing
* Add comment why the workaround is required
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.
- xenserver module_util: removed dead code. Attempting to call fail_json() on
nonexistent/bad module reference is a bad idea.
- xenserver module_util: fixed a bug in wait_for_task function where function
will fail to wait indefinitely when timeout=0 is used.
- xenserver_guest module: removed unused imports.
* Pluribus Networks network cli terminal and cliconf plugins
* Changes in Unit tests and modules according to network_cli connection
* Changes in Unit tests and modules according to network_cli connection
The output of pw.getpwnam() does not distinbuish between local and remote accounts. It will return a result if an account exists locally or in the directory. When local is set to True in the task parameters, look through the local password database explicitly.
* Ensure luseradd is present for tests
* Add docs and warnings about local mode
* Add new win_domain_group_membership module.
* Add support for diff mode.
* Do not assign variable which is never used.
* Add documentation for the `domain_*` options.
* Let ansible handle the exceptions.
The test if the group exists is useless as the first action on the
groups fails with the same error message if it does not exist.
* Add comments why we need the try/catch
* Rework diff handling.
Just return before/after state and let ansible do the working out of the
diff.
* Minor cleanups according to PR
* Switch from Get-AdUser/Group to Get-AdObject
so we can add/remove service accounts, or computers too.
* Cleanup PowerShell code
* Update host with additional host vars from the reservation details
* Add toggle for additional API calls and incorporate strict_permissions
* version_added
* Fix netbox url with string concat
* Add logic to trim extra / at the end of api_endpoint
See PR#49943
* Add in strip of any trailing '/'
* Update logic to look at the self.get_option of api_endpoint
* Update to move to remove if logic and just strip the api_endpoint