community / community.general / 1.3.11 / lookup / etcd3 Get key values from etcd3 server | "added in version" 0.2.0 of community.general" Authors: Eric Belhomme (@eric-belhomme) <ebelhomme@fr.scc.com>community.general.etcd3 (1.3.11) — lookup
Install with ansible-galaxy collection install community.general:==1.3.11
collections: - name: community.general version: 1.3.11
Retrieves key values and/or key prefixes from etcd3 server using its native gRPC API.
Try to reuse M(community.general.etcd3) options for connection parameters, but add support for some C(ETCDCTL_*) environment variables.
See U(https://github.com/etcd-io/etcd/tree/master/Documentation/op-guide) for etcd overview.
- 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') }}"
host: description: - etcd3 listening client host. - Takes precedence over I(endpoints). type: str port: description: - etcd3 listening client port. - Takes precedence over I(endpoints). type: int user: description: - Authenticated user name. env: - name: ETCDCTL_USER type: str _terms: description: - The list of keys (or key prefixes) to look up on the etcd3 server. elements: str required: true type: list prefix: default: false description: - Look for key or prefix key. type: bool ca_cert: description: - etcd3 CA authority. env: - name: ETCDCTL_CACERT type: str timeout: default: 60 description: - Client timeout. env: - name: ETCDCTL_DIAL_TIMEOUT type: int cert_key: description: - etcd3 client private key. env: - name: ETCDCTL_KEY type: str password: description: - Authenticated user password. env: - name: ETCDCTL_PASSWORD type: str cert_cert: description: - etcd3 client certificate. env: - name: ETCDCTL_CERT type: str endpoints: default: 127.0.0.1:2379 description: - Counterpart of C(ETCDCTL_ENDPOINTS) environment variable. Specify the etcd3 connection with and URL form eg. C(https://hostname:2379) or C(<host>:<port>) form. - The C(host) part is overwritten by I(host) option, if defined. - The C(port) part is overwritten by I(port) option, if defined. env: - name: ETCDCTL_ENDPOINTS type: str
_raw: contains: key: description: The element's key. type: str value: description: The element's value. type: str description: - List of keys and associated values. elements: dict type: list