Skip to content

Commit 2194bf3

Browse files
fix: Remove stray reference to group_by_module (#2142) (#2143)
Reference to group_by_module was substituted in where it did not make sense: ansible/ansible#43856 This reference is not essential. It is already referenced indirectly, via :ref:`os_variance`. Revert back to referencing the variables page. Credit for fix and diagnosis: @samccann. See issue #2077. (cherry picked from commit 4f0f5d1) Co-authored-by: Alan Jenkins <[email protected]>
1 parent 673ff2f commit 2194bf3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/docsite/rst/playbook_guide/playbooks_conditionals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Ansible uses Jinja2 :ref:`tests <playbooks_tests>` and :ref:`filters <playbooks_
2020
Basic conditionals with ``when``
2121
================================
2222

23-
The simplest conditional statement applies to a single task. Create the task, then add a ``when`` statement that applies a test. The ``when`` clause is a raw Jinja2 expression without double curly braces (see :ref:`group_by_module`). When you run the task or playbook, Ansible evaluates the test for all hosts. On any host where the test passes (returns a value of True), Ansible runs that task. For example, if you are installing mysql on multiple machines, some of which have SELinux enabled, you might have a task to configure SELinux to allow mysql to run. You would only want that task to run on machines that have SELinux enabled:
23+
The simplest conditional statement applies to a single task. Create the task, then add a ``when`` statement that applies a test. The ``when`` clause is a raw Jinja2 expression without double curly braces (see :ref:`jinja2_simple`). When you run the task or playbook, Ansible evaluates the test for all hosts. On any host where the test passes (returns a value of True), Ansible runs that task. For example, if you are installing mysql on multiple machines, some of which have SELinux enabled, you might have a task to configure SELinux to allow mysql to run. You would only want that task to run on machines that have SELinux enabled:
2424

2525
.. code-block:: yaml
2626

docs/docsite/rst/playbook_guide/playbooks_variables.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ You can define a simple variable using standard YAML syntax. For example:
5555

5656
remote_install_path: /opt/my_app_config
5757

58+
.. _jinja2_simple:
59+
5860
Referencing simple variables
5961
----------------------------
6062

0 commit comments

Comments
 (0)