Skip to content

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

@brad2014

Description

@brad2014

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementissues that request a enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions