only use become when we are not root
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
- name: "Set become to true"
|
- name: "Set become to true"
|
||||||
set_fact:
|
set_fact:
|
||||||
ansible_become: true
|
ansible_become: true
|
||||||
|
when: "ansible_user_id != 'root'"
|
||||||
|
|
||||||
- name: "Include OS specific tasks"
|
- name: "Include OS specific tasks"
|
||||||
ansible.builtin.include_tasks: "compliance_{{ ansible_distribution }}.yaml"
|
ansible.builtin.include_tasks: "compliance_{{ ansible_distribution }}.yaml"
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
---
|
---
|
||||||
## Checks/deploys a Linux system to be managed with Ansible.
|
## Checks/deploys a Linux system to be managed with Ansible.
|
||||||
|
|
||||||
# - name: Gather all system groups
|
- name: Gather all system groups
|
||||||
# ansible.builtin.getent:
|
ansible.builtin.getent:
|
||||||
# database: group
|
database: group
|
||||||
# split: ':'
|
split: ':'
|
||||||
|
|
||||||
# Add doas package
|
# Add doas package
|
||||||
- name: Install doas (for Alpine systems).
|
- name: Install doas (for Alpine systems).
|
||||||
|
|||||||
Reference in New Issue
Block a user