Ansible role to manage Gandi resources
Go to file
Luke Murphy 767316125d
All checks were successful
continuous-integration/drone/push Build is passing
Pass in the right env var too
2020-03-29 14:46:16 +02:00
defaults Add missing role folders 2020-03-29 10:37:35 +02:00
library Pass in the right env var too 2020-03-29 14:46:16 +02:00
meta Add missing role folders 2020-03-29 10:37:35 +02:00
tasks Add missing role folders 2020-03-29 10:37:35 +02:00
test Improve env var management for LEXICON vars 2020-03-29 09:07:36 +02:00
.drone.yml Bootstrapping with python support files 2020-03-28 16:49:11 +01:00
.gitignore Bootstrapping with python support files 2020-03-28 16:49:11 +01:00
LICENSE GPL that sucker 2020-03-28 01:04:31 +01:00
mypy.ini Migrate to working DNS lookup tool 2020-03-28 18:31:05 +01:00
play.yml Improve env var management for LEXICON vars 2020-03-29 09:07:36 +02:00
pyproject.toml Improve env var management for LEXICON vars 2020-03-29 09:07:36 +02:00
README.md Pass in the right env var too 2020-03-29 14:46:16 +02:00
requirements.txt Migrate to working DNS lookup tool 2020-03-28 18:31:05 +01:00
setup.cfg Pass in the right env var too 2020-03-29 14:46:16 +02:00
tox.ini Bootstrapping with python support files 2020-03-28 16:49:11 +01:00

autonomic.gandi

Build Status

Ansible libraries for managing Gandi resources.

Example

---
- hosts: localhost
  gather_facts: false
  connection: local
  tasks:
    - name: Prepare Python dependencies
      become: true
      apt:
        name: python3-pip
        state: present

    - name: Install dns-lexicon system wide
      become: true
      pip:
        name: dns-lexicon==3.3.19
        executable: /usr/bin/pip3

    - name: Create foobar.autonomic.zone
      gandi_dns:
        gandi_rest_token: abc...
        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

$ pip install ansible==2.6.9 dns-lexicon==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

The gandi_dns module will provide the PROVIDER and LEXICON_GANDI_API_PROTOCOL environment variables internally so you only need to pass LEXICON_GANDI_AUTH_TOKEN as the gandi_rest_token argument to the task or expose it in the environment and it will be picked up.

Usage

Include an entry in your requirements.yml like so.

- src: https://git.autonomic.zone/autonomic-cooperative/autonomic.gandi/archive/0.0.5.tar.gz
  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.