Skip to content

Commit fbb66f2

Browse files
ganeshhubalewebknjazfelixfontein
authored andcommitted
Update RST files to specify codeblock language attributes
Co-authored-by: Ganesh Hubale <[email protected]> Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
1 parent 634e6d0 commit fbb66f2

File tree

11 files changed

+45
-43
lines changed

11 files changed

+45
-43
lines changed

docs/docsite/rst/collections_guide/collections_using_playbooks.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Once installed, you can reference a collection content by its fully qualified co
1818
1919
This works for roles or any type of plugin distributed within the collection:
2020

21-
.. code-block:: yaml
21+
.. code-block:: yaml+jinja
2222

2323
- name: Reference collections contents using their FQCNs
2424
hosts: all
@@ -64,7 +64,7 @@ Using ``collections`` in playbooks
6464

6565
In a playbook, you can control the collections Ansible searches for modules and action plugins to execute. However, any roles you call in your playbook define their own collections search order; they do not inherit the calling playbook's settings. This is true even if the role does not define its own ``collections`` keyword.
6666

67-
.. code-block:: yaml
67+
.. code-block:: yaml+jinja
6868

6969
- name: Run a play using the collections keyword
7070
hosts: all
@@ -116,7 +116,7 @@ From inside a playbook:
116116
117117
A few recommendations when creating such playbooks, ``hosts:`` should be generic or at least have a variable input.
118118

119-
.. code-block:: yaml
119+
.. code-block:: yaml+jinja
120120

121121
- hosts: all # Use --limit or customized inventory to restrict hosts targeted
122122

docs/docsite/rst/dev_guide/developing_collections_creating.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ 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
93+
.. code-block:: jinja
9494
9595
namespace: {{ namespace }}
9696
name: {{ collection_name }}

docs/docsite/rst/dev_guide/developing_collections_distributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ For example, to exclude the :file:`sensitive` folder within the ``playbooks`` fo
220220
221221
By default, the ``MANIFEST.in`` style directives would exclude all files by default, but there are default directives in place. Those default directives are described below. To see the directives in use during build, pass ``-vvv`` with the ``ansible-galaxy collection build`` command.
222222

223-
.. code-block::
223+
.. code-block:: manifest
224224
225225
include meta/*.yml
226226
include *.txt *.md *.rst COPYING LICENSE

docs/docsite/rst/inventory_guide/intro_patterns.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Slicing at specific items
179179

180180
If *i* is negative, the index is relative to the end of sequence *s*: ``len(s) + i`` is substituted. However ``-0`` is ``0``.
181181

182-
.. code-block:: yaml
182+
.. code-block:: python
183183

184184
webservers[0] # == cobweb
185185
webservers[-1] # == weber
@@ -198,7 +198,7 @@ If *i* is greater than *j*, the slice is empty.
198198
If *i* is equal to *j*, the *s[i]* is substituted.
199199

200200

201-
.. code-block:: yaml
201+
.. code-block:: python
202202

203203
webservers[0:2] # == webservers[0],webservers[1],webservers[2]
204204
# == cobweb,webbing,weber

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ For any subsequent changes to the functionality, update the model first and use
123123

124124
For example, the resource model builder includes the ``myos_interfaces.yml`` sample in the :file:`models` directory, as seen below:
125125

126-
.. code-block:: yaml
126+
.. code-block:: ini
127127
128128
---
129129
GENERATOR_VERSION: '1.0'
@@ -558,7 +558,7 @@ The following example walks through the integration tests for the ``vyos.vyos.vy
558558
559559
``test/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml``
560560

561-
.. code-block:: yaml
561+
.. code-block:: yaml+jinja
562562

563563
---
564564
- debug:

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Be sure to fully understand the security implications of enabling this option. T
113113

114114
Before running ``ansible-playbook`` run the following commands to enable logging:
115115

116-
.. code-block:: text
116+
.. code-block:: shell
117117
118118
# Specify the location for the log file
119119
export ANSIBLE_LOG_PATH=~/ansible.log
@@ -140,7 +140,7 @@ To make this a global setting, add the following to your ``ansible.cfg`` file:
140140
141141
or enable the environment variable `ANSIBLE_PERSISTENT_LOG_MESSAGES`:
142142

143-
.. code-block:: text
143+
.. code-block:: shell
144144
145145
# Enable device interaction logging
146146
export ANSIBLE_PERSISTENT_LOG_MESSAGES=True
@@ -168,9 +168,9 @@ For Ansible this can be done by ensuring you are only running against one remote
168168

169169
`ad hoc` refers to running Ansible to perform some quick command using ``/usr/bin/ansible``, rather than the orchestration language, which is ``/usr/bin/ansible-playbook``. In this case we can ensure connectivity by attempting to execute a single command on the remote device:
170170

171-
.. code-block:: text
171+
.. code-block:: shell
172172
173-
ansible -m arista.eos.eos_command -a 'commands=?' -i inventory switch1.example.net -e 'ansible_connection=ansible.netcommon.network_cli' -u admin -k
173+
ansible -m arista.eos.eos_command -a 'commands=?' -i inventory switch1.example.net -e 'ansible_connection=ansible.netcommon.network_cli' -u admin -k
174174
175175
In the above example, we:
176176

@@ -184,7 +184,7 @@ If you have SSH keys configured correctly, you don't need to specify the ``-k``
184184

185185
If the connection still fails you can combine it with the enable_network_logging parameter. For example:
186186

187-
.. code-block:: text
187+
.. code-block:: shell
188188
189189
# Specify the location for the log file
190190
export ANSIBLE_LOG_PATH=~/ansible.log
@@ -208,7 +208,7 @@ The ``Socket path does not exist or cannot be found`` and ``Unable to connect t
208208

209209
For example:
210210

211-
.. code-block:: none
211+
.. code-block:: ansible-output
212212
213213
fatal: [spine02]: FAILED! => {
214214
"changed": false,
@@ -221,7 +221,7 @@ For example:
221221
222222
or
223223

224-
.. code-block:: none
224+
.. code-block:: ansible-output
225225
226226
fatal: [spine02]: FAILED! => {
227227
"changed": false,
@@ -240,13 +240,13 @@ Suggestions to resolve:
240240

241241
If the identified error message from the log file is:
242242

243-
.. code-block:: yaml
243+
.. code-block:: text
244244
245245
2017-04-04 12:19:05,670 p=18591 u=fred | command timeout triggered, timeout value is 30 secs
246246
247247
or
248248

249-
.. code-block:: yaml
249+
.. code-block:: text
250250
251251
2017-04-04 12:19:05,670 p=18591 u=fred | persistent connection idle timeout triggered, timeout value is 30 secs
252252
@@ -267,7 +267,7 @@ The ``unable to open shell`` message means that the ``ansible-connection`` daemo
267267

268268
For example:
269269

270-
.. code-block:: none
270+
.. code-block:: ansible-output
271271
272272
TASK [prepare_eos_tests : enable cli on remote device] **************************************************
273273
fatal: [veos01]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell"}
@@ -276,7 +276,7 @@ For example:
276276
or:
277277

278278

279-
.. code-block:: none
279+
.. code-block:: ansible-output
280280
281281
TASK [ios_system : configure name_servers] *************************************************************
282282
task path:
@@ -303,7 +303,7 @@ Indicates that the remote host you are trying to connect to can not be reached
303303

304304
For example:
305305

306-
.. code-block:: yaml
306+
.. code-block:: text
307307
308308
2017-04-04 11:39:48,147 p=15299 u=fred | control socket path is /home/fred/.ansible/pc/ca5960d27a
309309
2017-04-04 11:39:48,147 p=15299 u=fred | current working directory is /home/fred/git/ansible-inc/stable-2.3/test/integration
@@ -332,7 +332,7 @@ Occurs if the credentials (username, passwords, or ssh keys) passed to ``ansible
332332

333333
For example:
334334

335-
.. code-block:: yaml
335+
.. code-block:: text
336336
337337
<ios01> ESTABLISH CONNECTION FOR USER: cisco on PORT 22 TO ios01
338338
<ios01> Authentication failed.
@@ -342,7 +342,7 @@ Suggestions to resolve:
342342

343343
If you are specifying credentials through ``password:`` (either directly or through ``provider:``) or the environment variable `ANSIBLE_NET_PASSWORD` it is possible that ``paramiko`` (the Python SSH library that Ansible uses) is using ssh keys, and therefore the credentials you are specifying are being ignored. To find out if this is the case, disable "look for keys". This can be done like this:
344344

345-
.. code-block:: yaml
345+
.. code-block:: shell
346346
347347
export ANSIBLE_PARAMIKO_LOOK_FOR_KEYS=False
348348
@@ -363,7 +363,7 @@ When using persistent connections with Paramiko, the connection runs in a backgr
363363

364364
For example:
365365

366-
.. code-block:: yaml
366+
.. code-block:: text
367367
368368
2017-04-04 12:06:03,486 p=17981 u=fred | using connection plugin network_cli
369369
2017-04-04 12:06:04,680 p=17981 u=fred | connecting to host veos01 returned an error
@@ -412,7 +412,7 @@ Error: "No authentication methods available"
412412

413413
For example:
414414

415-
.. code-block:: yaml
415+
.. code-block:: text
416416
417417
2017-04-04 12:19:05,670 p=18591 u=fred | creating new control socket for host veos01:None as user admin
418418
2017-04-04 12:19:05,670 p=18591 u=fred | control socket path is /home/fred/.ansible/pc/ca5960d27a
@@ -451,15 +451,15 @@ Persistent connection idle timeout
451451

452452
By default, ``ANSIBLE_PERSISTENT_CONNECT_TIMEOUT`` is set to 30 (seconds). You may see the following error if this value is too low:
453453

454-
.. code-block:: yaml
454+
.. code-block:: text
455455
456456
2017-04-04 12:19:05,670 p=18591 u=fred | persistent connection idle timeout triggered, timeout value is 30 secs
457457
458458
Suggestions to resolve:
459459

460460
Increase value of persistent connection idle timeout:
461461

462-
.. code-block:: sh
462+
.. code-block:: shell
463463
464464
export ANSIBLE_PERSISTENT_CONNECT_TIMEOUT=60
465465
@@ -477,7 +477,7 @@ By default, ``ANSIBLE_PERSISTENT_COMMAND_TIMEOUT`` is set to 30 (seconds). Prior
477477
You may see the following error if this value is too low:
478478

479479

480-
.. code-block:: yaml
480+
.. code-block:: text
481481
482482
2017-04-04 12:19:05,670 p=18591 u=fred | command timeout triggered, timeout value is 30 secs
483483
@@ -486,7 +486,7 @@ Suggestions to resolve:
486486
* Option 1 (Global command timeout setting):
487487
Increase value of command timeout in configuration file or by setting environment variable.
488488

489-
.. code-block:: yaml
489+
.. code-block:: shell
490490
491491
export ANSIBLE_PERSISTENT_COMMAND_TIMEOUT=60
492492
@@ -510,7 +510,7 @@ Suggestions to resolve:
510510
Suggestions to resolve:
511511

512512
Some modules support a ``timeout`` option, which is different to the ``timeout`` keyword for tasks.
513-
513+
514514
.. code-block:: yaml
515515
516516
- name: save running-config
@@ -521,7 +521,7 @@ Suggestions to resolve:
521521
522522
523523
Suggestions to resolve:
524-
524+
525525
If the module does not support the ``timeout`` option directly, most networking connection plugins can enable similar functionality with the ``ansible_command_timeout`` variable.
526526

527527
.. code-block:: yaml
@@ -543,7 +543,7 @@ Persistent connection retry timeout
543543

544544
By default, ``ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT`` is set to 15 (seconds). You may see the following error if this value is too low:
545545

546-
.. code-block:: yaml
546+
.. code-block:: text
547547
548548
2017-04-04 12:19:35,708 p=18591 u=fred | connect retry timeout expired, unable to connect to control socket
549549
2017-04-04 12:19:35,709 p=18591 u=fred | persistent_connect_retry_timeout is 15 secs
@@ -555,7 +555,7 @@ Note: This value should be greater than the SSH timeout value (the timeout value
555555
section in the configuration file) and less than the value of the persistent
556556
connection idle timeout (connect_timeout).
557557

558-
.. code-block:: yaml
558+
.. code-block:: shell
559559
560560
export ANSIBLE_PERSISTENT_CONNECT_RETRY_TIMEOUT=30
561561
@@ -668,7 +668,7 @@ network device by first connecting to the host specified in
668668

669669
You can also set the proxy target for all hosts by using environment variables.
670670

671-
.. code-block:: sh
671+
.. code-block:: shell
672672
673673
export ANSIBLE_SSH_ARGS='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
674674
@@ -693,7 +693,7 @@ from the given custom ssh file path
693693
Example ssh config file (~/.ssh/config)
694694
---------------------------------------
695695

696-
.. code-block:: ini
696+
.. code-block:: shell
697697
698698
Host jumphost
699699
HostName jumphost.domain.name.com

docs/docsite/rst/os_guide/intro_bsd.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ The playbook below
157157
158158
displays the details
159159

160-
.. code-block:: yaml
160+
.. code-block:: ansible-output
161161
162162
shell> ANSIBLE_STDOUT_CALLBACK=yaml ansible-playbook -i hosts playbook.yml
163163

docs/docsite/rst/os_guide/windows_ssh.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ SSH key authentication on Windows works in the same way as SSH key authenticatio
128128

129129
One difference is that the ``authorized_keys`` file for admin users is not located in the ``.ssh`` folder in the user's profile directory but in ``C:\ProgramData\ssh\administrators_authorized_keys``. It is possible to change the location of the ``authorized_keys`` file for admin users back to the user profile directory by removing, or commenting, the lines in ``C:\ProgramData\ssh\sshd_config`` and restarting the ``sshd`` service.
130130

131-
.. code-block::
131+
.. code-block:: text
132132
133133
Match Group administrators
134134
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

docs/docsite/rst/playbook_guide/playbooks_debugger.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ If you are running legacy playbooks or roles, you may see the debugger enabled a
116116
- hosts: test
117117
strategy: debug
118118
tasks:
119-
...
119+
- name: Example task
120+
debug:
121+
msg: "This is a debug message"
120122

121123
Or in ansible.cfg:
122124

docs/docsite/rst/playbook_guide/playbooks_templating.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Ansible parses templates on the control node and passes only the information nee
1919
.. note::
2020

2121
Files and data used by the :ref:`template module <template_module>` must be utf-8 encoded.
22-
22+
2323
Jinja2 Example
2424
==================
2525

2626
In this example, we want to write the server hostname to its /tmp/hostname.
2727

2828
Our directory looks like this:
29-
30-
.. code-block::
29+
30+
.. code-block:: console
3131
3232
├── hostname.yml
3333
├── templates
@@ -51,7 +51,7 @@ Our test.j2:
5151
.. code-block:: yaml
5252
5353
My name is {{ ansible_facts['hostname'] }}
54-
54+
5555
5656
.. seealso::
5757

0 commit comments

Comments
 (0)