Files
ansible_uni_deploy/playbooks/hosts/matej-server.yml

33 lines
789 B
YAML

---
- hosts: matej-server
tasks:
- name: Create godan user
ansible.builtin.user:
name: godan
state: present
create_home: yes
shell: /bin/bash
become: yes
- name: Add godan user to sudo group
ansible.builtin.user:
name: godan
groups: sudo
append: yes
become: yes
- name: Add SSH authorized key for godan user
ansible.posix.authorized_key:
user: godan
state: present
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOBa7padbnxWe1Ct5jguWdJ1rhRrDqk6m6xJA0OJzkQv"
become: yes
- name: No password for sudo
become: true
community.general.sudoers:
nopassword: true
commands: ALL
user: "godan"
name: "No password for sudo"