For directory (LDAP, etc..) based authentication you can create the
home directory and copy the skel over to it. Validating permissions of
course.

On Mon, Nov 17, 2014 at 7:26 AM, Greg Andrews <[email protected]> wrote:
> What about creating the user's home directory when you create the user's
> account?  Will that not work?  It would eliminate the need to perform the
> extra step of logging in as the user and then logging back out again.
>
> On Fri, Nov 14, 2014 at 8:28 AM, <[email protected]> wrote:
>>
>> My virtual machine has a setting that when the first time a user logs in,
>> it creates a home directory for the user automatically if the user does not
>> have a home directory.
>>
>> In my script, I want to achieve:  Log in as different users so that they
>> all have home directory setup. But I'm not sure how to do it.
>>
>> I tried to write this in my task:
>>  - name: Create home dir
>>    remote_user: testuser2
>>    shell: /usr/bin/whoami
>>
>> But it threw an exception:
>>
>> OpenSSH_5.9p1-hpn13v12 Debian-ts14, OpenSSL 0.9.8zc 15 Oct 2014
>> debug1: Reading configuration data /etc/ssh/ssh_config
>> debug3: key names ok:
>> [ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ssh-rsa,ssh-dss]
>> debug1: /etc/ssh/ssh_config line 13: Applying options for *
>> debug1: auto-mux: Trying existing master
>> ControlPath too long
>>
>> While if I change the remote_user to a user that has already had a home
>> directory in the machine, it will finish successfully.
>>
>> --
>> 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/30265bec-17b2-47fe-9b3f-08cd4db5eefb%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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/CAPdwyX6jDodhn2T3itQ4D_ZGRfst8cCvcUr-4ksj%3D7vzeCRE0Q%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
~ Andrew "lathama" Latham [email protected] http://lathama.net ~

-- 
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/CA%2Bqj4S_i2y5gOb%3DviDGgA_WjiEo0CABtU8-Qt45b%3Dpr02v7fYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to