Docs: changed :: to code-block:: in 9 files (#75994)

* Fixed 9 files in user guide
pull/76012/head
NarayanAdithya 3 years ago committed by GitHub
parent 221c7373db
commit d26ff4e376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -120,7 +120,9 @@ You can use the inventory script explicitly (by passing the `-i openstack_invent
Explicit use of OpenStack inventory script 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 wget https://raw.githubusercontent.com/openstack/ansible-collections-openstack/master/scripts/inventory/openstack_inventory.py
chmod +x 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 <https://docs.openstack.org/user-guide/common/cli_install_openstack_command_line_clients.html>`_. 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 <https://docs.openstack.org/user-guide/common/cli_install_openstack_command_line_clients.html>`_.
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 ./openstack_inventory.py --list

@ -728,7 +728,9 @@ called :file:`inventory_staging`:
To apply a playbook called :file:`site.yml` To apply a playbook called :file:`site.yml`
to all the app servers in the test environment, use the 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 ansible-playbook -i inventory_test -l appservers site.yml

@ -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). 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). 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/. role search path is rolename/{files|vars|templates}/, rolename/tasks/.
play search path is playdir/{files|vars|templates}/, playdir/. play search path is playdir/{files|vars|templates}/, playdir/.

@ -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 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 - name: Update web servers
@ -91,7 +93,9 @@ Most Ansible modules check whether the desired final state has already been achi
Running playbooks 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 ansible-playbook playbook.yml -f 10

@ -11,7 +11,9 @@ Lookup plugins retrieve data from outside sources such as files, databases, key/
Using lookups in variables 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: vars:
motd_value: "{{ lookup('file', '/etc/motd') }}" motd_value: "{{ lookup('file', '/etc/motd') }}"

@ -23,7 +23,9 @@ In Python3, those methods return a :ref:`dictionary view <python3:dict-views>` o
string representation that Jinja2 returns for dictionary views cannot be parsed back 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 into a list by Ansible. It is, however, easy to make this portable by
using the :func:`list <jinja2:jinja-filters.list>` filter whenever using :meth:`dict.keys`, using the :func:`list <jinja2:jinja-filters.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: vars:
hosts: hosts:
@ -44,7 +46,9 @@ dict.iteritems()
Python2 dictionaries have :meth:`~dict.iterkeys`, :meth:`~dict.itervalues`, and :meth:`~dict.iteritems` methods. 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: vars:
hosts: hosts:

@ -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 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 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 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 Save-Module -Name xWebAdministration -Path C:\temp

@ -199,7 +199,9 @@ of ``Win32-OpenSSH`` from the GitHub Releases page when using it with Ansible
on Windows hosts. on Windows hosts.
To use SSH as the connection to a Windows host, set the following variables in 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 ansible_connection=ssh

@ -402,7 +402,9 @@ The YAML specification considers the following `escape sequences <https://yaml.o
* ``\U........`` -- 8-digit hex escape * ``\U........`` -- 8-digit hex escape
Here are some examples on how to write Windows paths:: Here are some examples on how to write Windows paths:
.. code-block:: ini
# GOOD # GOOD
tempdir: C:\Windows\Temp tempdir: C:\Windows\Temp
@ -423,7 +425,9 @@ This is an example which will fail:
# FAILS # FAILS
tempdir: "C:\Windows\Temp" tempdir: "C:\Windows\Temp"
This example shows the use of single quotes when they are required:: This example shows the use of single quotes when they are required:
.. code-block:: yaml+jinja
--- ---
- name: Copy tomcat config - name: Copy tomcat config

Loading…
Cancel
Save