I've been trying to use the group and user module to create a user account
that has SSH rights.
the tasks i'm running are:
- name: Add jenkins user
user: name=jenkins comment=Jenkins password=foobar system=yes
sudo: yes
and although the user is created SSH isn't set up properly: If I try to
connect as the user jenkins I get authenticated but the connection
immediately closes.
previously I'd used a sequence of shell commands:
- name: Create Jenkins user
shell: "{{item}}"
with_items:
- "dscl . -create /Users/jenkins"
- "dscl . -create /Users/jenkins UserShell /bin/bash"
- "dscl . -create /Users/jenkins RealName 'Jenkins'"
- "dscl . -create /Users/jenkins UniqueID
{{unique_id_generator.stdout}}"
- "dscl . -create /Users/jenkins PrimaryGroupID 20"
- "dscl . -create /Users/jenkins NFSHomeDirectory /Users/jenkins"
- "createhomedir -c > /dev/null"
- "dscl . append /Groups/com.apple.access_ssh user jenkins"
- "dscl . append /Groups/com.apple.access_ssh groupmembers `dscl . read
/Users/jenkins GeneratedUID | cut -d ' ' -f 2`"
- "dscl . -passwd /Users/jenkins foobar"
sudo: yes
and this does work
Any ideas or is this a bug in the user module?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/280f2d49-0261-4b50-a39d-aa7fd62c4f42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.