PARALLAX

consul_token

Create, update or remove Consul ACL tokens

Collection: community.general

Full Name: community.general.consul_token

Synopsis

Create, update or remove Consul ACL tokens

Parameters

NameTypeRequiredDefaultDescription
accessor_idstringSpecifies a UUID to use as the token’s Accessor ID. If not specified a UUID is generated for this field.
ca_pathstringTarget PEM CA bundle path.
descriptionstringFree form human readable description of the token.
expiration_ttlstringThis is a convenience field and if set it initializes the C(expiration_time). Can be specified in the form of V(60s) or V(5m) (that is, 60 seconds or 5 minutes, respectively). Ingored when the token is updated!
hoststringlocalhostConsul agent hostname.
localboolIf true, indicates that the token should not be replicated globally and instead be local to the current datacenter.
node_identitieslistList of node identities to attach to the token. If not specified, any node identities currently assigned are not changed. If the parameter is an empty array (V([])), any node identities assigned are unassigned.
policieslistList of policies to attach to the token. Each policy is a dict. If the parameter is left blank, any policies currently assigned are not changed. Any empty array (V([])) clears any policies previously set.
portint8500Consul agent HTTP port.
roleslistList of roles to attach to the token. Each role is a dict. If the parameter is left blank, any roles currently assigned are not changed. Any empty array (V([])) clears any roles previously set.
schemestringhttpHTTP or HTTPS protocol.
secret_idstringSpecifies a UUID to use as the token’s Secret ID. If not specified a UUID is generated for this field.
service_identitieslistList of service identities to attach to the token. If not specified, any service identities currently assigned are not changed. If the parameter is an empty array (V([])), any node identities assigned are unassigned.
statestringpresentWhether the token should be present or absent.
templated_policieslistThe list of templated policies that should be applied to the role.
tokenstringConsul ACL token; private argument.
validate_certsbooltrueValidate the server certificate.

Example

yaml
- community.general.consul_token:
    accessor_id: 07a7de84-c9c7-448a-99cc-beaf682efd21
    expiration_ttl: 50m
    node_identities:
        - datacenter: dc1
          node_name: node1
    roles:
        - name: role1
        - name: role2
    service_identities:
        - datacenters:
            - dc1
            - dc2
          service_name: service1
    state: present
    token: 8adddd91-0bd6-d41d-ae1a-3b49cfa9a0e8
  name: Create / Update a token by accessor_id

- community.general.consul_token:
    accessor_id: 07a7de84-c9c7-448a-99cc-beaf682efd21
    state: absent
    token: 8adddd91-0bd6-d41d-ae1a-3b49cfa9a0e8
  name: Delete a token
Search
    ↑ ↓ move↵ openesc close