Comments (4)
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.
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.
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.
+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 (14)
- Can't install with ansible-galaxy collection HOT 3
- Could not find imported module support code HOT 5
- diff support
- dns_info module HOT 3
- Support for API keys HOT 10
- type SRV api failed HOT 2
- add inwx to the official ansible-modules HOT 1
- Deleting record not working? HOT 3
- Galaxy URL in README is no longer optimal HOT 1
- inwx.collection.session results always in 2200 Authentication error HOT 2
- Add support for 2FA HOT 13
- Documented TTL limits do not match API HOT 1
- Using the module causes systemd WALL messages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection.