Ansible modules for the Consul ACL system
Project description
ansible-modules-consul-acl
Ansible modules for the Consul ACL system:
consul_acl_policyconsul_acl_token
Installation
Install using pip:
pip install ansible-modules-consul-acl
The modules have no external dependencies except Ansible.
Usage
The documentation for each module is mostly complete - use ansible-doc to view it.
Example
- name: Create ACL policy
consul_acl_policy:
name: example
# Rules specified as an HCL string
rules: |
service "example" {
policy = "write"
}
state: present
url: https://localhost:8500
token: a22c5e4f-0f48-4907-82db-843c6baf75be # Requires acl:write
register: consul_acl_policy
- name: Create ACL token
consul_acl_token:
description: Example token
# Policies specified as a list of PolicyLink objects: https://www.consul.io/api/acl/tokens.html#policies
policies:
- id: "{{ consul_acl_policy.id }}"
local: true
state: present
url: https://localhost:8500
token: a22c5e4f-0f48-4907-82db-843c6baf75be # Requires acl:write
register: consul_acl_token
Environment variables
Some of the environment variables for the Consul CLI will be used if they are defined:
CONSUL_HTTP_ADDRfor theurlparameter. Prefix withhttps://instead of settingCONSUL_HTTP_SSL=trueCONSUL_HTTP_TOKENfor thetokenparameterCONSUL_CLIENT_CERTfor theclient_certparameterCONSUL_CLIENT_KEYfor theclient_keyparameter
Testing locally
To run the functional tests, set the following environment variables from the project root directory:
export ANSIBLE_LIBRARY="$PWD/ansible/modules/consul_acl"
export ANSIBLE_MODULE_UTILS="$PWD/ansible/module_utils"
Then run the test playbooks in a Python environment without ansible-modules-consul-acl installed.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ansible-modules-consul-acl-0.4.0.tar.gz.
File metadata
- Download URL: ansible-modules-consul-acl-0.4.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
369727f0936fb146e99767aec32838a1cd579fafbb59a437478f4529522b39a4
|
|
| MD5 |
4fd5505219c524671a52b58309abbfe6
|
|
| BLAKE2b-256 |
88c997a1900f537fe1ac68dd727af6578fa1fcc4b61b8bf838428778bbc0d35e
|
File details
Details for the file ansible_modules_consul_acl-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ansible_modules_consul_acl-0.4.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a55de15bcea2ff01b81cd715772afcba925c64e83bfbe5a74615479da62ae0ba
|
|
| MD5 |
84200b00e9cc78d3f6f3b135691228d2
|
|
| BLAKE2b-256 |
61a90c7ea7e731e86578ee725abd4df63924c4296c5f85baf4b49c02bfd395eb
|