21 lines
566 B
YAML
Executable File
21 lines
566 B
YAML
Executable File
---
|
|
- name: Update and upgrade current packages
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
upgrade: yes
|
|
|
|
- name: Create a user with sudo privileges which will be used for managing the host via SSH
|
|
ansible.builtin.user:
|
|
name: "{{ local_user }}"
|
|
state: present
|
|
groups: sudo
|
|
append: true
|
|
create_home: true
|
|
shell: /bin/bash
|
|
password: "{{ local_password }}"
|
|
|
|
- name: Set authorized key for remote SSH access (passwordless login)
|
|
ansible.posix.authorized_key:
|
|
user: "{{ local_user }}"
|
|
state: present
|
|
key: "{{ local_key }}" |