community.general.etcd3 – Get key values from etcd3 server¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.etcd3
.
New in version 0.2.0: of community.general
Synopsis¶
Retrieves key values and/or key prefixes from etcd3 server using its native gRPC API.
Try to reuse community.general.etcd3 options for connection parameters, but add support for some
ETCDCTL_*
environment variables.See https://github.com/etcd-io/etcd/tree/master/Documentation/op-guide for etcd overview.
Requirements¶
The below requirements are needed on the local controller node that executes this lookup.
etcd3 >= 0.10
Parameters¶
Notes¶
Note
host and port options take precedence over (endpoints) option.
The recommended way to connect to etcd3 server is using
ETCDCTL_ENDPOINT
environment variable and keep endpoints, host, and port unused.
See Also¶
See also
- community.general.etcd3
The official documentation on the community.general.etcd3 module.
- etcd – get info from an etcd server
The etcd v2 lookup.
Examples¶
- name: "a value from a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo/bar') }}"
- name: "values from multiple folders on a locally running etcd"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo', 'bar', 'baz') }}"
- name: "look for a key prefix"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', '/foo/bar', prefix=True) }}"
- name: "connect to etcd3 with a client certificate"
ansible.builtin.debug:
msg: "{{ lookup('community.general.etcd3', 'foo/bar', cert_cert='/etc/ssl/etcd/client.pem', cert_key='/etc/ssl/etcd/client.key') }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this lookup:
Key | Returned | Description | |
---|---|---|---|
_raw
list
/ elements=dictionary
|
success |
List of keys and associated values.
|
|
key
string
|
success |
The element's key.
|
|
value
string
|
success |
The element's value.
|
Authors¶
Eric Belhomme (@eric-belhomme) <ebelhomme@fr.scc.com>