Last active
August 29, 2015 14:27
-
-
Save Sauraus/4aeefc3cc86227f43197 to your computer and use it in GitHub Desktop.
OS X user fail :(
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless tagged?('jenkins_mac_user_created') | |
bash "Creating jenkins user on Mac OSX" do | |
user "root" | |
cwd "/tmp" | |
code <<-EOH | |
#!/bin/sh | |
. /etc/rc.common | |
dscl . create /Users/jenkins | |
dscl . create /Users/jenkins RealName "Jenkins user" | |
dscl . passwd /Users/jenkins L1\\$ten2me | |
dscl . create /Users/jenkins UniqueID 504 | |
dscl . create /Users/jenkins PrimaryGroupID 20 | |
dscl . create /Users/jenkins UserShell /bin/bash | |
dscl . create /Users/jenkins NFSHomeDirectory /Users/jenkins | |
/usr/sbin/createhomedir -c -u jenkins | |
chown jenkins:staff /Users/jenkins | |
EOH | |
end | |
tag('jenkins_mac_user_created') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user 'jenkins' do | |
comment 'jenkins' | |
password jenkins_user['password'] | |
action :create | |
end | |
directory "/Users/jenkins/.ssh" do | |
user 'jenkins' | |
group staff | |
mode 0700 | |
recursive true | |
action :create | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unity-slave-macosx-1010:~ vagrant$ dscl . -read /Users/jenkins | |
dsAttrTypeNative:accountPolicyData: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>creationTime</key> | |
<real>1439580930.249377</real> | |
<key>passwordLastSetTime</key> | |
<real>1439580930.6244481</real> | |
</dict> | |
</plist> | |
AppleMetaNodeLocation: /Local/Default | |
AuthenticationAuthority: ;Kerberosv5;;jenkins@LKDC:SHA1.06FFE2F71348BB6C13810FB214E943E92AA30CEE;LKDC:SHA1.06FFE2F71348BB6C13810FB214E943E92AA30CEE ;ShadowHash;HASHLIST:<SALTED-SHA512-PBKDF2> | |
GeneratedUID: 02E70847-99FC-49B2-B9BC-93A053DAEAD3 | |
Password: ******** | |
RealName: jenkins | |
RecordName: jenkins | |
RecordType: dsRecTypeStandard:Users | |
UniqueID: 500 | |
UserShell: /usr/bin/false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* user[jenkins] action create | |
- alter user jenkins | |
* cannot determine user id for 'jenkins', does the user exist on this system? | |
================================================================================ | |
Error executing action `create` on resource 'directory[/Users/jenkins/.ssh]' | |
================================================================================ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment