|
|
@ -31,10 +31,10 @@ It's actually pretty simple::
|
|
|
|
You can also use parentheses to group conditions::
|
|
|
|
You can also use parentheses to group conditions::
|
|
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
- name: "shutdown CentOS 6 and 7 systems"
|
|
|
|
- name: "shutdown CentOS 6 and Debian 7 systems"
|
|
|
|
command: /sbin/shutdown -t now
|
|
|
|
command: /sbin/shutdown -t now
|
|
|
|
when: ansible_distribution == "CentOS" and
|
|
|
|
when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == "6") or
|
|
|
|
(ansible_distribution_major_version == "6" or ansible_distribution_major_version == "7")
|
|
|
|
(ansible_distribution == "Debian" and ansible_distribution_major_version == "7")
|
|
|
|
|
|
|
|
|
|
|
|
A number of Jinja2 "filters" can also be used in when statements, some of which are unique
|
|
|
|
A number of Jinja2 "filters" can also be used in when statements, some of which are unique
|
|
|
|
and provided by Ansible. Suppose we want to ignore the error of one statement and then
|
|
|
|
and provided by Ansible. Suppose we want to ignore the error of one statement and then
|
|
|
|