What is the correct way to use with_Items to loop over two files? The playbook is failing at the 2nd task
Getting an error - TASK [Create users from vars users] ********************************************
fatal: [localhost]: FAILED! => {“failed”: true, “msg”: “the field ‘args’ has an invalid value, which appears to include a variable that is undefined. The error was: ‘ansible.vars.unsafe_proxy.AnsibleUnsafeText object’ has no attribute ‘users’\n\nThe error appears to have been in ‘/etc/ansible/playbooks/exercises/usersgroups.yml’: line 15, column 6, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Create users from vars users\n ^ here\n”}
Assuming that what you want to do is create a number of groups listed
in the grouplist variable, and then create the users listed in the
users variable, where each user is member of all groups in the
grouplist variable, your second task should be one of the following
(Ansible 2.3 can accept lists directly in "groups" attribute):