PARALLAX

consul_policy

Create, update or remove Consul ACL policies

Collection: community.general

Full Name: community.general.consul_policy

Synopsis

Create, update or remove Consul ACL policies

Parameters

NameTypeRequiredDefaultDescription
ca_pathstringTarget PEM CA bundle path.
descriptionstringDescription of the policy.
hoststringlocalhostConsul agent hostname.
namestringyesThe name that should be associated with the policy, this is opaque to Consul.
portint8500Consul agent HTTP port.
rulesstringRule document that should be associated with the current policy.
schemestringhttpHTTP or HTTPS protocol.
statestringpresentWhether the policy should be present or absent.
tokenstringConsul ACL token; private argument.
valid_datacenterslistValid datacenters for the policy. All if list is empty.
validate_certsbooltrueValidate the server certificate.

Example

yaml
- community.general.consul_policy:
    host: consul1.example.com
    name: foo-access
    rules: |
        key "foo" {
            policy = "read"
        }
        key "private/foo" {
            policy = "deny"
        }
    token: some_management_acl
  name: Create a policy with rules

- community.general.consul_policy:
    host: consul1.example.com
    name: foo-access
    rules: |
        key "foo" {
            policy = "read"
        }
        key "private/foo" {
            policy = "deny"
        }
        event "bbq" {
            policy = "write"
        }
    token: some_management_acl
  name: Update the rules associated to a policy

- community.general.consul_policy:
    host: consul1.example.com
    name: foo-access
    state: absent
    token: some_management_acl
  name: Remove a policy
Search
    ↑ ↓ move↵ openesc close