I got following task to create remote user but I do not have ssh keys setup on root or any user. what can i do to create the user? I dont have the become password
tasks file for createuser
-
include_vars:
dir: vars -
name: create user rke
ansible.builtin.user:
name: ‘{{ username }}’
shell: ‘{{ shell }}’
generate_ssh_key: yes
create_home: yes
groups: ‘{{ groupname }}’
append: yes
ssh_key_file: .ssh/id_rsa
become: true -
name: create public key
ansible.builtin.shell:
cmd: “{{ command }}”
register: shell_output
become: true -
name: Change authorized keys permissions
ansible.builtin.file:
path: “{{ authorized_key_path }}”
owner: “{{ username }}”
group: “{{ username }}”
mode: ‘600’
become: true