---
# tasks file for createuser
- include_vars:
   dir: vars

- name: create user sam
  ansible.builtin.user:
    name: '{{ username }}'
    group: '{{ groupname }}'
    shell: '{{ shell }}'
    generate_ssh_key: yes
    ssh_key_file: .ssh/id_rsa
  become: true

does this do the same as

useradd sam
usermod -aG docker sam
su - sam
ssh-keygen -f ~/.ssh/id_rsa -P '' -q




On Tue, Jun 28, 2022 at 9:10 AM Parth Patel <[email protected]>
wrote:

> I guess user is trying copy authorized key from host A to host B if i
> didnt mis understood.
>
> If so, use synchronize module with delegate_to parameter at task level
>
> On Tue, 28 Jun 2022 at 9:34 PM, Brian Coca <[email protected]> wrote:
>
>>
>> https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html
>>
>> --
>> ----------
>> Brian Coca
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CACVha7dwOvoMnMyqywt0g07gY6HKrA-r6cyLOYvX9eOYf%2BLzEQ%40mail.gmail.com
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/oxEKIhrfkt0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAEMGyL%2BhHm6p5yrw91B5jX7NxrrXaMsN%2BQYTMrQrwJPT01cx-Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAEMGyL%2BhHm6p5yrw91B5jX7NxrrXaMsN%2BQYTMrQrwJPT01cx-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CALmkhkpJqKKcbJYDtk3HvsaTneK-XwXiuCeF5rDDPs5GLmkgQw%40mail.gmail.com.

Reply via email to