diff --git a/tasks/gather_vars.yml b/tasks/gather_vars.yml deleted file mode 100644 index 4417437..0000000 --- a/tasks/gather_vars.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- 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 }}" -... diff --git a/tasks/main.yml b/tasks/main.yml index e74608d..4b24d8d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/tasks/set_access_control.yml b/tasks/set_access_control.yml index 8d76e79..40ff266 100644 --- a/tasks/set_access_control.yml +++ b/tasks/set_access_control.yml @@ -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 }}"