* Begin building out separate classes to support different op cli versions
Create separet base classes for each major version.
Define the main interface in the base class.
Create methods for getting the current version and instantiating the
appropriate class based on the found version.
* First pass at mostly working CLI version classes
* Correct mismathched parameters
* Update _run() method to allow updating enviroment
This allows passing in the app secret as an env var, which is more
secure than using a command line arg.
* Continuing to improve the interface
* Tear existing tests down to the studs
These tests were based off of the LastPass unit tests. I’m going to
just start from scratch given the new plugin code is vastly diffenent.
* Fix sanity test
* CLI config file path can be None
* Improve required param checking
- only report missing params
- use proper grammer based on number of missing params
* Change assert_logged_in() method return value
Return a boolean value indicating whether or not account is signed in
* Improve full login for v2
Have to do a bit of a dance to avoid hitting the interactive prompt
if there are no accounts configured.
* Remove unused methods
* Add some tests
* Fix linting errors
* Move fixtures to separate file
* Restructure mock test data and add more tests
* Add boilerplate
* Add test scenario for op v2 and increase coverage
* Fix up copyright statements
* Test v1 and v2 in all cases
* Use a more descriptive variable name
* Use docstrings rather than pass in abstract class
This adds coverage to abstract methods with the least amount of hackery.
* Increase test coverage for CLI classes
* Sort test parameters to avoid collection errors
* Update version tested in docs
* Revere test parameter sorting for now
The parameters need to be sorted to avoid the issue in older Python
versions in CI, but I’m having trouble working out how to do that
currently.
* Allow passing kwargs to the lookup module under test
* Favor label over id for v2 when looking for values
Add tests
* Display a warning for section on op v2 or greater
There is no “value” in section fields. If we wanted to support sections
in v2, we would also have to allow specifying the field name in
order to override “value”.
* Move test cases to their own file
Getting a bit unwieldy having it in the test file
* Move output into JSON files fore easier reuse
* Switch to using get_options()
* Add licenses for fixture files
* Use get_option() since get_options() was added in Ansible Core 2.12
* Rearrange fixtures
* Add changelog
* Move common classes to module_utils
* Move common classes back to lookup
The plugin relies on AnsibleLookupError() quite a bit which is not available
in module code.
Remove use of display for errors since section isn’t actually deprecated.
* Properly handle sections
Still room for improvement, but this is at least a start.
* Remove some comments that won’t be addressed
* Make test gathering more deterministic to avoid failures
* Update changelog fragment
* Simple fix for making tests reliable
* Allow for DN's to have {x} prefix on first RDN
* Update changelogs/fragments/5450-allow-for-xordered-dns.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Assign attrs to throw-away var
* Update plugins/module_utils/ldap.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Escape DN before creating filter
Co-authored-by: Felix Fontein <felix@fontein.de>
* Clearer error logging in passwordstore lookup
* Add changelog fragment for passwordstore errmsgs
Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
* Redfish: centralize payload checking when performing modification requests to a Redfish service
* CI fixes
* Updates based on unit testing
* CI fix
* Modified vendor-specific logic to establish common pattern for workarounds
* Start using Ansible's config manager to handle options.
* Docs improvements.
* Fix documentation, make options actual lookup options.
* The cyberarkpassword lookup does too strange things.
* The onepassword lookups are converted in #4728, let's not interfere.
* Improve docs.
* Skip shelvefile as well.
* Convert lmdb_kv.
* Convert and fix credstash.
* Convert manifold.
* Drop chef_databag.
* Convert dig.
* Update examples.
* Forgot the most important part.
* Fix lmdb_kv docs.
* Python 2.6 compatibility.
* Convert AnsibleUnicode to str.
* Load lookup with lookup loader.
* Fix environment handling and error message checking.
* Improve docs formatting.
* remove redundant and simplify code
we already have a templar from base class
loop reuses code instead of X copies of it
* whitey
* no need to import templar again
* Add changelog fragment.
Co-authored-by: Felix Fontein <felix@fontein.de>
* remove redundant
templar is already in base class
env var is already consulted in via config resolution
* more whites
* no need to import templar again
* Add changelog fragment.
* Try to update tests.
Co-authored-by: Felix Fontein <felix@fontein.de>
* Bump version to 6.0.0.
* sender option is now required.
* Default of want_proxmox_nodes_ansible_host changed from true to false.
* username is now an alias of user, and no longer of workspace.
* Remove deprecated return values in favor of end_state.
* Remove debug option.
* Change default of ignore_volatile_options from true to false.
* gitlab_group must now always contain the full path.
* Change default of norc from false to ture.
* Remove deprecated property.
* Add PR URL.
* Adjust bitbucket unit tests.
* Adjust module_helper integration test.
* search_s based _is_value_present
* Fix formatted string and ldap import
* Add changelog fragment
* Remove superfluous import ldap
* Improve fragment
* Code format {x} prefix
* Lower-case fixes
* Fix suggestions to changelog
* Break with the past and let bools be bools
* Let ldap_attrs break on invalid DN's
* deprecate venv creation when missing
* add changelog fragment
* fix sanity checks
* Update changelogs/fragments/5404-django-manage-venv-deprecation.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/web_infrastructure/django_manage.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/web_infrastructure/django_manage.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* minor change to help future removal of feature
Co-authored-by: Felix Fontein <felix@fontein.de>
* Adds transport_mode configuration for Infiniband devices
Adds transport_mode configuration for Infiniband based ipoib devices,
which is one of:
- datagram (default)
- connected
* Remove trailing whitespace
* Add changelog fragment
* Update changelogs/fragments/5361-nmcli-add-infiniband-transport-mode.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/net_tools/nmcli.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/net_tools/nmcli.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Remove default for transport_mode
* Add test for changing Infiniband transport_mode
* remove blank line at end of file
Co-authored-by: Thomas Gebert <thomas.gebert@atos.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
* deprecate old commands
* add changelog fragment
* fix django version in docs
* fix wording on the deprecations
* Update changelogs/fragments/5400-django-manage-deprecations.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* update chglog fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
* virtualbox: Fix nested data parsing
- Skip parsing values with keys that have both a value and nested data.
- Skip parsing values that are nested more than two keys deep.
* Update changelogs/fragments/5348-fix-vbox-deeply-nested-hostvars.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* consul: pythonisms + a couple of required_if clauses
* adjust condition of if
* adjust condition of if (again)
* Update plugins/modules/clustering/consul/consul.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* simplify parse_check logic
* fix condition of if
* remove test made redundant by required_if
* add changelog fragment
Co-authored-by: Felix Fontein <felix@fontein.de>
* [opentelemetry][callback] support opentelemetry-api 1.13
* [opentelemetry][callback] changelog fragment
* Update changelogs/fragments/5342-opentelemetry_bug_fix_opentelemetry-api-1.13.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* [opentelemetry-callback] refactor time_ns in a function
* fix linting
* change branch outside of the function
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* [opentelemetry]: remove options from suggestion
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* portage: drop dependency on gentoolkit (provides equery)
Portage installs a Python module, which is available anywhere that
Portage itself is available. We can use that instead of calling a
shell command.
Signed-off-by: John Helmert III <ajak@gentoo.org>
* portage: add knob for emerge's --backtrack flag
Signed-off-by: John Helmert III <ajak@gentoo.org>
* portage: add knob for portage's --with-bdeps option
Also, this option does not accept "True" like other options. Instead,
it only uses 'y' and 'n', so parse booleans properly into these chars.
Signed-off-by: John Helmert III <ajak@gentoo.org>
* Add changelog entry for #5349
Signed-off-by: John Helmert III <ajak@gentoo.org>
Signed-off-by: John Helmert III <ajak@gentoo.org>
* updated to use the new newrelic v2 api
* check that application_id is set
* indenting issue
* added back app_name
* fix import ordering
* resolving various spellings & wordings
* fixed wordings
* validate_certs
* fixed unreachable code
* opentelemetry: logs property
* opentelemetry: support for span events with the Task dump output
* opentelemetry: support property to disable the logs
* bump the version when supported
* add section ini
* test: fix change of signature
* [opentelemetry][callback] changelog fragment
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Experimental change from OpenIndiana
* resolve pfexec problem, by removing superfluous quotes
* reimplement "wrap_exe"
* remove spaces arround keyword argument assignment
* adapted pfexec unit test
* Try to fix quoting of test expression
* Fix quoting of test expression by replacing ' with "
* Add changelog fragment
* Adding capability to specify complex variables type to terraform
* Terrform variable types are mapped to ansible veriable types
* Currently handles Dict, List, Str, Int, Bool types
* Updated the documentation accordingly
* Updated with an example.
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Wonder how that missed the PEP8 checks :).
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Adding the changelog fragment
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Adding ``integer_types`` from ``module_utils``
Simplified the ``integer_types``, ``str`` and ``float`` value population through ``json.dumps()``. Now the strings can have special characters which can break the module execution.
* Update changelogs/fragments/4797-terraform-complex-variables.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* * Changed to approach to make the code more readble and simple to understand.
* Maintaining the original for loop for the top_level variables. Therefore the rocess_conplex_args() now only handle second level variables when the type() is either Dict or List.
* Json dumps are used only for the low level variables. Terraform CLI had issues interpreting escape sequecences from json.dumps()
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* adding boolean explicitly, although boolean is a subclass of integer, adding this for self documentation pupose and the clarity of the code.
* fixing the doc strings
* Update terraform.py
Fixing docstrings
* * Introducing format_args funtion to simplify formatting each argument type for top_level and lower level.
* Terraform Lists of strings, numbers, objects and lists are supported.
* Adding COMMAND: to the fail_json msg, for plan failures to help troubleshoot command line arguments.
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* * Adding full terraform command to fail_json() when the terrafor plan fails
* Fixing a spelling mistake.
* plan_command if a list, stringifying the list
* * Fixing the new line for the change fragments
* Removed CR (\r) from the output messages. Now output lines carry only LF (\n), not CRLF (\r\n).
* Added integration testing for complex variables.
* Restructured integration testing code to be more expandable.
* Update changelogs/fragments/4797-terraform-complex-variables.yml
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* double-quotes are not properly escaped in shell, and python string
escaping are nullified the way terraform handle second tier string
variables (within terraform).
* changing all the task actions to FQCN format.
* integration testing now includes:
1. Top level strings containing, special shell characters, spaces,
double-quotes.
2. Second level strings containing, special shell characters, spaces,
double-quotes repeating double-quotes to ensure proper regex
substitution.
* Adding colon ':' to string test casses.
* Added complex_vars to switch between the old and the new variable
interpretations.
Updated the documentations to reflect the changes.
Updated the examples.
Handling '\' as well with the escape sequence.
* Added tests for the new escape sequences.
Added multilines tests.
* Restructuring the documente strings to a shorter string.
Argument_spec changed to 'bool'
* Update changelogs/fragments/4797-terraform-complex-variables.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/modules/cloud/misc/terraform.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <c.fiehe@eurodata.de>
* bitwarden: Add field to search for all item attributes, instead of only name.
* bitwarden: Add change to changelog.
* bitwarden: Update changelog entry.
* Update changelogs/fragments/5297-bitwarden-add-search-field.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/lookup/bitwarden.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/lookup/bitwarden.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Ole Pannbacker <opannbacker@cronon.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
* chore: Update lxc_container to support py3
This change is mostly just a documentation change which will report the requirements
correctly for python3-lxc. I've also removed the use of six which results in us
changing `xrange` to `range`.
Resolves: https://github.com/ansible-collections/community.general/issues/5294
Signed-off-by: Kevin Carter <kevin.carter@figment.io>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* Update changelogs/fragments/5280-lxc_container-py3.yaml
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* Update changelogs/fragments/5280-lxc_container-py3.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update 5280-lxc_container-py3.yaml
* Update 5280-lxc_container-py3.yaml
Signed-off-by: Kevin Carter <kevin.carter@figment.io>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
* terraform: run `init` with no-color, too
When running `terraform init` fails, it would output ansi color sequences, making the output hard to read.
Maybe setting TF_IN_AUTOMATION would also be beneficial: https://www.terraform.io/cli/config/environment-variables#tf_in_automation
* add changelog fragment for `terraform init -no-color`
* move changelog into correct directory; add PR link
* module_utils.proxmox: new `api_task_ok` helper + integrated with existing modules
* proxmox_snap: add `unbind` param to snapshot containers with mountpoints
* [fix] errors reported by 'test sanity pep8'
at
https://github.com/ansible-collections/community.general/pull/5274#issuecomment-1242932079
* module_utils.proxmox.api_task_ok: small improvement
* proxmox_snap.unbind: version_added, formatting errors, changelog fragment
* Apply suggestions from code review
Co-authored-by: Felix Fontein <felix@fontein.de>
* proxmox_snap.unbind: update version_added tag
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
* Add SetSessionService to redfish_config
adding SetSessionService command to redfish_config
to set BMC default session timeout policy.
Fixes#5008
* fix white space issues
* Making Requested changes:
- changed category from SessionService to Sessions
- changed set_sessionservice() to set_session_service()
- other misc. changes for cleanup
* Apply suggestions from code review
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
* Fix issues with checks
* Fix issues with checks part 2
* Fix issues with checks part 3
* Update plugins/modules/remote_management/redfish/redfish_config.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>