PARALLAX

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

NameTypeRequiredDefaultDescription
ca_pathstringTarget PEM CA bundle path.
descriptionstringDescription of the role. If not specified, the assigned description is not changed.
hoststringlocalhostConsul agent hostname.
namestringyesA name used to identify the role.
node_identitieslistList 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.
policieslistList 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.
portint8500Consul agent HTTP port.
schemestringhttpHTTP or HTTPS protocol.
service_identitieslistList 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.
statestringpresentWhether the role 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_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
Search
    ↑ ↓ move↵ openesc close