community.general.etcd (8.5.0) — lookup

get info from an etcd server

Authors: Jan-Piet Mens (@jpmens)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Retrieves data from an etcd server

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "a value from a locally running etcd"
  ansible.builtin.debug:
    msg: "{{ lookup('community.general.etcd', 'foo/bar') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "values from multiple folders on a locally running etcd"
  ansible.builtin.debug:
    msg: "{{ lookup('community.general.etcd', 'foo', 'bar', 'baz') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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') }}"

Inputs

    
url:
    default: http://127.0.0.1:4001
    description:
    - Environment variable with the URL for the etcd server
    env:
    - name: ANSIBLE_ETCD_URL

_terms:
    description:
    - the list of keys to lookup on the etcd server
    elements: string
    required: true
    type: list

version:
    default: v1
    description:
    - Environment variable with the etcd protocol version
    env:
    - name: ANSIBLE_ETCD_VERSION

validate_certs:
    default: true
    description:
    - toggle checking that the ssl certificates are valid, you normally only want to turn
      this off with self-signed certs.
    type: boolean

Outputs

_raw:
  description:
  - List of values associated with input keys.
  elements: string
  type: list

See also