Posts

Showing posts with the label ansible vars

Ansible variables, Lists, Dictionaries

Image
 There are many boring tasks in your daily job which can be automated easily if you know some of the tools like here, Ansible. Let's explore more on how to use the variables in the playbooks. In this post we will be covering : Basic datatypes List variables and using them Dictionary variable and accessing them Variables and Datatypes in Ansible In Ansible variables can be defined under global tasks or they can be defined at local to a task level. support all the Python supported datatypes. --- # Filename: varibles_datatypes.yml - name: varibles in ansible hosts: localhost gather_facts: false vars: a: "Vybhava Technologies" b: yes n: 100 m: 500.99 tasks: - debug: msg: - "a= {{ a }} a type: {{ a |type_debug }}" - "b= {{ b }} b type: {{ b |type_debug }}" - "n= {{ n }} n type: {{ n |type_debug }}" - "m= {{ m }} m type: {{ m |type_debug }}" The...