fix(role): adds root and human_admin_user to sudoers in Alpine
This commit is contained in:
@@ -21,13 +21,22 @@
|
|||||||
become: true
|
become: true
|
||||||
|
|
||||||
# The same commands for Alpine
|
# The same commands for Alpine
|
||||||
- name: Update and install packages on Alpine
|
- name: Install sudo on Alpine
|
||||||
when: (ansible_facts['distribution'] == "Alpine")
|
when: (ansible_facts['distribution'] == "Alpine")
|
||||||
community.general.apk:
|
community.general.apk:
|
||||||
name: sudo
|
name: sudo
|
||||||
update_cache: true
|
update_cache: true
|
||||||
remote_user: ansible
|
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
|
## Creating and setting up the ansible user
|
||||||
## First, create sshusers group to grant ssh access
|
## First, create sshusers group to grant ssh access
|
||||||
|
|||||||
Reference in New Issue
Block a user