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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| host | string | localhost | Consul agent hostname or address | |
| port | int | 8500 | Consul agent HTTP port | |
| scheme | string | http | HTTP or HTTPS protocol | |
| validate_certs | bool | true | Validate the HTTPS server certificate | |
| token | string | Consul ACL token; redacted from results | ||
| ca_path | string | Target PEM CA bundle path | ||
| key | string | yes | Key or recursive prefix | |
| datacenter | string | Datacenter to query or mutate | ||
| state | string | present | present, absent, acquire, or release | |
| value | string | UTF-8 value to write; omission reads the existing value | ||
| recurse | bool | Read or delete all entries sharing the prefix | ||
| retrieve | bool | true | Read and return the entry after a value update | |
| session | string | Session used for acquire or release | ||
| cas | string | Compare-and-set modify index (0 creates only if absent) | ||
| flags | string | Opaque unsigned 64-bit Consul flags |
Example
yaml
- name: Read Consul key/value entries
community.general.consul_kv:
key: app/config
register: consul_result