Giter Site home page Giter Site logo

Comments (4)

NickUfer avatar NickUfer commented on June 28, 2024 2

Hey, as there seems to be some interest in this feature I'm going to implement this. It will probably be released with new record types (#12) in 1.3.0. But I can't guarantee any specific release date.

from ansible-collection.

NickUfer avatar NickUfer commented on June 28, 2024

Hi, you can remove all records with a specific name this way:

- name: Create an A record
  inwx.collection.dns:
    domain: example.com
    type: A
    record: test
#    value: '1.2.3.4' No value here, this way all records with the name 'test' are selected and deleted because of state=absent
    state: absent
    username: test_user
    password: test_password

After that you can add new records in a loop.

If you want to do both deleting and inserting in one task you can do it like this:

- name: Clear old records and replace with new ones
  inwx.collection.dns:
    domain: example.com
    type: A
    record: test
    value: '{{ item }}'
    # If first item in loop -> set solo to true to delete all other records with same name
    # Set solo to false for all following records in loop to not override them again
    solo: "{{ 'true' if inwx_a_record_values[0] == item else 'false' }}"
    username: test_user
    password: test_password
  loop: '{{ inwx_a_record_values }}'

inwx_a_record_values looks like this:

---

inwx_a_record_values:
  - 1.1.1.1
  - 2.2.2.2
  - 3.3.3.3

from ansible-collection.

laemm-line avatar laemm-line commented on June 28, 2024

Thanks for this workaround!
But there is still a problem: It recreates at least some of the records every time.
I'm looking for a solution that does not perform unnecessary updates while keeping things as simple as possible.

from ansible-collection.

Kariton avatar Kariton commented on June 28, 2024

+1
Im here for just the same feature request.
I utilize this collection for my acme challenges.

more details: felixfontein/ansible-acme#19

in my case the values look like this:

value: "['XXX', 'YYY']"
record: _acme-challenge

It would also be nice if the module would make it possible to combine the solo option with this.
so the module would ensure that ONLY THIS TWO records are present.

from ansible-collection.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.