can anyone help me, how to execute ansible playbook on multiple users in the same host.
fine the below my inventory file and playbook:
Note: it will execute only app2 if i execute the below playbook but i want to execute the playbook on all users
app1 app2 and app3 are groups, not hosts, you have a single host in
all 4 groups, 10.0.0.1 and only one ansible_user/ansible_connection
value (since they are squashed to the single host)
Inventory hostname is the unique identifier, the above creates app1
and app2 as 'aliases' of the same 'real host' (10.0;0.1)
Since they are unique the variables won't be merged.
I have created a group level variable for each child group when I tried “parent:child” inventory but now how can assign the different variable at the time playbook execution for each user in the same host.
I just tried once again and am now able to connect all the hosts but getting below error. I have created group variables for each user but it’s not working when I execute the playbook. can you please suggest to me how I can achieve this?
Error Screenshot:
TASK [t24-app : Download R21 AMR package] **********************************************************************************************************************************
fatal: [PERU]: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘t24_unix_product_tmp’ is undefined\n\nThe error appears to be in ‘/oams/Bankareas/ansadmin/t24-product/roles/t24-app/tasks/main.yml’: line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# tasks file for t24-app\n- name: Download R21 AMR package\n ^ here\n”}
fatal: [BRMB]: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘t24_unix_product_tmp’ is undefined\n\nThe error appears to be in ‘/oams/Bankareas/ansadmin/t24-product/roles/t24-app/tasks/main.yml’: line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# tasks file for t24-app\n- name: Download R21 AMR package\n ^ here\n”}
fatal: [COMB]: FAILED! => {“msg”: “The task includes an option with an undefined variable. The error was: ‘t24_unix_product_tmp’ is undefined\n\nThe error appears to be in ‘/oams/Bankareas/ansadmin/t24-product/roles/t24-app/tasks/main.yml’: line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n# tasks file for t24-app\n- name: Download R21 AMR package\n ^ here\n”}