salt.modules.libcloud_dns module

Apache Libcloud DNS Management

Connection module for Apache Libcloud DNS management

New in version 2016.11.0.

configuration

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

libcloud_dns:
    profile_test1:
      driver: cloudflare
      key: 12345
      secret: mysecret
    profile_test2:
      driver: godaddy
      key: 12345
      secret: mysecret
      shopper_id: 12345
depends

apache-libcloud

salt.modules.libcloud_dns.create_record(name, zone_id, type, data, profile)

Create a new record.

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_id (str) -- Zone where the requested record is created.

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

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

  • profile (str) -- The profile key

CLI Example:

salt myminion libcloud_dns.create_record www google.com A 12.32.12.2 profile1
salt.modules.libcloud_dns.create_zone(domain, profile, type='master', ttl=None)

Create a new zone.

Parameters
  • domain (str) -- Zone domain name (e.g. example.com)

  • profile (str) -- The profile key

  • type (str) -- Zone type (master / slave).

  • ttl (int) -- TTL for new records. (optional)

CLI Example:

salt myminion libcloud_dns.create_zone google.com profile1
salt.modules.libcloud_dns.delete_record(zone_id, record_id, profile)

Delete a record.

Parameters
  • zone_id (str) -- Zone to delete.

  • record_id (str) -- Record to delete.

  • profile (str) -- The profile key

Return type

bool

CLI Example:

salt myminion libcloud_dns.delete_record google.com www profile1
salt.modules.libcloud_dns.delete_zone(zone_id, profile)

Delete a zone.

Parameters
  • zone_id (str) -- Zone to delete.

  • profile (str) -- The profile key

Return type

bool

CLI Example:

salt myminion libcloud_dns.delete_zone google.com profile1
salt.modules.libcloud_dns.extra(method, profile, **libcloud_kwargs)

Call an extended method on the driver

Parameters
  • method (str) -- Driver's method name

  • profile (str) -- The profile key

  • libcloud_kwargs (dict) -- Extra arguments for the driver's delete_container method

CLI Example:

salt myminion libcloud_dns.extra ex_get_permissions google container_name=my_container object_name=me.jpg --out=yaml
salt.modules.libcloud_dns.get_bind_data(zone_id, profile)

Export Zone to the BIND compatible format.

Parameters
  • zone_id (str) -- Zone to export.

  • profile (str) -- The profile key

Returns

Zone data in BIND compatible format.

Return type

str

CLI Example:

salt myminion libcloud_dns.get_bind_data google.com profile1
salt.modules.libcloud_dns.get_record(zone_id, record_id, profile)

Get record information for the given zone_id on the given profile

Parameters
  • zone_id (str) -- Zone to export.

  • record_id (str) -- Record to delete.

  • profile (str) -- The profile key

CLI Example:

salt myminion libcloud_dns.get_record google.com www profile1
salt.modules.libcloud_dns.get_zone(zone_id, profile)

Get zone information for the given zone_id on the given profile

Parameters
  • zone_id (str) -- Zone to export.

  • profile (str) -- The profile key

CLI Example:

salt myminion libcloud_dns.get_zone google.com profile1
salt.modules.libcloud_dns.list_record_types(profile)

List available record types for the given profile, e.g. A, AAAA

Parameters

profile (str) -- The profile key

CLI Example:

salt myminion libcloud_dns.list_record_types profile1
salt.modules.libcloud_dns.list_records(zone_id, profile, type=None)

List records for the given zone_id on the given profile

Parameters
  • zone_id (str) -- Zone to export.

  • profile (str) -- The profile key

  • type (str) -- The record type, e.g. A, NS

CLI Example:

salt myminion libcloud_dns.list_records google.com profile1
salt.modules.libcloud_dns.list_zones(profile)

List zones for the given profile

Parameters

profile (str) -- The profile key

CLI Example:

salt myminion libcloud_dns.list_zones profile1
salt.modules.libcloud_dns.update_zone(zone_id, domain, profile, type='master', ttl=None)

Update an existing zone.

Parameters
  • zone_id (str) -- Zone ID to update.

  • domain (str) -- Zone domain name (e.g. example.com)

  • profile (str) -- The profile key

  • type (str) -- Zone type (master / slave).

  • ttl (int) -- TTL for new records. (optional)

CLI Example:

salt myminion libcloud_dns.update_zone google.com google.com profile1 type=slave