Home > Back-end >  ansible.builtin.user module not working on macos?
ansible.builtin.user module not working on macos?

Time:07-19

I am using a playbook to create user on a remote apple m1 mac mini. It creates all the directories and it is findable by dscl but i cant find it in the GUI. Not in login screen and not in "Users & Groups".

What am i doing wrong?

- name: Creating testuser
  hosts: <redacted>
  remote_user: <redacted>
  become: true

  tasks:
  - name: User a-tester
    ansible.builtin.user:
      name: a-testuser
      comment: testuser of JK
      group: staff
      state: present
      hidden: no
      uid: 1042

CodePudding user response:

Users will only get displayed it "Users & Groups" or the login screen when said user has a password configured. I used the parameter "password" for the task, but it is not very secure as it is stored in plain text. It is also not possible for the task with dscl (which is used by ansible.builtin.user for macOS) to take the password as a secret. Creating users (especially not my own ones) with ansible is therefore unsafe and shouldnt be used in multiuser environments.

  • Related