salt.states.libcloud_dns module

Manage DNS records and zones using libcloud

codeauthor

Anthony Shaw <anthonyshaw@apache.org>

New in version 2016.11.0.

Create and delete DNS records or zones through Libcloud. Libcloud's DNS system supports over 20 DNS providers including Amazon, Google, GoDaddy, Softlayer

This module uses libcloud, which can be installed via package, or pip.

configuration

This module uses a configuration profile for one or multiple DNS providers

libcloud_dns:
  profile1:
    driver: godaddy
    key: 2orgk34kgk34g
  profile2:
    driver: route53
    key: blah
    secret: blah

Example:

my-zone:
  libcloud_dns.zone_present:
    - name: mywebsite.com
    - profile: profile1
my-website:
  libcloud_dns.record_present:
    - name: www
    - zone: mywebsite.com
    - type: A
    - data: 12.34.32.3
    - profile: profile1
    - require:
      - libcloud_dns: my-zone
depends

apache-libcloud

salt.states.libcloud_dns.record_absent(name, zone, type, data, profile)

Ensures a record is absent.

Parameters
  • name (str) -- Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string ('') for this argument.

  • zone (str) -- Zone where the requested record is created, the domain name

  • type (str) -- DNS record type (A, AAAA, ...).

  • data (str) -- Data for the record (depends on the record type).

  • profile (str) -- The profile key

salt.states.libcloud_dns.record_present(name, zone, type, data, profile)

Ensures a record is present.

Parameters
  • name (str) -- Record name without the domain name (e.g. www). Note: If you want to create a record for a base domain name, you should specify empty string ('') for this argument.

  • zone (str) -- Zone where the requested record is created, the domain name

  • type (str) -- DNS record type (A, AAAA, ...).

  • data (str) -- Data for the record (depends on the record type).

  • profile (str) -- The profile key

salt.states.libcloud_dns.state_result(result, message, name, changes=None)
salt.states.libcloud_dns.zone_absent(domain, profile)

Ensures a record is absent.

Parameters
  • domain (str) -- Zone name, i.e. the domain name

  • profile (str) -- The profile key

salt.states.libcloud_dns.zone_present(domain, type, profile)

Ensures a record is present.

Parameters
  • domain (str) -- Zone name, i.e. the domain name

  • type (str) -- Zone type (master / slave), defaults to master

  • profile (str) -- The profile key