17 lines
495 B
YAML
17 lines
495 B
YAML
---
|
|
- name: Check CIS permission targets
|
|
ansible.builtin.stat:
|
|
path: "{{ item.path }}"
|
|
loop: "{{ cis_permission_targets }}"
|
|
register: cis_permission_stats
|
|
changed_when: false
|
|
|
|
- name: Set permissions for existing targets
|
|
ansible.builtin.file:
|
|
path: "{{ item.item.path }}"
|
|
owner: "{{ item.item.owner | default(omit) }}"
|
|
group: "{{ item.item.group | default(omit) }}"
|
|
mode: "{{ item.item.mode }}"
|
|
loop: "{{ cis_permission_stats.results }}"
|
|
when: item.stat.exists
|