diff --git a/linux/compliance.yaml b/linux/compliance.yaml index 7acd74a..334e63d 100644 --- a/linux/compliance.yaml +++ b/linux/compliance.yaml @@ -12,6 +12,7 @@ - name: "Set become to true" set_fact: ansible_become: true + when: "ansible_user_id != 'root'" - name: "Include OS specific tasks" ansible.builtin.include_tasks: "compliance_{{ ansible_distribution }}.yaml" \ No newline at end of file diff --git a/linux/compliance_Alpine.yaml b/linux/compliance_Alpine.yaml index 79f364c..6daf638 100644 --- a/linux/compliance_Alpine.yaml +++ b/linux/compliance_Alpine.yaml @@ -1,10 +1,10 @@ --- ## Checks/deploys a Linux system to be managed with Ansible. -# - name: Gather all system groups -# ansible.builtin.getent: -# database: group -# split: ':' +- name: Gather all system groups + ansible.builtin.getent: + database: group + split: ':' # Add doas package - name: Install doas (for Alpine systems).