Open deeco opened 2 years ago
Files identified in the description:
plugins/lookup/bitwarden.py
plugins/lookup/cartesian.py
plugins/lookup/chef_databag.py
plugins/lookup/collection_version.py
plugins/lookup/consul_kv.py
plugins/lookup/credstash.py
plugins/lookup/cyberarkpassword.py
plugins/lookup/dependent.py
plugins/lookup/dig.py
plugins/lookup/dnstxt.py
plugins/lookup/dsv.py
plugins/lookup/etcd.py
plugins/lookup/etcd3.py
plugins/lookup/filetree.py
plugins/lookup/flattened.py
plugins/lookup/hiera.py
plugins/lookup/keyring.py
plugins/lookup/lastpass.py
plugins/lookup/lmdb_kv.py
plugins/lookup/manifold.py
plugins/lookup/onepassword.py
plugins/lookup/onepassword_raw.py
plugins/lookup/passwordstore.py
plugins/lookup/random_pet.py
plugins/lookup/random_string.py
plugins/lookup/random_words.py
plugins/lookup/redis.py
plugins/lookup/revbitspss.py
plugins/lookup/shelvefile.py
plugins/lookup/tss.py
tests/unit/plugins/lookup/test_bitwarden.py
tests/unit/plugins/lookup/test_dependent.py
tests/unit/plugins/lookup/test_dsv.py
tests/unit/plugins/lookup/test_etcd3.py
tests/unit/plugins/lookup/test_lastpass.py
tests/unit/plugins/lookup/test_manifold.py
tests/unit/plugins/lookup/test_onepassword.py
tests/unit/plugins/lookup/test_revbitspss.py
tests/unit/plugins/lookup/test_tss.py
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @Akasurde @None @RevBits @azenk @dagwieers @delineaKrehl @eric-belhomme @felixfontein @galanoff @jparrill @jpmens @konstruktoid @lungj @samdoran @scottsb @tylerezimmerman click here for bot help
You probably have to make sure that python-consul
is installed in the execution environment used by AWX/Tower (assuming your version of AWX/Tower uses EEs).
You probably have to make sure that
python-consul
is installed in the execution environment used by AWX/Tower (assuming your version of AWX/Tower uses EEs).
Thanks for that @felixfontein , I also verified this and the ee environment has python consul installed, also exec into pod to verify this, ran the installer directly again to be sure also
could it be from within the task or scheduler containers it is also required ?
FYI , the below returns the full key, i am only interested in the value within the data block
- name: Retrieve a value from the key/value store
community.general.consul_kv:
host: dev-consul.domain.com
port: 32690
key: test/testkey
register: test_key
Hi @deeco from what I gather, import consul
will work with both python-consul
and python-consul2
. On the assumption that the -consul2
library kept API compatibility with the previous one, everything should work fine, and we could simply update the error message and docs to signal that any one of the two will work.
If the API is different, then we should ensure that this plugin will be able to handle that difference accordingly.
Files identified in the description:
plugins/lookup/bitwarden.py
plugins/lookup/cartesian.py
plugins/lookup/chef_databag.py
plugins/lookup/collection_version.py
plugins/lookup/consul_kv.py
plugins/lookup/credstash.py
plugins/lookup/cyberarkpassword.py
plugins/lookup/dependent.py
plugins/lookup/dig.py
plugins/lookup/dnstxt.py
plugins/lookup/dsv.py
plugins/lookup/etcd.py
plugins/lookup/etcd3.py
plugins/lookup/filetree.py
plugins/lookup/flattened.py
plugins/lookup/hiera.py
plugins/lookup/keyring.py
plugins/lookup/lastpass.py
plugins/lookup/lmdb_kv.py
plugins/lookup/manifold.py
plugins/lookup/onepassword.py
plugins/lookup/onepassword_raw.py
plugins/lookup/passwordstore.py
plugins/lookup/random_pet.py
plugins/lookup/random_string.py
plugins/lookup/random_words.py
plugins/lookup/redis.py
plugins/lookup/revbitspss.py
plugins/lookup/shelvefile.py
plugins/lookup/tss.py
tests/unit/plugins/lookup/onepassword/__init__.py
tests/unit/plugins/lookup/onepassword/common.py
tests/unit/plugins/lookup/onepassword/conftest.py
tests/unit/plugins/lookup/onepassword/fixtures/v1_out_01.json.license
tests/unit/plugins/lookup/onepassword/fixtures/v1_out_02.json.license
tests/unit/plugins/lookup/onepassword/fixtures/v1_out_03.json.license
tests/unit/plugins/lookup/onepassword/fixtures/v2_out_01.json.license
tests/unit/plugins/lookup/onepassword/fixtures/v2_out_02.json.license
tests/unit/plugins/lookup/onepassword/fixtures/v2_out_03.json.license
tests/unit/plugins/lookup/onepassword/test_onepassword.py
tests/unit/plugins/lookup/onepassword/test_onepassword_cli_v1.py
tests/unit/plugins/lookup/onepassword/test_onepassword_cli_v2.py
tests/unit/plugins/lookup/test_bitwarden.py
tests/unit/plugins/lookup/test_dependent.py
tests/unit/plugins/lookup/test_dsv.py
tests/unit/plugins/lookup/test_etcd3.py
tests/unit/plugins/lookup/test_lastpass.py
tests/unit/plugins/lookup/test_manifold.py
tests/unit/plugins/lookup/test_revbitspss.py
tests/unit/plugins/lookup/test_tss.py
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
!component =plugins/lookups/consul_kv.py
!component +plugins/modules/consul_kv.py
Files identified in the description:
plugins/lookups/consul_kv.py
plugins/modules/consul_kv.py
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @sgargan click here for bot help
cc @apollo13 click here for bot help
Both packages are years old and I think consul_kv would be better off with a rewrite to not require that library. urllib should be enough to make the http requests :)
ansible.module_utils.urls
has also a useful interface and can be used, and it comes with ansible-core, so there's no need for any library at all :)
cc @Ilgmi click here for bot help
I think that now, the new consul modules like consul_agent_service
and consul_agent_check
use built-in ansible.module_utils.consul
API client and do not rely on external libraries. Would be good to change the consul_kv
to follow the same approach.
Best regards, Maciej
Absolutely, PRs welcome 👍
On Wed, Oct 30, 2024, at 14:43, Maciej Lech wrote:
I think that now, the new consul modules like
consul_agent_service
andconsul_agent_check
use built-inansible.module_utils.consul
API client and do not rely on external libraries. Would be good to change theconsul_kv
to follow the same approach.Best regards, Maciej
— Reply to this email directly, view it on GitHub https://github.com/ansible-collections/community.general/issues/5251#issuecomment-2447207007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAT5C6H6VNOAXROBCPVQB3Z6DPAPAVCNFSM6AAAAAAQGEPQR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBXGIYDOMBQG4. You are receiving this because you were mentioned.Message ID: @.***>
Summary
when trying to run the community kv get error for "python-consul" here https://github.com/ansible-collections/community.general/blob/015566fb06628f5799ec2a0d33da0c4599262a28/plugins/lookup/consul_kv.py#L128
New distro only supports pip3 and would also like to know if pytohn-consul2 is supported ?
Issue Type
Bug Report
Component Name
https://github.com/ansible-collections/community.general/blob/main/plugins/lookup/
Ansible Version
AWX tower via operator version 0.21
Community.general Version
Configuration
name: Retrieve a value from the key/value store community.general.consul_kv: host: dev-consul.domain.com port: 32690 key: test/testkey register: test_key
name: Print Key Value debug: var: test_key
name: retrieving a KV from consul cluster on non default port debug: msg: "{{ lookup('community.general.consul_kv', 'test/testkey', host='dev-consul.domain.com', port='32690') }}"
OS / Environment
rhel 8 and k8s
Steps to Reproduce
name: Retrieve a value from the key/value store community.general.consul_kv: host: dev-consul.domain.com port: 32690 key: test/testkey register: test_key
name: Print Key Value debug: var: test_key
name: retrieving a KV from consul cluster on non default port debug: msg: "{{ lookup('community.general.consul_kv', 'test/testkey', host='dev-consul.domain.com', port='32690') }}"
Expected Results
expect version to be installed but never installs due to updated distro believe
Actual Results
'python-consul is required for consul_kv lookup. see http://python-consul.readthedocs.org/en/latest/#installation')
Code of Conduct