1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

73 commits

Author SHA1 Message Date
Ajpantuso
cbcb942b0e
tss_lookup_plugin - Refactor and decoupling (#3252)
* Initial commit

* Adding changelog fragment

* Applying initial review suggestions

* Increasing unit coverage

* Removed unneccessary constant

* Improving test readability

* Cleanup constants
2021-08-25 06:41:05 +02:00
Matt 'Archer' Vaughn
23e7ef0255
Add option for retry_servfail (#3247)
* Add option for retry_servfail

cf. https://dnspython.readthedocs.io/en/latest/resolver-class.html#dns.resolver.Resolver.retry_servfail

Setting this option to `True` allows for the possibility of the lookup plugin to retry and thereby recover from potentially transient lookup failures, which would otherwise cause the task or play to bail with an unrecoverable exception.

* Create 3247-retry_servfail-for-dig

* documentation for `retry_servfail` option

* Rename 3247-retry_servfail-for-dig to 3247-retry_servfail-for-dig.yaml

* fix whitespace

* Update plugins/lookup/dig.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Update plugins/lookup/dig.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* rm try/except block

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-08-21 21:57:28 +02:00
Martin Vician
bcccf4e388
Add option for domain authorization (#3228)
Use DomainPasswordGrantAuthorizer if parameter `domain` is used.
2021-08-20 13:54:29 +02:00
Ricky White
6ac410b3f6
tss: added fix for bug report in issue #3192 (#3199)
* Added fix for bug report in issue #3192

* Added changelog fragment

* Typo fix

* Added Importerror to exception - as req by linters

* Moved the conditional import statement to try/except block
2021-08-18 09:26:44 +02:00
Alexei Znamensky
771e9de010
mass-added the utf-8 marker (#3163)
* added the utf-8 marker

* fixed the utf-8 marker where it was missde before
2021-08-08 10:40:22 +02:00
Alexei Znamensky
da11a98cb7
fixed the utf-8 marker (#3162) 2021-08-07 15:02:21 +02:00
Ricky White
a73720c103
Updated the tss lookup plugin to reflect breaking changes introduced in the underpinning SDK (#3139)
* Updated the plugin to reflect breaking changes introduced in the underlying SDK v1.0.0 update.

* Added Changelog fragment

* Updates based on feedback/review

* Added newline to pass CI

* Added whitepace for linter

* Update changelogs/fragments/3139-tss-lookup-plugin-update-to-make-compatible-with-sdk-v1.yml

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-08-05 19:28:32 +02:00
Alexei Znamensky
047b7ada3c
uf8 marker batch2 (#3128)
* added utf-8 markers to all .py files in plugins/filter

* added utf-8 markers to all .py files in plugins/inventory

* added utf-8 markers to all .py files in plugins/lookup
2021-08-01 12:36:53 +02:00
Felix Fontein
4982eaf935
Update BOTMETA, fix some plugin authors, improve BOTMETA extra sanity test (#3069)
* Update BOTMETA, fix some plugin authors, improve BOTMETA extra sanity test.

* Linting.
2021-07-26 11:44:41 +02:00
Felix Fontein
fafabed9e6
Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877)
* Replace ansible.module_utils._text by ansible.module_utils.common.text.converters.

* Also adjust tests.
2021-06-26 23:59:11 +02:00
Amin Vakil
dab5d941e6
Add domain option to onepassword lookup (#2735)
* Add domain to onepassword lookup

* Add changelog

* Add default to domain documentation

* Improve format

* Fix sanity issue

* Add option type to documentation

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add domain to init

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-06-08 11:41:21 +02:00
fkuep
0e6d70697c
Wire token param into consul_api #2124 (#2126)
* Wire token param into consul_api #2124

* Update changelogs/fragments/2124-consul_kv-pass-token.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* #2124 renamed release fragment to match pr, removed parse_params.

* putting look back in, do some linting   #2124

* try more linting

* linting

* try overwriting defaults in parse_params with get_option vals, instead of removing that function completely.

* Revert "back to start, from 2nd approach: allow keyword arguments via parse_params for compatibility."

This reverts commit 748be8e366.

* Revert " linting"

This reverts commit 1d57374c3e.

* Revert " try more linting"

This reverts commit 91c8d06e6a.

* Revert "putting look back in, do some linting   #2124"

This reverts commit 87eeec7180.

* Revert " #2124 renamed release fragment to match pr, removed parse_params."

This reverts commit d2869b2f22.

* Revert "Update changelogs/fragments/2124-consul_kv-pass-token.yml"

This reverts commit c50b1cf9d4.

* Revert "Wire token param into consul_api #2124"

This reverts commit b60b6433a8.

* minimal chnages for this PR relative to current upstream.

* superfluous newline in changlog fragment.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2021-06-05 22:38:42 +02:00
Abhijeet Kasurde
43c12b82fa
random_string: a new lookup plugin (#2572)
New lookup plugin to generate random string based upon
constraints.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-27 19:09:26 +02:00
Felix Fontein
7cd96d963e
meta/runtime.yml and __init__.py cleanup (#2632)
* Remove superfluous __init__.py files.

* Reformat and sort meta/runtime.yml.

* The ovirt modules have been removed.

* Add changelog entry.
2021-05-27 18:49:26 +02:00
Sylvia van Os
26757edfb2
Add one-liner lookup example (#2615)
* Add one-liner lookup example

* Remove trailing whitespace

* Update plugins/lookup/tss.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/tss.py

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
2021-05-27 07:57:06 +02:00
Jan Baier
350380ba8c
Add option missing to passwordstore lookup (#2500)
Add ability to ignore error on missing pass file to allow processing the
output further via another filters (mainly the default filter) without
updating the pass file itself.

It also contains the option to create the pass file, like the option
create=true does.

Finally, it also allows to issue a warning only, if the pass file is not
found.
2021-05-17 13:50:40 +02:00
Abhijeet Kasurde
5d0a7f40f2
random_pet: Random pet name generator (#2479)
A lookup plugin to generate random pet names based
upon criteria.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-14 10:55:27 +02:00
Felix Fontein
ee9770cff7
Deprecate nios content (#2458)
* Deprecate nios content.

* Make 2.9's ansible-test happy.

* Add module_utils deprecation.
2021-05-13 21:50:40 +02:00
Felix Fontein
eea4f45965
Add dependent lookup plugin (#2164)
* Add dependent lookup plugin.

* Use correct YAML booleans.

* Began complete rewrite.

* Only match start of error msg.

* Improve tests.

* Work around old Jinja2 versions.

* Fix metadata.

* Fix filter name.
2021-05-11 19:27:05 +02:00
Anubhav Chakraborty
f11f6595cc
convert string returned by plugin to unicode (#2329)
* convert string returned by plugin to unicode

* add changelog fragment

* fix changelog format

* fix changelog format yet again

Co-authored-by: Anubhav Chakraborty <anubchak@cisco.com>
2021-04-24 12:20:11 +02:00
Nick
8db59ff02d
with_filetree:: use splitext for compatibility with template: (#2285)
* with_filetree: use splitext for compatibility with template

The example code given deploys files with their .j2 extensions intact, which is probably not what you want.

* Explain how templates interact with splitext|first

* Update plugins/lookup/filetree.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Don't encourage setting the mode of symlinks

On ext4, maybe most filesystems, symlinks always have the artificial mode of 0777, and `chmod $mode $symlink` *writes through* the symlink to its target file.

An effect of this is that if you deploy a file and a symlink to it (e.g. this common situation: /etc/nginx/sites-available/default and /etc/nginx/sites-enabled/default -> ../sites-available/default) then `with_filetree` will forever first deploy the file with the right mode, then corrupt its mode to 0777, and every redeploy will see a change to fix, forever in a loop.

Probably `file:` should refuse `mode:` on `state: link`s, but in the meantime, avoid recommending it in `filetree`

* Use `follow: false` instead of just the mode.

This should be more cross-compatible.

https://github.com/ansible-collections/community.general/pull/2285#discussion_r616571873

* Update plugins/lookup/filetree.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-04-21 14:04:46 +02:00
Alexei Znamensky
b97e31dd55
rewritten as list literals (#2160)
* rewritten as list literals

* added changelog fragment
2021-04-05 09:22:06 +02:00
Jim Speir
677ab8e383
Adding another example for tss lookup (#1945)
* Adding another example for tss lookup

A more detailed example using self-hosted secrets server as investigated in #1943

* Update plugins/lookup/tss.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Better line breaking

* Update plugins/lookup/tss.py

Seconded!

Co-authored-by: Felix Fontein <felix@fontein.de>

* Remove newline to pass tests

* Update plugins/lookup/tss.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-03-02 21:58:55 +01:00
Alexei Znamensky
434f383ae9
fixed Python 3 keys() usage (#1861)
* fixed python3 keys()

* added changelog fragment

* Update plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/cache/redis.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* rolledback redis.py per PR

* Update plugins/modules/monitoring/sensu/sensu_check.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* removed unnecessary ignore lines

* adding memcached and one case in redis is indeed necessary

* Update changelogs/fragments/1861-python3-keys.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/1861-python3-keys.yml

* Update changelogs/fragments/1861-python3-keys.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-23 23:19:27 +01:00
Florian Bergmann
f955a85848
Add yaml support to passwordstore. (#1681)
Co-authored-by: Florian Bergmann <Florian.Bergmann@datev.de>
2021-01-28 09:24:28 +01:00
Paul Haerle
73b3ec09e5
fix passwordstore.py to be compatible with gopass. (#1589)
* fix passwordstore.py to be compatible with gopass.

...even when used with create=true.

The same output snippet matches for both, `pass` and `gopass`, but while `pass` returns `1` on a non-existant password, `gopass` returns `10`, or `11`, depending on whether a similar named password was stored.

So I'd propose to change `e.returncode == 1` to `e.returncode != 0` to cover both cases here.

What do you think?

* Update passwordstore.py, fix typo

* Add changelog fragment.

* Update changelogs/fragments/1589-passwordstore-fix-passwordstore.py-to-be-compatible-with-gopass.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/1589-passwordstore-fix-passwordstore.py-to-be-compatible-with-gopass.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-25 12:29:46 +01:00
Roberto Aguilar
5b1bede4cb
onepassword: find the password field out of the fields list (#1610)
* Find the password field out of the fields list

With the command line utility `op` version 1.8, the password field exists, while the fields list is empty.  This will look for the desired field without it being listed in the fields list.

* Add changelog fragment

* Update changelogs/fragments/1610-bugfix-onepassword-lookup-plugin.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/onepassword.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-20 22:37:28 +01:00
Felix Fontein
25e246bdc2
Improve readability of example. (#1648) 2021-01-19 08:24:25 +01:00
Joe Louthan
7d20ff7cac Update tss.py - multiline for an example (#1639)
* Update tss.py - multiline for an example 

Extended line runs past the side of the browser window

* Moved multiline to after the msg. 

Cannot believe I missed that again.

* Updated tss.py

Using > as multiline joiner with spaces
2021-01-19 07:01:29 +01:00
Felix Fontein
99cfb993d5
<plugin_type>: -> name: (#1541) 2021-01-12 07:12:03 +01:00
Felix Fontein
ddaad1e650
Remove hashi_vault plugin, add redirect. (#1566) 2021-01-04 10:55:14 +01:00
Eike Waldt
491b622041
fix passwordstore.py to be compatible with gopass versions (#1493)
* Be compatible to latest gopass versions.
`gopass show` is deprecated.

* add changelog fragment

* Update changelogs/fragments/1493-fix_passwordstore.py_to_be_compatible_with_gopass_versions.yml

Co-authored-by: Eike Waldt <git@yog.wtf>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-03 11:48:35 +01:00
David Moreau Simard
f78e08bc37
Remove google plugins and set up redirects to collections (#1319)
* Remove Google cloud plugins migrated to community.google

* Remove another symlink

* Fix typo for community.general version

* Update changelogs/fragments/1319-google-migration-removal.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/1319-google-migration-removal.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add fragment for inventory script

* fix yaml formatting

* adjust past relnotes in accordance with removal of google plugins

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-29 09:46:57 +01:00
bratw0rst
28ac4b79e2
Added umask option to passwordstore lookup plugin. (#1156)
* Added umask option to passwordstore lookup plugin.

* Added umask documentation and changelog fragment.

* Added default values to paramvals within the run method.

* removed blank lines (PEP8)

* Update changelogs/fragments/lookup-passwordstore-umask.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/passwordstore.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/lookup-passwordstore-umask.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* passwordstore lookup plugin: changelog fragment update

* passing environment variables to subprocess.Popen()

* Update plugins/lookup/passwordstore.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* rm trailing whitespace

* Don't force default umask in the plugin, pass will take care of this.

* remove default from the documentation string

* remove trailing whitespaces

* prevent KeyErrors when checking if key exits in paramvals.

* Update plugins/lookup/passwordstore.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix for TypeError

* revert back to old directory test

Co-authored-by: bratw0rst <c.chmiel@speakup.nl>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-24 08:05:59 +01:00
Jonathan Piron
6cec8759d0
Fix hashi_vault lookup approle authentication (#1138)
As per the plugin documentation and the Hashicorp Vault documentation (https://www.vaultproject.io/docs/auth/approle#secretid)
secret_id is not mandatory.
Moreover, using this lookup plugin without a secret_id used to work in
Ansible 2.9.

Co-authored-by: Jonathan Piron <jonathanpiron@gmail.com>
2020-11-16 16:42:42 +01:00
Erik Godding Boye
64c6f20b55
Add support for HashiCorp Vault JWT auth (#1213)
* Add support for Hashicorp Vault JWT auth

* Add support for HashiCorp Vault JWT auth (continued)

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

Co-authored-by: Mike Brancato <mike@mikebrancato.com>
Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2020-11-16 07:48:58 +01:00
Felix Fontein
0109310aa2 Fix gcp_storage_file lookup plugin (#1284). 2020-11-13 16:01:10 -05:00
markafarrell
3af4be34b2
Respect VAULT_SKIP_VERIFY envionment variable setting in hashi_vault lookup plugin (#1024)
* add skip_certificate_validation from env VAULT_SKIP_VERIFY

* use os.envrion.env instead of skip_certificat_validation

* fix typo in test

* add tests for different truthy options

* fix linting

* add changelog

* change precedence for validate_certs

* add precedence test

* fix inverted logic

* Fix documentation

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/hashi_vault.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix linting

* Update plugins/lookup/hashi_vault.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/hashi_vault.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-09 14:23:04 +02:00
Felix Fontein
e5da25915d
Improve plugin sanity (#966)
* callback_type -> type.

* Mark authors as unknown.

* Add author field forgotten in #627.

* Fix author entries.

* Add author field forgotten in #127.

* Fix some types.
2020-09-28 21:21:51 +02:00
Brian Scholer
ba5b86cf4a
hashi_vault - Change token_path env var loading precedence (#902)
* Change how vault token is loaded

* Add changelog for PR #902

* Update changelogs/fragments/902-hashi_vault-token-path.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/hashi_vault.py

Add version_added

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/lookup/hashi_vault.py

Add version_added

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-09-18 21:59:25 +02:00
holtwilkins
1a5702cf21
Support use of VAULT_NAMESPACE env var (#929)
As per https://learn.hashicorp.com/tutorials/vault/namespaces, setting VAULT_NAMESPACE env var is a completely supported mechanism to make all vault command use said namespace, so hashi_vault lookup function should do the same.

Co-authored-by: Holt Wilkins <hwilkins@palantir.com>
2020-09-18 21:21:41 +02:00
Benoit Bayszczak
51121e54d0
[lookup_plugin/hashi_vault] add missing 'mount_point' param for approle (#897)
* [lookup_plugin/hashi_vault] add missing 'mount_point' param for approle

* [lookup_plugin/hashi_vault] add changelog fragment

* Update changelogs/fragments/897-lookup-plugin-hashivault-add-approle-mount-point.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Benoit Bayszczak <benoit.bayszczak@adevinta.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-09-17 10:19:12 +02:00
Felix Fontein
7cf472855c
Fix various sanity errors in plugins (#881)
* Fix deprecation of callables.

* Fix various sanity errors.

* Revert callback_type -> type transform.

* Fix stat_result times: these are float according to https://github.com/python/typeshed/blob/master/stdlib/3/os/__init__.pyi

* Apply suggestions from code review

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-09-16 11:06:45 +02:00
Abhijeet Kasurde
9e039cc4a0
dsv: Use correct dict usage (#743)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-10 10:22:24 +05:30
Felix Fontein
7f37103df3
Fix author entry for dsv and tss lookup plugin. (#753) 2020-08-09 21:50:08 +02:00
Felix Fontein
ea21341686
Fix plugins (names, constants, FQCNs in examples) (#722)
* cobbler inventory: fix NAME

* oc transport: fix transport name

* Inventory plugins: fix plugin identifications

* Use FQCN in lookup plugin examples.

* Use FQCN in callback plugins.

* Add changelog fragment.

* Adjust documentation.

* Fix lookup plugin linting errors.

* Fix quotes.
2020-08-08 22:04:34 +02:00
Abhijeet Kasurde
0eb4954339
lookup: Fix minor typos (#740)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-07 08:11:35 +02:00
Abhijeet Kasurde
ce48751033
filetree: Update example and documentation for plugin (#728)
Fixes: #727

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-08-04 18:30:41 +05:30
Andrew Klychkov
4c4a6ab27c
modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
Andrew Klychkov
c055340ecb
modules: fix examples to use FQCN for builtin modules (#648)
* modules: fix examples to use FQCN for builtin modules

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2020-07-14 18:28:08 +03:00