Simple Perl variables are called scalars
. Examples of scalar values are
$number = 123;
$string = "String";
$file_handle = open "<filename";
$null_value = undef;
$instance = MyClass->new;
--- | |
# This has been tested with ansible 1.3 with these commands: | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
# NB: The type of the variable is crucial! | |
- name: Ansible Conditionals Examples | |
hosts: $hosts | |
vars_files: |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of