linode / linode/ansible_linode

[Feature]: Allow linode.cloud.domain_records to calculate the domain from the fqdn in the name

Open
#663 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
63
Forks
38
Avg merge
5d 20h
Merged PRs (30d)
7

Description

Description

Currently, if I want to create an A record for a.b.example.com, I have to iterate through the list of domains to decide if it should be name=a,domain=b.example.com or name=a.b,domain=example.com

This feature request is that the domain should be optional. If it is missing, the list of domains is searched for the longest tail match for the fqdn in the name field. Of course, if there is no match, then return a "domain is required" error.

The idea is that we have variables that are just arrays of fqdn's, some of which are domain apex, some subdomains, and some subsubdomains, and there is no good way to calculate in ansible what domain to use unless the calculation can be done within the module.

New/Affected Components

linode.cloud.domain_record

Example Ansible Config

Thus these would work:

- name: Create an A record with name="", assuming domain my-domain.com exists.
  linode.cloud.domain_record:
    name: my-domain.com
    type: 'A'
    target: '127.0.0.1'
    state: present

- name: Create an A record in domain b.my-domain.com, if it exists, otherwise in domain my-domain.com with name "a.b".
  linode.cloud.domain_record:
    name: a.b.my-domain.com
    type: 'A'
    target: '127.0.0.1'
    state: present

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the linode.cloud.domain_record component named in the issue and trace how its name, domain, and domain list are currently handled. Verify the longest-tail matching behavior and the required-domain error against the two YAML examples; the issue does not name a file or test, so locate the component's existing test coverage first.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible
Domain
cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.