Ansible modules for the Consul ACL system
Project description
# ansible-modules-consul-acl
Ansible modules for the [Consul ACL system](https://www.consul.io/docs/agent/acl-system.html):
- `consul_acl_policy`
- `consul_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
<!--prettier-ignore-->
```yaml
- 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](https://www.consul.io/docs/commands/index.html#environment-variables) will be used if they are defined:
- `CONSUL_HTTP_ADDR` for the `url` parameter. Prefix with `https://` instead of setting `CONSUL_HTTP_SSL=true`
- `CONSUL_HTTP_TOKEN` for the `token` parameter
- `CONSUL_CLIENT_CERT` for the `client_cert` parameter
- `CONSUL_CLIENT_KEY` for the `client_key` parameter
Ansible modules for the [Consul ACL system](https://www.consul.io/docs/agent/acl-system.html):
- `consul_acl_policy`
- `consul_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
<!--prettier-ignore-->
```yaml
- 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](https://www.consul.io/docs/commands/index.html#environment-variables) will be used if they are defined:
- `CONSUL_HTTP_ADDR` for the `url` parameter. Prefix with `https://` instead of setting `CONSUL_HTTP_SSL=true`
- `CONSUL_HTTP_TOKEN` for the `token` parameter
- `CONSUL_CLIENT_CERT` for the `client_cert` parameter
- `CONSUL_CLIENT_KEY` for the `client_key` parameter
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
File details
Details for the file ansible-modules-consul-acl-0.1.0.tar.gz
.
File metadata
- Download URL: ansible-modules-consul-acl-0.1.0.tar.gz
- Upload date:
- Size: 5.6 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 | 55a39fdb4b21a532509e0fffe69887b33be183815e05e7c3602d3f7213747c65 |
|
MD5 | 5ea56c1c09e0ae8efe889d47e8b11cad |
|
BLAKE2b-256 | 9a895b1e099cd2b815c315cd27a9b160df8544fd8a5681126bb2152ee95d2b32 |