Skip to content

Commit d8c36a0

Browse files
authored
Fix YAML syntax, adjust more code block languages (#2408)
* Fix broken YAML, or adjust code block type. * Normalize code block type.
1 parent 8d58388 commit d8c36a0

32 files changed

+178
-174
lines changed

docs/docsite/rst/collections_guide/collections_using_playbooks.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This works for roles or any type of plugin distributed within the collection:
3434

3535
- name: Call a debug task
3636
ansible.builtin.debug:
37-
msg: '{{ lookup("my_namespace.my_collection.lookup1", 'param1')| my_namespace.my_collection.filter1 }}'
37+
msg: '{{ lookup("my_namespace.my_collection.lookup1", "param1") | my_namespace.my_collection.filter1 }}'
3838

3939
Simplifying module names with the ``collections`` keyword
4040
---------------------------------------------------------

docs/docsite/rst/dev_guide/developing_collections_creating.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ A collection skeleton is a directory that looks like a collection directory but
9090

9191
An example ``galaxy.yml.j2`` file that accepts an optional dictionary variable ``dependencies`` could look like this:
9292

93-
.. code-block:: yaml+jinja
93+
.. code-block:: jinja
9494
9595
namespace: {{ namespace }}
9696
name: {{ collection_name }}
97-
version: "{{ (version|quote) is version("0.0.0", operator="gt", version_type="semver")|ternary(version, undef("version must be a valid semantic version greater than 0.0.0")) }}"
98-
dependencies: {{ dependencies|default({}, true) }}
97+
version: {{ (version|quote) is version('0.0.0', operator='gt', version_type='semver')|ternary(version, undef('version must be a valid semantic version greater than 0.0.0')) }}
98+
dependencies: {{ dependencies | default({}, true) }}
9999
100100
To initialize a collection using the new template, pass the path to the skeleton with ``ansible-galaxy collection init``:
101101

docs/docsite/rst/dev_guide/migrating_roles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ You will need to use the Fully Qualified Collection Name (FQCN) to use the roles
7171

7272
So for example, in the above collection, the FQCN to access ``role1`` would be:
7373

74-
.. code-block:: Python
74+
.. code-block:: python
7575
7676
mynamespace.mycollection.role1
7777

docs/docsite/rst/dev_guide/style_guide/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ Ensure all icons, images, diagrams, and non text elements have a meaningful alte
387387

388388
To add alt text in rst:
389389

390-
.. code-block:: reStructuredText
390+
.. code-block:: rst
391391
392392
.. image:: path/networkdiag.png
393393
:width: 400
@@ -416,7 +416,7 @@ Label tables with a descriptive title.
416416

417417
For RST:
418418

419-
.. code-block:: reStructuredText
419+
.. code-block:: rst
420420
421421
.. table:: File descriptions
422422

docs/docsite/rst/inventory/implicit_localhost.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In a case like this (or ``local_action``) when Ansible needs to contact a 'local
1919

2020
.. code-block:: yaml
2121
22-
...
22+
# ...
2323
2424
hosts:
2525
localhost:

docs/docsite/rst/inventory_guide/connection_details.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ By default, Ansible connects to all remote devices with the username you are usi
2727
2828
tasks:
2929
- name: thing to do first in this playbook
30-
. . .
30+
31+
# ...
3132
3233
as a host variable in inventory:
3334

docs/docsite/rst/network/dev_guide/developing_resource_modules_network.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ For example, the resource model builder includes the ``myos_interfaces.yml`` sam
139139
short_description: 'Manages <xxxx> attributes of <network_os> <resource>'
140140
description: 'Manages <xxxx> attributes of <network_os> <resource>.'
141141
author: Ansible Network Engineer
142-
notes:
142+
notes:
143143
- 'Tested against <network_os> <version>'
144144
options:
145145
config:
@@ -361,7 +361,7 @@ This example shows how to use the generated collection in a playbook:
361361

362362
.. code-block:: yaml
363363
364-
----
364+
---
365365
- hosts: myos101
366366
gather_facts: False
367367
tasks:
@@ -616,7 +616,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy
616616
that:
617617
- "{{ overridden['after'] | symmetric_difference(result['before'])
618618
| length == 0 }}"
619-
always:
619+
always:
620620
- import_tasks: _remove_config.yaml
621621

622622

docs/docsite/rst/network/getting_started/first_inventory.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ and type in the vault password for ``my_user``.
361361

362362
The :option:`--vault-id <ansible-playbook --vault-id>` flag allows different vault passwords for different users or different levels of access. The output includes the username ``my_user`` from your ``ansible-vault`` command and uses the YAML syntax ``key: value``:
363363

364-
.. code-block:: yaml
364+
.. code-block:: text
365365
366366
ansible_password: !vault |
367367
$ANSIBLE_VAULT;1.2;AES256;my_user
@@ -376,7 +376,7 @@ This is an example using an extract from a YAML inventory, as the INI format do
376376

377377
.. code-block:: yaml
378378
379-
...
379+
# ...
380380
381381
vyos: # this is a group in yaml inventory, but you can also do under a host
382382
vars:
@@ -391,7 +391,7 @@ This is an example using an extract from a YAML inventory, as the INI format do
391391
3837646266663835640a313164343535316666653031353763613037656362613535633538386539
392392
65656439626166666363323435613131643066353762333232326232323565376635
393393
394-
...
394+
# ...
395395
396396
To use an inline vaulted variables with an INI inventory you need to store it in a 'vars' file in YAML format,
397397
it can reside in host_vars/ or group_vars/ to be automatically picked up or referenced from a play through ``vars_files`` or ``include_vars``.

docs/docsite/rst/network/user_guide/cli_parsing.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Lastly in this task, the ``set_fact`` option sets the following ``interfaces`` f
177177
Ethernet1/10:
178178
hardware: 100/1000/10000 Ethernet
179179
mac_address: 5254.005a.f8c6
180-
<...>
180+
# ...
181181
182182
183183
Linux example
@@ -278,7 +278,7 @@ Lastly in this task, the ``set_fact`` option sets the following ``interfaces`` f
278278
name: enp64s0u1
279279
state: up
280280
up: true
281-
<...>
281+
# ...
282282
283283
284284
Parsing JSON
@@ -429,7 +429,7 @@ This task sets the following fact as the ``interfaces`` fact for the host:
429429
ip: 192.168.101.14
430430
prefix_length: '24'
431431
link_state: up
432-
<...>
432+
# ...
433433
434434
435435
Parsing with textfsm
@@ -616,11 +616,11 @@ This example task runs the ``show interface`` command and parses the output as X
616616
.. code-block:: yaml
617617
618618
- name: "Run command and parse as xml"
619-
ansible.utils.cli_parse:
620-
command: show interface | xml
621-
parser:
622-
name: ansible.utils.xml
623-
set_fact: interfaces
619+
ansible.utils.cli_parse:
620+
command: show interface | xml
621+
parser:
622+
name: ansible.utils.xml
623+
register: interfaces
624624
625625
.. note::
626626

docs/docsite/rst/network/user_guide/network_debug_troubleshooting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Before running ``ansible-playbook``, run the following commands to enable loggin
5656
5757
After Ansible has finished running you can inspect the log file which has been created on the Ansible control node:
5858

59-
.. code::
59+
.. code:: console
6060
6161
less $ANSIBLE_LOG_PATH
6262

0 commit comments

Comments
 (0)