consul_role
Create, update or remove Consul ACL roles
Collection: community.general
Full Name: community.general.consul_role
Synopsis
Create, update or remove Consul ACL roles
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| ca_path | string | Target PEM CA bundle path. | ||
| description | string | Description of the role. If not specified, the assigned description is not changed. | ||
| host | string | localhost | Consul agent hostname. | |
| name | string | yes | A name used to identify the role. | |
| node_identities | list | List of node identities to attach to the role. 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 role. 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. | |
| scheme | string | http | HTTP or HTTPS protocol. | |
| service_identities | list | List of service identities to attach to the role. 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 role 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_role:
host: consul1.example.com
name: foo-role
policies:
- id: 783beef3-783f-f41f-7422-7087dc272765
- name: policy-1
token: some_management_acl
name: Create a role with 2 policies
- community.general.consul_role:
host: consul1.example.com
name: foo-role-2
service_identities:
- datacenters:
- dc1
name: web
token: some_management_acl
name: Create a role with service identity
- community.general.consul_role:
host: consul1.example.com
name: foo-role-3
node_identities:
- datacenter: dc2
name: node-1
token: some_management_acl
name: Create a role with node identity
- community.general.consul_role:
host: consul1.example.com
name: foo-role-3
state: absent
token: some_management_acl
name: Remove a role