-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Multiple values #9
Comments
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:
- 1.1.1.1
- 2.2.2.2
- 3.3.3.3 |
Thanks for this workaround! |
+1 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 |
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. |
this is necessary as long as inwx/ansible-collection#9 is not resolved
* [FIX] multiple record values dns-inwx-create.yml this is necessary as long as inwx/ansible-collection#9 is not resolved. * Update general_role_parameters.rst * Update acme_certificate_role.rst
* [ADD] DNS hoster INWX (#1) * [ADD] DNS provider 'INWX' to argument_specs.yml * [ADD] INWX sanity checks * [ADD] INWX create * [ADD] INWX cleanup * [FIX] typo in argument_specs.yml * [FIX] typo 'wait_for_txt' dns-inwx-create.yml Remove `always_ask_default_resolver: false` from module `community.dns.wait_for_txt` while 'Wait for DNS entries to propagate' * [FIX] INWX and docs (#2) * [FIX] multiple record values dns-inwx-create.yml this is necessary as long as inwx/ansible-collection#9 is not resolved. * Update general_role_parameters.rst * Update acme_certificate_role.rst * Update dns-inwx-cleanup.yml (#3) * I should update the general requirements * Create 19-add-inwx-dns-provider.yaml (#4) * [FIX] Sanity (Ⓐstable-2.10) / Extra Sanity `ERROR: docs/docsite/rst/general_role_parameters.rst:95:0: Bullet list ends without a blank line; unexpected unindent.` / `./docs/docsite/rst/general_role_parameters.rst:95:0: (WARNING/2) Bullet list ends without a blank line; unexpected unindent.` I hope that is the needed fix. * Update docs/docsite/rst/general_role_parameters.rst Co-authored-by: Felix Fontein <[email protected]> * Update docs/docsite/rst/general_role_parameters.rst Co-authored-by: Felix Fontein <[email protected]> * Update docs/docsite/rst/requirements.rst Co-authored-by: Felix Fontein <[email protected]> * Update roles/acme_certificate/meta/argument_specs.yml Co-authored-by: Felix Fontein <[email protected]> * Update roles/acme_certificate/tasks/dns-inwx-create.yml Co-authored-by: Felix Fontein <[email protected]> * Update docs/docsite/rst/general_role_parameters.rst Co-authored-by: Felix Fontein <[email protected]> * Update docs/docsite/rst/general_role_parameters.rst Co-authored-by: Felix Fontein <[email protected]> * Update roles/acme_certificate/tasks/dns-inwx-create.yml Co-authored-by: Felix Fontein <[email protected]> * Update changelogs/fragments/19-add-inwx-dns-provider.yaml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
Hello,
I would like to be able to define a record with multiple values, e.g. an "A" record with multiple IP addresses.
I know this means multiple records in the nameserver and I could use a loop in Ansible to create those records.
However, doing it that way means I can't use the "solo" option because it would leave only a single record.
Therefore it would be helpful if the INWX module allowed to define a list of values.
For example:
I would expect this to create two A records for test.example.com with values 1.1.1.1 and 2.2.2.2, and remove all other A records for test.example.com.
The text was updated successfully, but these errors were encountered: