I am writing ansible playbook, and set the below variable :
default_tz: 'ZONE="America/Los_Angeles"'
I am trying to add the above variable to a file, by using the below code On the same playbook:
- name: configure time zone
lineinfile:
line: "{{ default_tz }}"
dest: "/etc/sysconfig/clock"
I am getting the below error while running the playbook:
"The task includes an option with an undefined variable. The error was: 'default_tz' is undefined\
varsblock, withset_factmodule, some where in the inventory)? Can you post the actual code you have used to set the variable relative to the task that is called it?