fix(role): adds root and human_admin_user to sudoers in Alpine

This commit is contained in:
2026-09-16 16:51:08 +04:00
parent 996e242180
commit 74f567c8eb
+10 -1
View File
@@ -21,13 +21,22 @@
become: true
# The same commands for Alpine
- name: Update and install packages on Alpine
- name: Install sudo on Alpine
when: (ansible_facts['distribution'] == "Alpine")
community.general.apk:
name: sudo
update_cache: true
remote_user: ansible
- name: Enable sudo for root and human_admin_user
when: (ansible_facts['distribution'] == "Alpine")
ansible.builtin.copy:
dest: /etc/sudoers.d/80-ansible-created-users
content: |
root ALL=(ALL) ALL:ALL
{{ human_admin_user }} ALL=(ALL) ALL:ALL
remote_user: ansible
## Creating and setting up the ansible user
## First, create sshusers group to grant ssh access