PARALLAX

consul_kv

Manage Consul key/value entries through the native HTTP API

Collection: community.general

Full Name: community.general.consul_kv

Synopsis

Manage Consul key/value entries through the native HTTP API

Parameters

NameTypeRequiredDefaultDescription
hoststringlocalhostConsul agent hostname or address
portint8500Consul agent HTTP port
schemestringhttpHTTP or HTTPS protocol
validate_certsbooltrueValidate the HTTPS server certificate
tokenstringConsul ACL token; redacted from results
ca_pathstringTarget PEM CA bundle path
keystringyesKey or recursive prefix
datacenterstringDatacenter to query or mutate
statestringpresentpresent, absent, acquire, or release
valuestringUTF-8 value to write; omission reads the existing value
recurseboolRead or delete all entries sharing the prefix
retrievebooltrueRead and return the entry after a value update
sessionstringSession used for acquire or release
casstringCompare-and-set modify index (0 creates only if absent)
flagsstringOpaque unsigned 64-bit Consul flags

Example

yaml
- name: Read Consul key/value entries
  community.general.consul_kv:
    key: app/config
  register: consul_result
Search
    ↑ ↓ move↵ openesc close