Ansible role to manage Gandi resources
|
||
---|---|---|
library | ||
test | ||
.drone.yml | ||
.gitignore | ||
LICENSE | ||
mypy.ini | ||
pyproject.toml | ||
README.md | ||
requirements.txt | ||
setup.cfg | ||
tox.ini |
autonomic.gandi
Ansible libraries for managing Gandi resources.
Example
---
- hosts: localhost
gather_facts: false
connection: local
tasks:
- name: Create foobar.autonomic.zone
gandi_dns:
rest_api_key: "{{ lookup('env', 'LEXICON_GANDI_AUTH_TOKEN') }}"
domain: foobar.autonomic.zone
ipv4: 94.130.105.60
state: present
Features
- Create a new DNS entry
- Delete an existing DNS entry
- Update an existing DNS entry
Requirements
- Ansible >= 2.9.6
- dns-lexicon >= 3.3.19 (if using
gandi_dns
module)
$ pip install ansible==2.6.9 "dns-lexicon[gandi]==3.3.19"
These should be present on the localhost where you run Ansible.
Gandi DNS Setup
If you want to use the gandi_dns
module you need to prepare the environment.
export PROVIDER="gandi"
export LEXICON_GANDI_AUTH_TOKEN="${pass show users/decentral1se/gandi/api_key)"
export LEXICON_GANDI_API_PROTOCOL="rest"
You can test that everything is working by running the following.
$ lexicon gandi list autonomic.zone A
Usage
Include an entry in your requirements.yml
like so.
- src: https://git.autonomic.zone/autonomic-cooperative/autonomic.gandi
version: 0.0.1
name: autonomic.gandi
See the releases for which is the latest version.
Then make sure to download the role with ansible-galaxy install -r requirements.yml
.