From be79b5fbde9f01e42b53dc67587c4b47b3597d22 Mon Sep 17 00:00:00 2001 From: netr0m Date: Mon, 30 Oct 2023 16:30:34 +0100 Subject: [PATCH] fix: move to single file to allow task inclusion --- tasks/gather_vars.yml | 12 ------------ tasks/main.yml | 4 ---- tasks/set_access_control.yml | 11 +++++++++++ 3 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 tasks/gather_vars.yml 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 }}"