Ansible role to manage HashiCorp Consul Tokens with ACL and Policies, with the newest API (Consul >= 1.4.0)
Manage Consul ACL and Tokens declaratively with Ansible.
ansible-galaxy install eagleusb.consul_acl
Name | Required | Default Value | Description |
---|---|---|---|
consul_master_token | yes | nil | privileged master token to access consul api |
consul_server | yes | - | consul server addr, port, scheme |
consul_client_token | no | [] | tokens(s) to add or update with associated rules |
consul_remove_token | no | [] | token(s) to remove from consul |
- name: "consul-acl"
hosts: all
roles:
- role: "ansible-consul-acl"
vars:
consul_server:
addr: "127.0.0.1"
port: 8500
scheme: "http"
consul_master_token: "123-456-789"
consul_client_token:
- client: "foobar-todelete-later"
token: "123-456-789"
- client: "foobar-with-random-token"
- client: "foobar-with-datacenters"
datacenters:
- "dc1"
- client: "foobar-shuttle"
token: "123-456-789"
rules:
event:
"fiesta":
policy: write
key:
"foo/bar":
policy: read
"foo/private":
policy: deny
keyring: write
node:
"my-node":
policy: write
operator: read
query:
"":
policy: write
service:
"consul":
policy: write
session:
"standup":
policy: write
consul_remove_token:
- client: "foobar-todelete-later"