Note
This lookup plugin is part of the community.general collection (version 10.7.3).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.etcd.
Parameter | Comments |
|---|---|
Terms list / elements=string / required | The list of keys to lookup on the etcd server. |
This describes keyword parameters of the lookup. These are the values key1=value1, key2=value2 and so on in the following examples: lookup('community.general.etcd', key1=value1, key2=value2, ...) and query('community.general.etcd', key1=value1, key2=value2, ...)
Parameter | Comments |
|---|---|
url string | Environment variable with the URL for the etcd server. Default: Configuration:
|
validate_certs boolean | Toggle checking that the ssl certificates are valid, you normally only want to turn this off with self-signed certs. Choices:
|
version string | Environment variable with the etcd protocol version. Default: Configuration:
|
Note
lookup('community.general.etcd', term1, term2, key1=value1, key2=value2) and query('community.general.etcd', term1, term2, key1=value1, key2=value2)
See also
Set or delete key value pairs from an etcd3 cluster.
Get key values from etcd3 server.
- name: "a value from a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd', 'foo/bar') }}"
- name: "values from multiple folders on a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd', 'foo', 'bar', 'baz') }}"
- name: "you can set server options inline"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd', 'foo', version='v2', url='http://192.168.0.27:4001') }}"
Key | Description |
|---|---|
Return value list / elements=string | List of values associated with input keys. Returned: success |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/etcd_lookup.html