ansible.builtin.etcd (v2.9.27) — lookup

get info from an etcd server

| "added in version" 2.1 of ansible.builtin"

Authors: Jan-Piet Mens (@jpmens)

Install Ansible via pip

Install with pip install ansible==2.9.27

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"
      debug: msg={{ lookup('etcd', 'foo/bar') }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: "values from multiple folders on a locally running etcd"
      debug: msg={{ lookup('etcd', 'foo', 'bar', 'baz') }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
    - name: "since Ansible 2.5 you can set server options inline"
      debug: msg="{{ lookup('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: strings
  type: list