mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-10 11:50:18 +01:00
30 lines
517 B
YAML
30 lines
517 B
YAML
# this just shows some tricks possible with variables in Ansible 1.2 and later.
|
|
|
|
---
|
|
|
|
- hosts: all
|
|
|
|
vars:
|
|
a_list:
|
|
- a
|
|
- b
|
|
- c
|
|
|
|
tasks:
|
|
- debug: msg="hello {{ ansible_hostname.upper() }}"
|
|
|
|
- shell: echo match
|
|
when: 2 == 2
|
|
|
|
- shell: echo no match
|
|
when: 2 == 2 + 1
|
|
|
|
- debug: msg="{{ ansible_os_family }}"
|
|
|
|
- shell: echo {{ item }}
|
|
with_items: a_list
|
|
|
|
- shell: echo 'RedHat'
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|