I am receiving the following error message:
fatal: [127.0.0.1]: FAILED! => {"failed": true, "reason": "ERROR! no action detected in task\n\nThe error appears to have been in '/etc/ansible/roles/user-manage/tasks/add-users.yml': line 8, column 4, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Add multiple users\n ^ here\n"}
Here is my playbook that it is complaining about:
- name: Add new group if it doesn't exist already
group:
name: "{{ item }}"
with_items:
- "{{ group_add }}"
when: group_add is defined
- name: Add multiple users
users:
name: "{{ item.users_name }}"
comment: "{{item.users_comment }}"
uid: "{{ item.users_uid }}"
group: "{{ item.users_group }}"
groups: "{{ item.users_groups }}"
shell: "{{ item.users_shell }}"
state: "{{ item.users_state }}"
append: yes
with_items:
- "{{ users_add }}"
- name: Add SSH key for user
authorized_key:
user: "{{ item.name }}"
key: "{{ lookup('file', '/etc/ansible/files/keys/{{ item.users_name }}.pub') }}"
with_items:
- "{{ users_add }}"
This was just working last night. I'm unsure of what is causing this. Any ideas?