Skip to content

Commit 746e646

Browse files
committed
Use semantic markup.
1 parent 8d8249a commit 746e646

17 files changed

+123
-120
lines changed

docs/docsite/rst/hetzner_guide.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ It also provides an inventory plugin:
2727
Authentication
2828
--------------
2929

30-
To use Hetzner's API, you need to create an API token. You can manage API tokens in the "API tokens" menu entry in your user menu in the `DNS Console <https://dns.hetzner.com/>`_. You must provide the token to the ``hetzner_token`` option of the modules, its alias ``api_token``, or pass it on in the ``HETZNER_DNS_TOKEN`` environment variable:
30+
To use Hetzner's API, you need to create an API token. You can manage API tokens in the "API tokens" menu entry in your user menu in the `DNS Console <https://dns.hetzner.com/>`_. You must provide the token to the :ansopt:`hetzner_token` option of the modules, its alias :ansopt:`api_token`, or pass it on in the :envvar:`HETZNER_DNS_TOKEN` environment variable:
3131

3232
.. code-block:: yaml+jinja
3333

@@ -96,7 +96,7 @@ The :ref:`community.dns.hetzner_dns_record_set_info module <ansible_collections.
9696
msg: There is no A record for www.example.com
9797
when: not result.set
9898

99-
In all examples in this section, you can replace ``zone_name=example.com`` by ``zone_id=aBcDeFgHiJlMnOpQrStUvW`` with the zone's ID string.
99+
In all examples in this section, you can replace :ansopt:`zone_name=example.com` by :ansopt:`zone_id=aBcDeFgHiJlMnOpQrStUvW` with the zone's ID string.
100100

101101
You can also query a list of all records for a record name or prefix:
102102

@@ -157,7 +157,7 @@ The :ref:`community.dns.hetzner_dns_record module <ansible_collections.community
157157
value: 1.1.1.1
158158
ttl: 300
159159

160-
To delete records, simply use ``state=absent``. Records will be matched by record name and type, and the TTL will be ignored:
160+
To delete records, simply use :ansopt:`state=absent`. Records will be matched by record name and type, and the TTL will be ignored:
161161

162162
.. code-block:: yaml+jinja
163163

@@ -191,9 +191,9 @@ The :ref:`community.dns.hetzner_dns_record_set module <ansible_collections.commu
191191
- 1.1.1.1
192192
- 8.8.8.8
193193

194-
If you want to assert that a record has a certain value, set ``on_existing=keep``. Using ``keep_and_warn`` instead will emit a warning if this happens, and ``keep_and_fail`` will make the module fail.
194+
If you want to assert that a record has a certain value, set :ansopt:`on_existing=keep`. Using :ansval:`keep_and_warn` instead will emit a warning if this happens, and :ansval:`keep_and_fail` will make the module fail.
195195

196-
To delete values, you can either overwrite the values with value ``[]``, or use ``state=absent``:
196+
To delete values, you can either overwrite the values with value :ansval:`[]`, or use :ansopt:`state=absent`:
197197

198198
.. code-block:: yaml+jinja
199199

@@ -223,7 +223,7 @@ To delete values, you can either overwrite the values with value ``[]``, or use
223223
value:
224224
- '::1'
225225

226-
In the third example, ``on_existing=keep_and_fail`` is present and an explicit value and TTL are given. This makes the module remove the current value only if there's a AAAA record for ``www.example.com`` whose current value is ``::1`` and whose TTL is 300. If another value is set, the module will not make any change, but fail. This can be useful to not accidentally remove values you do not want to change. To issue a warning instead of failing, use ``on_existing=keep_and_warn``, and to simply not do a change without any indication of this situation, use ``on_existing=keep``.
226+
In the third example, :ansopt:`on_existing=keep_and_fail` is present and an explicit value and TTL are given. This makes the module remove the current value only if there's a AAAA record for ``www.example.com`` whose current value is ``::1`` and whose TTL is 300. If another value is set, the module will not make any change, but fail. This can be useful to not accidentally remove values you do not want to change. To issue a warning instead of failing, use :ansopt:`on_existing=keep_and_warn`, and to simply not do a change without any indication of this situation, use :ansopt:`on_existing=keep`.
227227

228228
Bulk synchronization of DNS record sets
229229
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -248,7 +248,7 @@ The following example shows up to set/update multiple records at once:
248248
value:
249249
- '::1'
250250

251-
The next example shows how to make sure that only the given records are available and all other records are deleted. Note that for the ``type=NS`` record we used ``ignore=true``, which allows us to skip the value. It tells the module that it should not touch the ``NS`` record for ``example.com``.
251+
The next example shows how to make sure that only the given records are available and all other records are deleted. Note that for the :ansopt:`type=NS` record we used :ansopt:`ignore=true`, which allows us to skip the value. It tells the module that it should not touch the ``NS`` record for ``example.com``.
252252

253253
.. code-block:: yaml+jinja
254254

@@ -290,7 +290,7 @@ The markuman.hetzner_dns.record module
290290

291291
The ``markuman.hetzner_dns.zone_info`` module can be replaced by the :ref:`community.dns.hetzner_dns_record module <ansible_collections.community.dns.hetzner_dns_record_module>` and the :ref:`community.dns.hetzner_dns_record_set module <ansible_collections.community.dns.hetzner_dns_record_set_module>`, depending on what it is used for.
292292

293-
When creating, updating or removing single records, the :ref:`community.dns.hetzner_dns_record module <ansible_collections.community.dns.hetzner_dns_record_module>` should be used. This is the case when ``purge=false`` is specified (the default value). Note that ``replace``, ``overwrite`` and ``solo`` are aliases of ``purge``.
293+
When creating, updating or removing single records, the :ref:`community.dns.hetzner_dns_record module <ansible_collections.community.dns.hetzner_dns_record_module>` should be used. This is the case when :ansopt:`purge=false` is specified (the default value). Note that :ansopt:`replace`, :ansopt:`overwrite` and :ansopt:`solo` are aliases of :ansopt:`purge`.
294294

295295
.. code-block:: yaml+jinja
296296

@@ -356,7 +356,7 @@ When the ``markuman.hetzner_dns.record`` module is in replace mode, it should be
356356
#
357357
# value: 127.0.0.1
358358

359-
When deleting a record, it depends on whether ``value`` is specified or not. If ``value`` is specified, the module is deleting a single DNS record, and the :ref:`community.dns.hetzner_dns_record module <ansible_collections.community.dns.hetzner_dns_record_module>` should be used:
359+
When deleting a record, it depends on whether :ansopt:`value` is specified or not. If :ansopt:`value` is specified, the module is deleting a single DNS record, and the :ref:`community.dns.hetzner_dns_record module <ansible_collections.community.dns.hetzner_dns_record_module>` should be used:
360360

361361
.. code-block:: yaml+jinja
362362

@@ -383,7 +383,7 @@ When deleting a record, it depends on whether ``value`` is specified or not. If
383383
value: 127.0.0.1
384384
ttl: 60
385385

386-
When ``value`` is not specified, the ``markuman.hetzner_dns.record`` module will delete all records for this prefix and type. In that case, it operates on a record set and the :ref:`community.dns.hetzner_dns_record_set module <ansible_collections.community.dns.hetzner_dns_record_set_module>` should be used:
386+
When :ansopt:`value` is not specified, the ``markuman.hetzner_dns.record`` module will delete all records for this prefix and type. In that case, it operates on a record set and the :ref:`community.dns.hetzner_dns_record_set module <ansible_collections.community.dns.hetzner_dns_record_set_module>` should be used:
387387

388388
.. code-block:: yaml+jinja
389389

@@ -406,22 +406,22 @@ When ``value`` is not specified, the ``markuman.hetzner_dns.record`` module will
406406
# 'type' does not change:
407407
type: A
408408

409-
A last step is replacing the deprecated alias ``name`` of ``prefix`` by ``prefix``. This can be done later though, if you do not mind the deprecation warnings.
409+
A last step is replacing the deprecated alias :ansopt:`name` of :ansopt:`prefix` by :ansopt:`prefix`. This can be done later though, if you do not mind the deprecation warnings.
410410

411411
The markuman.hetzner_dns.record_info module
412412
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
413413

414414
The ``markuman.hetzner_dns.record_info`` module can be replaced by the :ref:`community.dns.hetzner_dns_record_set_info module <ansible_collections.community.dns.hetzner_dns_record_set_info_module>`. There are two big differences:
415415

416-
1. Instead of with the ``filters`` option, the output is controlled by the ``what`` option (choices ``single_record``, ``all_types_for_record``, and ``all_records``), the ``type`` option (needed when ``what=single_record``), and the ``record`` and ``prefix`` options (needed when ``what`` is not ``all_records``).
417-
2. The module returns **record sets** instead of individual records. This means that for example all A record for the prefix ``*`` are returned as one entry (with multiple values), instead of a list of records (which each a single value).
416+
1. Instead of with the :ansopt:`filters` option, the output is controlled by the :ansopt:`what` option (choices :ansval:`single_record`, :ansval:`all_types_for_record`, and :ansval:`all_records`), the :ansopt:`type` option (needed when :ansopt:`what=single_record`), and the :ansopt:`record` and :ansopt:`prefix` options (needed when :ansopt:`what` is not :ansval:`all_records`).
417+
2. The module returns **record sets** instead of individual records. This means that for example all A record for the prefix :ansval:`*` are returned as one entry (with multiple values), instead of a list of records (which each a single value).
418418

419419
The markuman.hetzner_dns.zone_info module
420420
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
421421

422422
The ``markuman.hetzner_dns.zone_info`` module can be replaced by the :ref:`community.dns.hetzner_dns_zone_info module <ansible_collections.community.dns.hetzner_dns_zone_info_module>`. The main differences are:
423423

424-
1. The parameter ``name`` must be changed to ``zone_name`` or ``zone``.
424+
1. The parameter :ansopt:`name` must be changed to :ansopt:`zone_name` or :ansopt:`zone`.
425425
2. The return value ``zone_info`` no longer has the ``name`` and ``id`` entries. Use the return values ``zone_name`` and ``zone_id`` instead.
426426

427427
The markuman.hetzner_dns.inventory inventory plugin

docs/docsite/rst/hosttech_guide.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ HostTech currently has two APIs for working with DNS records: the old WSDL-based
3030
JSON REST API
3131
~~~~~~~~~~~~~
3232

33-
To use the JSON REST API, you need to create a API token. You can manage API tokens in the "DNS Editor" in the "API" section. You must provide the token to the ``hosttech_token`` option of the modules:
33+
To use the JSON REST API, you need to create a API token. You can manage API tokens in the "DNS Editor" in the "API" section. You must provide the token to the :ansopt:`hosttech_token` option of the modules:
3434

3535
.. code-block:: yaml+jinja
3636

@@ -43,7 +43,7 @@ In the examples in this guide, we will leave the authentication options away. Pl
4343
WSDL API
4444
~~~~~~~~
4545

46-
To use the WSDL API, you need to set API credentials. These can be found and changed in the "Servercenter" and there in the "Solutions" section under settings for the "DNS Tool". The username is fixed, but the password can be changed. The credentials must be provided to the ``hosttech_username`` and ``hosttech_password`` options of the modules.
46+
To use the WSDL API, you need to set API credentials. These can be found and changed in the "Servercenter" and there in the "Solutions" section under settings for the "DNS Tool". The username is fixed, but the password can be changed. The credentials must be provided to the :ansopt:`hosttech_username` and :ansopt:`hosttech_password` options of the modules.
4747

4848
You also need to install the `lxml Python module <https://pypi.org/project/lxml/>`_ to work with the WSDL API. This can be done before using the modules:
4949

@@ -119,7 +119,7 @@ The :ref:`community.dns.hosttech_dns_record_set_info module <ansible_collections
119119
msg: There is no A record for www.example.com
120120
when: not result.set
121121

122-
In all examples in this section, you can replace ``zone_name: example.com`` by ``zone_id: 42`` with the zone's integer ID.
122+
In all examples in this section, you can replace :ansopt:`zone_name=example.com` by :ansopt:`zone_id=42` with the zone's integer ID.
123123

124124
You can also query a list of all records for a record name or prefix:
125125

@@ -180,7 +180,7 @@ The :ref:`community.dns.hosttech_dns_record module <ansible_collections.communit
180180
value: 1.1.1.1
181181
ttl: 300
182182

183-
To delete records, simply use ``state: absent``. Records will be matched by record name and type, and the TTL will be ignored:
183+
To delete records, simply use :ansopt:`state=absent`. Records will be matched by record name and type, and the TTL will be ignored:
184184

185185
.. code-block:: yaml+jinja
186186

@@ -214,9 +214,9 @@ The :ref:`community.dns.hosttech_dns_record_set module <ansible_collections.comm
214214
- 1.1.1.1
215215
- 8.8.8.8
216216

217-
If you want to assert that a record has a certain value, set ``on_existing: keep``. Using ``keep_and_warn`` instead will emit a warning if this happens, and ``keep_and_fail`` will make the module fail.
217+
If you want to assert that a record has a certain value, set :ansopt:`on_existing=keep`. Using :ansval:`keep_and_warn` instead will emit a warning if this happens, and :ansval:`keep_and_fail` will make the module fail.
218218

219-
To delete values, you can either overwrite the values with value ``[]``, or use ``state: absent``:
219+
To delete values, you can either overwrite the values with value :ansval:`[]`, or use :ansopt:`state=absent`:
220220

221221
.. code-block:: yaml+jinja
222222

@@ -246,7 +246,7 @@ To delete values, you can either overwrite the values with value ``[]``, or use
246246
value:
247247
- '::1'
248248

249-
In the third example, ``on_existing: keep_and_fail`` is present and an explicit value and TTL are given. This makes the module remove the current value only if there's a AAAA record for ``www.example.com`` whose current value is ``::1`` and whose TTL is 300. If another value is set, the module will not make any change, but fail. This can be useful to not accidentally remove values you do not want to change. To issue a warning instead of failing, use ``on_existing: keep_and_warn``, and to simply not do a change without any indication of this situation, use ``on_existing: keep``.
249+
In the third example, :ansopt:`on_existing=keep_and_fail` is present and an explicit value and TTL are given. This makes the module remove the current value only if there's a AAAA record for ``www.example.com`` whose current value is ``::1`` and whose TTL is 300. If another value is set, the module will not make any change, but fail. This can be useful to not accidentally remove values you do not want to change. To issue a warning instead of failing, use :ansopt:`on_existing=keep_and_warn`, and to simply not do a change without any indication of this situation, use :ansopt:`on_existing=keep`.
250250

251251
Bulk synchronization of DNS record sets
252252
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -271,7 +271,7 @@ The following example shows up to set/update multiple records at once:
271271
value:
272272
- '::1'
273273

274-
The next example shows how to make sure that only the given records are available and all other records are deleted. Note that for the ``type: NS`` record we used ``ignore: true``, which allows us to skip the value. It tells the module that it should not touch the ``NS`` record for ``example.com``.
274+
The next example shows how to make sure that only the given records are available and all other records are deleted. Note that for the :ansopt:`type=NS` record we used :ansopt:`ignore=true`, which allows us to skip the value. It tells the module that it should not touch the ``NS`` record for ``example.com``.
275275

276276
.. code-block:: yaml+jinja
277277

plugins/doc_fragments/hetzner.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ModuleDocFragment(object):
1515
hetzner_token:
1616
description:
1717
- The token for the Hetzner API.
18-
- If not provided, will be read from the environment variable C(HETZNER_DNS_TOKEN).
18+
- If not provided, will be read from the environment variable E(HETZNER_DNS_TOKEN).
1919
aliases:
2020
- api_token
2121
type: str
@@ -76,17 +76,17 @@ class ModuleDocFragment(object):
7676
record:
7777
description:
7878
- The full DNS record to create or delete.
79-
- Exactly one of I(record) and I(prefix) must be specified.
79+
- Exactly one of O(record) and O(prefix) must be specified.
8080
type: str
8181
prefix:
8282
description:
8383
- The prefix of the DNS record.
84-
- This is the part of I(record) before I(zone_name). For example,
84+
- This is the part of O(record) before O(zone_name). For example,
8585
if the record to be modified is C(www.example.com) for the zone
86-
C(example.com), the prefix is C(www). If the record in this
87-
example would be C(example.com), the prefix would be C('') (empty
86+
C(example.com), the prefix is V(www). If the record in this
87+
example would be C(example.com), the prefix would be V('') (empty
8888
string).
89-
- Exactly one of I(record) and I(prefix) must be specified.
89+
- Exactly one of O(record) and O(prefix) must be specified.
9090
type: str
9191
ttl:
9292
description:
@@ -119,13 +119,13 @@ class ModuleDocFragment(object):
119119
- YAML lists or multiple comma-spaced values are allowed.
120120
- When deleting a record all values for the record must be specified
121121
or it will not be deleted.
122-
- Must be specified if I(ignore=false).
122+
- Must be specified if O(ignore=false).
123123
type: list
124124
elements: str
125125
ignore:
126126
description:
127-
- If set to C(true), I(value) will be ignored.
128-
- This is useful when I(prune=true), but you do not want certain
127+
- If set to V(true), O(value) will be ignored.
128+
- This is useful when O(prune=true), but you do not want certain
129129
entries to be removed without having to know their current value.
130130
type: bool
131131
default: false

0 commit comments

Comments
 (0)