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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| accessor_id | string | Specifies a UUID to use as the token’s Accessor ID. If not specified a UUID is generated for this field. | ||
| ca_path | string | Target PEM CA bundle path. | ||
| description | string | Free form human readable description of the token. | ||
| expiration_ttl | string | This 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! | ||
| host | string | localhost | Consul agent hostname. | |
| local | bool | If true, indicates that the token should not be replicated globally and instead be local to the current datacenter. | ||
| node_identities | list | List 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. | ||
| policies | list | List 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. | ||
| port | int | 8500 | Consul agent HTTP port. | |
| roles | list | List 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. | ||
| scheme | string | http | HTTP or HTTPS protocol. | |
| secret_id | string | Specifies a UUID to use as the token’s Secret ID. If not specified a UUID is generated for this field. | ||
| service_identities | list | List 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. | ||
| state | string | present | Whether the token should be present or absent. | |
| templated_policies | list | The list of templated policies that should be applied to the role. | ||
| token | string | Consul ACL token; private argument. | ||
| validate_certs | bool | true | Validate 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