mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 06:53:21 -07:00
[doc] update requirements for all consul modules/lookups (#10863)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
* [doc] update requirements for consul_kv module python-consul has been unmaintained for a while. It uses a legacy way of passing the Consul token when sending requests. This leads to warning messages in Consul log, and will eventually break communication. Using the maintained py-consul library ensures compatibility to newer Consul versions. * [doc] replace all python-consul occurrences with py-consul * [fix] tests and possible pip server errors * [chore] remove referencce to python-consul in comment --------- Co-authored-by: Sebastian Damm <sebastian.damm@pascom.net>
This commit is contained in:
parent
41b65161bd
commit
9d0150b2c3
5 changed files with 13 additions and 9 deletions
|
@ -16,7 +16,7 @@ description:
|
||||||
with simple rest commands.
|
with simple rest commands.
|
||||||
- C(curl -X PUT -d 'some-value' http://localhost:8500/v1/kv/ansible/somedata).
|
- C(curl -X PUT -d 'some-value' http://localhost:8500/v1/kv/ansible/somedata).
|
||||||
requirements:
|
requirements:
|
||||||
- 'python-consul python library U(https://python-consul.readthedocs.io/en/latest/#installation)'
|
- 'py-consul python library U(https://github.com/criteo/py-consul?tab=readme-ov-file#installation)'
|
||||||
options:
|
options:
|
||||||
_raw:
|
_raw:
|
||||||
description: List of key(s) to retrieve.
|
description: List of key(s) to retrieve.
|
||||||
|
@ -131,7 +131,7 @@ class LookupModule(LookupBase):
|
||||||
|
|
||||||
if not HAS_CONSUL:
|
if not HAS_CONSUL:
|
||||||
raise AnsibleError(
|
raise AnsibleError(
|
||||||
'python-consul is required for consul_kv lookup. see http://python-consul.readthedocs.org/en/latest/#installation')
|
'py-consul is required for consul_kv lookup. see https://github.com/criteo/py-consul?tab=readme-ov-file#installation')
|
||||||
|
|
||||||
# get options
|
# get options
|
||||||
self.set_options(direct=kwargs)
|
self.set_options(direct=kwargs)
|
||||||
|
|
|
@ -25,7 +25,7 @@ description:
|
||||||
metadata so at that stage change management is to be added.
|
metadata so at that stage change management is to be added.
|
||||||
- See U(http://consul.io) for more details.
|
- See U(http://consul.io) for more details.
|
||||||
requirements:
|
requirements:
|
||||||
- python-consul
|
- py-consul
|
||||||
- requests
|
- requests
|
||||||
author: "Steve Gargan (@sgargan)"
|
author: "Steve Gargan (@sgargan)"
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
|
@ -549,7 +549,7 @@ class ConsulCheck(object):
|
||||||
|
|
||||||
def test_dependencies(module):
|
def test_dependencies(module):
|
||||||
if not python_consul_installed:
|
if not python_consul_installed:
|
||||||
module.fail_json(msg="python-consul required for this module. see https://python-consul.readthedocs.io/en/latest/#installation")
|
module.fail_json(msg="py-consul required for this module. see https://github.com/criteo/py-consul?tab=readme-ov-file#installation")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
@ -20,7 +20,7 @@ description:
|
||||||
of the results.
|
of the results.
|
||||||
- See http://www.consul.io/docs/agent/http.html#kv for more details.
|
- See http://www.consul.io/docs/agent/http.html#kv for more details.
|
||||||
requirements:
|
requirements:
|
||||||
- python-consul
|
- py-consul
|
||||||
- requests
|
- requests
|
||||||
author:
|
author:
|
||||||
- Steve Gargan (@sgargan)
|
- Steve Gargan (@sgargan)
|
||||||
|
@ -150,8 +150,8 @@ except ImportError:
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
|
|
||||||
# Note: although the python-consul documentation implies that using a key with a value of `None` with `put` has a
|
# Note: although the py-consul implementation implies that using a key with a value of `None` with `put` has a special
|
||||||
# special meaning (https://python-consul.readthedocs.io/en/latest/#consul-kv), if not set in the subsequently API call,
|
# meaning (https://github.com/criteo/py-consul/blob/master/consul/api/kv.py), if not set in the subsequently API call,
|
||||||
# the value just defaults to an empty string (https://www.consul.io/api/kv.html#create-update-key)
|
# the value just defaults to an empty string (https://www.consul.io/api/kv.html#create-update-key)
|
||||||
NOT_SET = None
|
NOT_SET = None
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,13 @@
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=')
|
when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=')
|
||||||
- name: Install python-consul
|
- name: Install py-consul
|
||||||
pip:
|
pip:
|
||||||
name: python-consul
|
name: py-consul
|
||||||
extra_args: "-c {{ remote_constraints }}"
|
extra_args: "-c {{ remote_constraints }}"
|
||||||
register: result
|
register: result
|
||||||
|
retries: 3
|
||||||
|
delay: 5
|
||||||
until: result is success
|
until: result is success
|
||||||
- name: Generate privatekey
|
- name: Generate privatekey
|
||||||
community.crypto.openssl_privatekey:
|
community.crypto.openssl_privatekey:
|
||||||
|
|
|
@ -27,3 +27,5 @@ redis ; python_version >= '3.6'
|
||||||
pycdlib < 1.13.0 ; python_version < '3' # 1.13.0 does not work with Python 2, while not declaring that
|
pycdlib < 1.13.0 ; python_version < '3' # 1.13.0 does not work with Python 2, while not declaring that
|
||||||
python-daemon <= 2.3.0 ; python_version < '3'
|
python-daemon <= 2.3.0 ; python_version < '3'
|
||||||
bcrypt < 4.0.0 # TEMP: restrict to < 4.0.0 since installing 4.0.0 fails on RHEL 8
|
bcrypt < 4.0.0 # TEMP: restrict to < 4.0.0 since installing 4.0.0 fails on RHEL 8
|
||||||
|
py-consul < 1.3.0 ; python_version < '3.8' # 1.3.0 dropped support for Python 3.5, 3.6, 3.7
|
||||||
|
py-consul < 1.5.4 ; python_version < '3.9' # 1.5.4 dropped support for Python 3.8
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue