From d26ff4e3765a1979c37f904555997dc883245bc8 Mon Sep 17 00:00:00 2001 From: NarayanAdithya <57533346+NarayanAdithya@users.noreply.github.com> Date: Tue, 12 Oct 2021 02:58:07 +0530 Subject: [PATCH] Docs: changed :: to code-block:: in 9 files (#75994) * Fixed 9 files in user guide --- docs/docsite/rst/user_guide/intro_dynamic_inventory.rst | 8 ++++++-- docs/docsite/rst/user_guide/intro_inventory.rst | 4 +++- docs/docsite/rst/user_guide/playbook_pathing.rst | 4 +++- docs/docsite/rst/user_guide/playbooks_intro.rst | 8 ++++++-- docs/docsite/rst/user_guide/playbooks_lookups.rst | 4 +++- docs/docsite/rst/user_guide/playbooks_python_version.rst | 8 ++++++-- docs/docsite/rst/user_guide/windows_dsc.rst | 4 +++- docs/docsite/rst/user_guide/windows_faq.rst | 4 +++- docs/docsite/rst/user_guide/windows_usage.rst | 8 ++++++-- 9 files changed, 39 insertions(+), 13 deletions(-) diff --git a/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst b/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst index 071cd5bd119..5359e3a8d72 100644 --- a/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst +++ b/docs/docsite/rst/user_guide/intro_dynamic_inventory.rst @@ -120,7 +120,9 @@ You can use the inventory script explicitly (by passing the `-i openstack_invent Explicit use of OpenStack inventory script ------------------------------------------ -Download the latest version of the OpenStack dynamic inventory script and make it executable:: +Download the latest version of the OpenStack dynamic inventory script and make it executable. + +.. code-block:: bash wget https://raw.githubusercontent.com/openstack/ansible-collections-openstack/master/scripts/inventory/openstack_inventory.py chmod +x openstack_inventory.py @@ -144,7 +146,9 @@ You can confirm the file has been successfully sourced by running a simple comma The OpenStack command line clients are required to run the `nova list` command. For more information on how to install them, please refer to `Install the OpenStack command-line clients `_. -You can test the OpenStack dynamic inventory script manually to confirm it is working as expected:: +You can test the OpenStack dynamic inventory script manually to confirm it is working as expected: + +.. code-block:: bash ./openstack_inventory.py --list diff --git a/docs/docsite/rst/user_guide/intro_inventory.rst b/docs/docsite/rst/user_guide/intro_inventory.rst index 48c95713d4c..17143c68bf1 100644 --- a/docs/docsite/rst/user_guide/intro_inventory.rst +++ b/docs/docsite/rst/user_guide/intro_inventory.rst @@ -728,7 +728,9 @@ called :file:`inventory_staging`: To apply a playbook called :file:`site.yml` to all the app servers in the test environment, use the -following command:: +following command: + +.. code-block:: bash ansible-playbook -i inventory_test -l appservers site.yml diff --git a/docs/docsite/rst/user_guide/playbook_pathing.rst b/docs/docsite/rst/user_guide/playbook_pathing.rst index 25b964195fe..943b20e0774 100644 --- a/docs/docsite/rst/user_guide/playbook_pathing.rst +++ b/docs/docsite/rst/user_guide/playbook_pathing.rst @@ -27,7 +27,9 @@ Lookups and action plugins both use a special 'search magic' to find things, tak Using this magic, relative paths get attempted first with a 'files|templates|vars' appended (if not already present), depending on action being taken, 'files' is the default. (in other words, include_vars will use vars/). The paths will be searched from most specific to most general (in other words, role before play). dependent roles WILL be traversed (in other words, task is in role2, role2 is a dependency of role1, role2 will be looked at first, then role1, then play). -i.e :: +i.e : + +.. code-block:: text role search path is rolename/{files|vars|templates}/, rolename/tasks/. play search path is playdir/{files|vars|templates}/, playdir/. diff --git a/docs/docsite/rst/user_guide/playbooks_intro.rst b/docs/docsite/rst/user_guide/playbooks_intro.rst index 65b25ced1a6..d299d63dbc0 100644 --- a/docs/docsite/rst/user_guide/playbooks_intro.rst +++ b/docs/docsite/rst/user_guide/playbooks_intro.rst @@ -37,7 +37,9 @@ A playbook runs in order from top to bottom. Within each play, tasks also run in In Ansible 2.10 and later, we recommend you use the fully-qualified collection name in your playbooks to ensure the correct module is selected, because multiple collections can contain modules with the same name (for example, ``user``). See :ref:`collections_using_playbook`. -In this example, the first play targets the web servers; the second play targets the database servers:: +In this example, the first play targets the web servers; the second play targets the database servers. + +.. code-block:: yaml --- - name: Update web servers @@ -91,7 +93,9 @@ Most Ansible modules check whether the desired final state has already been achi Running playbooks ----------------- -To run your playbook, use the :ref:`ansible-playbook` command:: +To run your playbook, use the :ref:`ansible-playbook` command. + +.. code-block:: bash ansible-playbook playbook.yml -f 10 diff --git a/docs/docsite/rst/user_guide/playbooks_lookups.rst b/docs/docsite/rst/user_guide/playbooks_lookups.rst index 857942f0b61..785f150be69 100644 --- a/docs/docsite/rst/user_guide/playbooks_lookups.rst +++ b/docs/docsite/rst/user_guide/playbooks_lookups.rst @@ -11,7 +11,9 @@ Lookup plugins retrieve data from outside sources such as files, databases, key/ Using lookups in variables ========================== -You can populate variables using lookups. Ansible evaluates the value each time it is executed in a task (or template):: +You can populate variables using lookups. Ansible evaluates the value each time it is executed in a task (or template). + +.. code-block:: yaml+jinja vars: motd_value: "{{ lookup('file', '/etc/motd') }}" diff --git a/docs/docsite/rst/user_guide/playbooks_python_version.rst b/docs/docsite/rst/user_guide/playbooks_python_version.rst index 9627f429c4c..efcadb229cc 100644 --- a/docs/docsite/rst/user_guide/playbooks_python_version.rst +++ b/docs/docsite/rst/user_guide/playbooks_python_version.rst @@ -23,7 +23,9 @@ In Python3, those methods return a :ref:`dictionary view ` o string representation that Jinja2 returns for dictionary views cannot be parsed back into a list by Ansible. It is, however, easy to make this portable by using the :func:`list ` filter whenever using :meth:`dict.keys`, -:meth:`dict.values`, or :meth:`dict.items`:: +:meth:`dict.values`, or :meth:`dict.items`. + +.. code-block:: yaml+jinja vars: hosts: @@ -44,7 +46,9 @@ dict.iteritems() Python2 dictionaries have :meth:`~dict.iterkeys`, :meth:`~dict.itervalues`, and :meth:`~dict.iteritems` methods. -Python3 dictionaries do not have these methods. Use :meth:`dict.keys`, :meth:`dict.values`, and :meth:`dict.items` to make your playbooks and templates compatible with both Python2 and Python3:: +Python3 dictionaries do not have these methods. Use :meth:`dict.keys`, :meth:`dict.values`, and :meth:`dict.items` to make your playbooks and templates compatible with both Python2 and Python3. + +.. code-block:: yaml+jinja vars: hosts: diff --git a/docs/docsite/rst/user_guide/windows_dsc.rst b/docs/docsite/rst/user_guide/windows_dsc.rst index 255e09e7a81..b4199cd5505 100644 --- a/docs/docsite/rst/user_guide/windows_dsc.rst +++ b/docs/docsite/rst/user_guide/windows_dsc.rst @@ -366,7 +366,9 @@ The first two methods above only work when the host has access to the internet. When a host does not have internet access, the module must first be installed using the methods above on another host with internet access and then copied across. To save a module to a local filepath, the following PowerShell cmdlet -can be run:: +can be run: + +.. code-block:: powershell Save-Module -Name xWebAdministration -Path C:\temp diff --git a/docs/docsite/rst/user_guide/windows_faq.rst b/docs/docsite/rst/user_guide/windows_faq.rst index 545a3c44403..71d8ceb691a 100644 --- a/docs/docsite/rst/user_guide/windows_faq.rst +++ b/docs/docsite/rst/user_guide/windows_faq.rst @@ -199,7 +199,9 @@ of ``Win32-OpenSSH`` from the GitHub Releases page when using it with Ansible on Windows hosts. To use SSH as the connection to a Windows host, set the following variables in -the inventory:: +the inventory: + +.. code-block:: shell ansible_connection=ssh diff --git a/docs/docsite/rst/user_guide/windows_usage.rst b/docs/docsite/rst/user_guide/windows_usage.rst index 6a99b1a588e..0168bd11b88 100644 --- a/docs/docsite/rst/user_guide/windows_usage.rst +++ b/docs/docsite/rst/user_guide/windows_usage.rst @@ -402,7 +402,9 @@ The YAML specification considers the following `escape sequences