The public keys are already there, since it's re-using the /home/centos 
directory. But it's not using those keys when logging in as the new user, 
the keys that are (theoretically) in the new user's home directory.

--
Todd


On Monday, August 27, 2018 at 4:18:52 PM UTC-4, Jonathan Lozada De La Matta 
wrote:
>
> Looks like you are creating the user but, not putting the public keys in 
> their home dir.
>
> On Mon, Aug 27, 2018 at 4:08 PM <[email protected] <javascript:>> wrote:
>
>> I've run a playbook that creates an EC2 instance. The AMI used to create 
>> the instance is using CentOS and installs an SSH key so that I can ssh in 
>> as username "centos" without a password. It works fine. But now I've 
>> created a subsequent playbook that configures the new server. One of the 
>> things it does is create two new users:
>>
>> - name: Create Users
>>   user:
>>     name: '{{ item.name }}'
>>     home: /home/centos
>>     create_home: yes
>>     groups:
>>       - wheel
>>       - developer
>>     append: yes
>>     comment: "CastleBranch Developer Admin"
>>     state: present
>>   loop: "{{ ansible_server_users }}"
>>
>> Notice that it's creating the new users with /home/centos as the home 
>> directory. I thought it would just set that as home directory for my new 
>> user, and that I would then be able to ssh in as that new user, using the 
>> same keys. However, after running this I am now unable to login as 
>> *anything*. Not the new users, and not "centos" either.
>>
>> I can kill the instance and create it anew. That's not a problem. But 
>> anyone have any guesses as to what happened that I can't login now?
>>
>> --
>> Todd
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d9fa9364-a77e-45da-8fc0-3aac0f6801fa%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/d9fa9364-a77e-45da-8fc0-3aac0f6801fa%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
>
> Jonathan lozada de la matta
>
> AUTOMATION CONSULTANT - AUTOMATION PRACTICE
>
> Red Hat Consulting Services <https://www.redhat.com/>
>
> [email protected] <javascript:>    
>
>
>  
>
>

-- 
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/58501d5b-1b04-4c33-8c1a-9f4b82ef1b04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to