项目作者: eagleusb

项目描述 :
Ansible role to manage HashiCorp Consul Tokens with ACL and Policies, with the newest API (Consul >= 1.4.0)
高级语言: Python
项目地址: git://github.com/eagleusb/ansible-consul-acl.git
创建时间: 2020-09-14T07:39:48Z
项目社区:https://github.com/eagleusb/ansible-consul-acl

开源协议:GNU General Public License v3.0

下载


ansible-consul-acl

Manage Consul ACL and Tokens declaratively with Ansible.

ansible-version
last-commit
license

Requirements

  • python-consul2 = “>=0.1.4”
  • requests = “*”
  • pyhcl = “>=0.4.4”

Quickstart

  1. ansible-galaxy install eagleusb.consul_acl

Variables

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

Playbook Example

  1. - name: "consul-acl"
  2. hosts: all
  3. roles:
  4. - role: "ansible-consul-acl"
  5. vars:
  6. consul_server:
  7. addr: "127.0.0.1"
  8. port: 8500
  9. scheme: "http"
  10. consul_master_token: "123-456-789"
  11. consul_client_token:
  12. - client: "foobar-todelete-later"
  13. token: "123-456-789"
  14. - client: "foobar-with-random-token"
  15. - client: "foobar-with-datacenters"
  16. datacenters:
  17. - "dc1"
  18. - client: "foobar-shuttle"
  19. token: "123-456-789"
  20. rules:
  21. event:
  22. "fiesta":
  23. policy: write
  24. key:
  25. "foo/bar":
  26. policy: read
  27. "foo/private":
  28. policy: deny
  29. keyring: write
  30. node:
  31. "my-node":
  32. policy: write
  33. operator: read
  34. query:
  35. "":
  36. policy: write
  37. service:
  38. "consul":
  39. policy: write
  40. session:
  41. "standup":
  42. policy: write
  43. consul_remove_token:
  44. - client: "foobar-todelete-later"

License

GNU GENERAL PUBLIC LICENSE Version 3