Skip to content

Commit

Permalink
fix: move to single file to allow task inclusion (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
netr0m authored Oct 30, 2023
1 parent a10de27 commit 9cc2b28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
12 changes: 0 additions & 12 deletions tasks/gather_vars.yml

This file was deleted.

4 changes: 0 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
- name: Include 'user_facts' tasks
ansible.builtin.import_tasks: user_facts.yml

# Gather variables
- name: Include 'gather_vars' tasks
ansible.builtin.import_tasks: gather_vars.yml

# Manage directories
- name: Include 'directories' tasks
ansible.builtin.import_tasks: directories.yml
Expand Down
11 changes: 11 additions & 0 deletions tasks/set_access_control.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
---
- name: Gather ACL entries
block:
- name: Find variables starting with '{{ __svc_acl_var_prefix }}'
ansible.builtin.set_fact:
__svc_acl_matches: "{{ lookup('ansible.builtin.varnames', '^{{ __svc_acl_var_prefix }}(_)?.*') | split(',') }}"

- name: Merge svc_acl entries
ansible.builtin.set_fact:
__svc_access_control_list: "{{ __svc_access_control_list + lookup('ansible.builtin.vars', item) }}"
with_items: "{{ __svc_acl_matches }}"

- name: Set access control on files
ansible.posix.acl:
path: "{{ item.path }}"
Expand Down

0 comments on commit 9cc2b28

Please sign in to comment.