خرید بک لینک

Vote count: 0

I am trying to add users belongs to group abc into group xyz. to do this in ansible I am doing following

- name: Get the list of user belongs to abc group
  command: lid -g -n abc
  register: abc_users

- name: Add user belongs to abc group to xyz group
  user: name={{ items }} groups=xyz append=yes
  with_items: "{{ abc_users.stdout }}"

But getting following error

fatal: [10.8.17.14]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'items' is undefinedThe error appears to have been in '/home/#/workspace/#/ansible/roles/ubuntu-common/tasks/main.yml': line 26, column 3, but maynbe elsewhere in the file depending on the exact syntax problem.The offending line appears to be:n- name: Add user belongs to sentience group to docker groupn  ^ heren"}

Anyone know better way to do this ?

Thanks

asked 20 secs ago

برچسب: ansible loop over hosts,ansible loop over list,ansible loop over multiple tasks,ansible loop over variables,ansible loop over roles,ansible loop over json,ansible loop over inventory,ansible loop over directories,ansible loop over remote files,ansible loop over list of dictionaries, نویسنده: استخدام کار تاريخ: سه شنبه 9 شهريور 1395 ساعت: 21:51

صفحه بندی