27 lines
621 B
YAML
27 lines
621 B
YAML
- hosts: '{{ target }}'
|
|
gather_facts: false
|
|
become: true
|
|
remote_user: root
|
|
any_errors_fatal: yes
|
|
tasks:
|
|
- name: add root ssh key
|
|
ansible.posix.authorized_key:
|
|
user: root
|
|
state: present
|
|
key: "{{ lookup('file', '../ssh_pub') }}"
|
|
|
|
- name: add user
|
|
user:
|
|
name: quackerd
|
|
password: "{{ user_password | password_hash('sha512', user_salt) }}"
|
|
shell: /bin/sh
|
|
groups: wheel
|
|
append: yes
|
|
state: present
|
|
|
|
- name: add user ssh key
|
|
ansible.posix.authorized_key:
|
|
user: quackerd
|
|
state: present
|
|
key: "{{ lookup('file', '../ssh_pub') }}"
|