From 4d8a724071769f86cbaa3c3b59be7177f4acdd79 Mon Sep 17 00:00:00 2001 From: Alfred Tso <32275603+alfredtso@users.noreply.github.com> Date: Tue, 12 Oct 2021 05:40:01 +0800 Subject: [PATCH] docs - Replace :: with code-block:: in playbooks_conditionals doc (#75965) Fixes #75906 --- .../rst/user_guide/playbooks_conditionals.rst | 56 ++++++++++++++----- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/docs/docsite/rst/user_guide/playbooks_conditionals.rst b/docs/docsite/rst/user_guide/playbooks_conditionals.rst index 0eba01f0f59..a0bd1506d67 100644 --- a/docs/docsite/rst/user_guide/playbooks_conditionals.rst +++ b/docs/docsite/rst/user_guide/playbooks_conditionals.rst @@ -42,7 +42,9 @@ Often you want to execute or skip a task based on facts. Facts are attributes of - You can skip configuring a firewall on hosts with internal IP addresses. - You can perform cleanup tasks only when a filesystem is getting full. -See :ref:`commonly_used_facts` for a list of facts that frequently appear in conditional statements. Not all facts exist for all hosts. For example, the 'lsb_major_release' fact used in an example below only exists when the lsb_release package is installed on the target host. To see what facts are available on your systems, add a debug task to your playbook:: +See :ref:`commonly_used_facts` for a list of facts that frequently appear in conditional statements. Not all facts exist for all hosts. For example, the 'lsb_major_release' fact used in an example below only exists when the lsb_release package is installed on the target host. To see what facts are available on your systems, add a debug task to your playbook: + +.. code-block:: yaml - name: Show facts available on the system ansible.builtin.debug: @@ -67,7 +69,9 @@ If you have multiple conditions, you can group them with parentheses: when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] == "6") or (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "7") -You can use `logical operators `_ to combine conditions. When you have multiple conditions that all need to be true (that is, a logical ``and``), you can specify them as a list:: +You can use `logical operators `_ to combine conditions. When you have multiple conditions that all need to be true (that is, a logical ``and``), you can specify them as a list: + +.. code-block:: yaml tasks: - name: Shut down CentOS 6 systems @@ -76,7 +80,9 @@ You can use `logical operators