If i declare a variable inside a Group_vars with a value of 1 or 2 or any integer, then if i use that varible inside a playbook it works with all module (or) place, but not with SERIAL: (this place) which does run the playbook in serial manner. the error occurs is the variable is undefined
I had tried By using the declared variable in the playbook in all places like calling it in a command section or given in a task at all places it calls the value which i declared, But it is not calling the value at SERIAL: (this place) with a declared variable at group_vars with a int value, the error occurs is the variable is undefined
In Hosts
[server]
192.168.1.71
192.168.1.72
In Group_vars/server.yml
---
Serial_Value: 1
become_condition: yes
become_user_as: root
In playbooks/serial.yml
---
- hosts: server
serial: "{{ Serial_Value }}"
become: "{{ become_condition }}"
become_user: "{{ become_user_as }}"
gather_facts: no
tasks:
- name: task_one
command: echo "{{ Serial_Value }}" >output3.txt
I need the solution that the Serial_Value should call the value i declared in the group_vars OR I need the reason Why it Cant be done.