Skip to content

Commit db74f0b

Browse files
Remove redundant comment filter example (#2674) (#2689)
Since all filters work on variables, there's no need to include an example showing the filter being used with a variable. That example also happens to contain a deprecated feature, which would need to be replaced if it was not being removed here. (cherry picked from commit e28650f) Co-authored-by: Matt Clay <[email protected]>
1 parent 65b6e8f commit db74f0b

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

docs/docsite/rst/playbook_guide/playbooks_filters.rst

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,39 +1743,6 @@ That creates the following output:
17431743
###
17441744
#
17451745
1746-
The filter can also be applied to any Ansible variable. For example, to
1747-
make the output of the ``ansible_managed`` variable more readable, we can
1748-
change the definition in the ``ansible.cfg`` file to this:
1749-
1750-
.. code-block:: ini
1751-
1752-
[defaults]
1753-
1754-
ansible_managed = This file is managed by Ansible.%n
1755-
template: {file}
1756-
date: %Y-%m-%d %H:%M:%S
1757-
user: {uid}
1758-
host: {host}
1759-
1760-
and then use the variable with the `comment` filter:
1761-
1762-
.. code-block:: jinja
1763-
1764-
{{ ansible_managed | comment }}
1765-
1766-
which produces this output:
1767-
1768-
.. code-block:: sh
1769-
1770-
#
1771-
# This file is managed by Ansible.
1772-
#
1773-
# template: /home/ansible/env/dev/ansible_managed/roles/role1/templates/test.j2
1774-
# date: 2015-09-10 11:02:58
1775-
# user: ansible
1776-
# host: myhost
1777-
#
1778-
17791746
URLEncode Variables
17801747
-------------------
17811748

0 commit comments

Comments
 (0)