1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

enabled yaml highlighting globally, made specific emphasis for blocks in playbooks_blocks docs

This commit is contained in:
Brian Coca 2015-08-04 19:09:06 -04:00
parent 83ca5fb919
commit 479c4a4be9
2 changed files with 12 additions and 4 deletions

View file

@ -55,7 +55,7 @@ master_doc = 'index'
# General substitutions.
project = 'Ansible Documentation'
copyright = "2013 Ansible, Inc"
copyright = "2013-2015 Ansible, Inc"
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
@ -100,6 +100,8 @@ exclude_patterns = ['modules']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
highlight_language = 'YAML'
# Options for HTML output
# -----------------------

View file

@ -7,11 +7,12 @@ at the block level, which also makes it much easier to set data or directives co
to the tasks.
Example::
.. code-block:: YAML
:emphasize-lines: 2
:caption: Block example
tasks:
- block:
- yum: name={{ item }} state=installed
with_items:
- httpd
@ -25,6 +26,7 @@ Example::
become: true
become_user: root
In the example above the 3 tasks will be executed only when the block's when condition is met and enables
privilege escalation for all the enclosed tasks.
@ -35,7 +37,11 @@ Error Handling
``````````````
About Blocks
Blocks also introduce the ability to handle errors in a way similar to exceptions in most programming languages.::
Blocks also introduce the ability to handle errors in a way similar to exceptions in most programming languages.
.. code-block:: YAML
:emphasize-lines: 2,6,10
:caption: Block error handling example
tasks:
- block: