Skip to main content

Selectel DNS provider for octoDNS

Project description

Selectel DNS provider for octoDNS

An octoDNS provider that targets Selectel DNS.

Contents

Installation

Install Selectel plugin in your environment and octodns itself if it is not present.

pip install octodns octodns-selectel

Capabilities

What Value
Supported records A, AAAA, ALIAS, CAA, CNAME, DNAME, MX, NS, SRV, SSHFP, TXT
Dynamic records

Configuration

Add selectel provider to config.yaml.

providers:
  selectel:
    class: octodns_selectel.SelectelProvider
    token: env/KEYSTONE_PROJECT_TOKEN

Set KEYSTONE_PROJECT_TOKEN environmental variable or write value directly in config without env/ prefix.
How to obtain required token you can read here

Quickstart

To get more details on configuration and capabilities check octodns repository

1. Organize your configs.

Project
└── .octodns
    ├── config.yaml
    └── zones
        ├── octodns-test-alias.com.yaml
        └── octodns-test.com.yaml

2. Fill octodns configuration file

# .octodns/config.yaml
providers:
  config:
    class: octodns.provider.yaml.YamlProvider
    directory: ./octodns/zones
    default_ttl: 3600
    enforce_order: True
  selectel:
    class: octodns_selectel.SelectelProvider
    token: env/KEYSTONE_PROJECT_TOKEN

zones:
  octodns-test.com.:
    sources:
      - config
    targets:
      - selectel
  octodns-test-alias.com.:
    sources:
      - config
    targets:
      - selectel

3. Prepare config for each of your zones

# .octodns/zones/octodns-test.com.yaml
'':
  - ttl: 3600
    type: A
    values:
      - 1.2.3.4
      - 1.2.3.5
  - ttl: 3600
    type: AAAA
    values: 
      - 6dc1:b9af:74ca:84e9:6c7c:5c0f:c292:9188
      - 5051:e345:9038:052c:00db:eb98:d871:8ae6
  - ttl: 3600
    type: MX
    value:
      exchange: mail1.octodns-test.com.
      preference: 10
  - ttl: 3600
    type: TXT
    values: 
      - "bar"
      - "foo"

_sip._tcp:
  - ttl: 3600
    type: SRV
    values:
    - port: 5060
      priority: 10
      target: phone1.example.com.
      weight: 60
    - port: 5030
      priority: 20
      target: phone2.example.com.
      weight: 0     

caa:
  - ttl: 3600
    type: CAA
    values:
    - flags: 0
      tag: issue
      value: octodns-test.com.

dname:
  - ttl: 3600
    type: DNAME
    value: octodns-test.com.

foo:
  - ttl: 3600
    type: CNAME
    value: bar.octodns-test.com.

sshfp:
  - ttl: 3600
    type: SSHFP
    values:
    - algorithm: 1
      fingerprint: "4158f281921260b0205508121c6f5cee879e15f22bdbc319ef2ae9fd308db3be"
      fingerprint_type: 2
    - algorithm: 4
      fingerprint: "123456789abcdef67890123456789abcdef67890123456789abcdef123456789"
      fingerprint_type: 2

txt:
  - ttl: 3600
    type: TXT
    values: 
      - "bar_txt"
      - "foo_txt"
# .octodns/zones/octodns-test-alias.com.yaml
'':
  - ttl: 3600
    type: ALIAS
    value: octodns-test.com.

4. Check and apply!

# Run config and check suggested changes
octodns-sync --config-file=.octodns/config.yaml
# Apply changes if everything is ok by adding
octodns-sync --config-file=.octodns/config.yaml --doit

Current provider vs. Legacy provider

Current provider is octodns_selectel.SelectelProvider
Legacy provider is octodns_selectel.SelectelProviderLegacy

They are not compatible. They utilize different API and created zones live on different authoritative servers. Zone created in v2 API with current provider is entirely new zone, and not available via v1 api and vice versa.

If you are going to create new zone, we strongly recommend to use SelectelProvider.
If you have zones in v1, you still can manage them with SelectelLegacyProvider.

If you updated plugin from unstable (0.x.x) version you should rename provider class in octodns config from SelectelProvider to SelectelLegacyProvider to work with legacy api.

Migration from legacy DNS API

If v1 API is still available for you and your zones are hosted there, then you probably would like to move your zones to v2. Legacy API will be eventually shutdown.
With octodns you can sync ALL your v1 zone with v2 by using both providers as in example below.
❗️IMPORTANT❗️
SELECTEL_TOKEN and KEYSTONE_PROJECT_TOKEN are different tokens!
Above we mentioned how to get keystone token, how to obtain selectel token read here

processors:
  # Selectel doesn't allow manage Root NS records
  # for skipping root ns use IgnoreRootNsFilter class
  no-root-ns:
    class: octodns.processor.filter.IgnoreRootNsFilter

providers:
  selectel_legacy:
    class: octodns_selectel.SelectelProviderLegacy
    token: env/SELECTEL_TOKEN
  selectel:
    class: octodns_selectel.SelectelProvider
    token: env/KEYSTONE_PROJECT_TOKEN

zones:
  # Using '*' to sync all zones available on account.
  "*":
    sources:
      - selectel_legacy
    processors:
    - no-root-ns
    targets:
      - selectel

Development

See the /script/ directory for some tools to help with the development process. They generally follow the Script to rule them all pattern. Most useful is ./script/bootstrap which will create a venv and install both the runtime and development related requirements. It will also hook up a pre-commit hook that covers most of what's run by CI.

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

octodns_selectel-1.0.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

octodns_selectel-1.0.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file octodns_selectel-1.0.0.tar.gz.

File metadata

  • Download URL: octodns_selectel-1.0.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for octodns_selectel-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0ae2b4aced0b052181500b438482808b32e06cf66fc24235691a87e99e8f1d1f
MD5 389adea40fa6e7117afbe03f43d3d4b2
BLAKE2b-256 aab00508283dfa54839e29f7da8a18ecc6506bbe93e53e0309841193b985620e

See more details on using hashes here.

File details

Details for the file octodns_selectel-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for octodns_selectel-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c96fc8946c1862c1811fe9200cbf1d3864e112d172c185bb32a458d41cc5cbc
MD5 649efbb68e798c13d07469be8f4c3baa
BLAKE2b-256 9bbacebe817c4c9a854221c1c72a0cf98773e457d96d7be6982f4f13aa2c85b8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page