In the below block of an ansible playbook, what is the meaning of the |
pipe operator followed by bool
?
I get what they mean separately, but here it does not seem to make any sense to me. Why would one need to interpret a bool
as a mutli-line value ?
The pipe symbol at the end of a line in YAML signifies that any indented text that follows should be interpreted as a multi-line scalar value. See the YAML spec. https://stackoverflow.com/a/18708156/8325852
- name: Remove default nginx vhost config file (if configured).
file:
path: "{{ nginx_default_vhost_path }}"
state: absent
when: nginx_remove_default_vhost | bool
notify: restart nginx