diff --git a/tasks/main.yml b/tasks/main.yml index f6ca273..0795ca5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -161,41 +161,12 @@ tags: - galaxy_manage_cleanup -- name: Create welcome.html directory for basedomain - ansible.builtin.file: - state: directory - mode: '0755' - owner: "{{ __galaxy_privsep_user_name }}" - group: "{{ __galaxy_privsep_user_group }}" - path: "{{ galaxy_themes_static_path }}/static/welcome.html" - when: galaxy_manage_subdomain_static - -- name: Template welcome.html for basedomain - ansible.builtin.template: - src: welcome.html.j2 - dest: "{{ galaxy_themes_static_path }}/static/welcome.html/index.html" - owner: "{{ __galaxy_privsep_user_name }}" - group: "{{ __galaxy_privsep_user_group }}" - mode: '0644' - when: galaxy_manage_subdomain_static - -- name: Include create subdomain static dirs and copy static files - ansible.builtin.include_tasks: setup_static_dirs.yml - # fail only if enabled but dictionary is empty - loop: "{{ galaxy_themes_subdomains if galaxy_themes_subdomains|length or \ - galaxy_manage_static else [] }}" - loop_control: - loop_var: subdomain +- name: Inlcude static directory setup + ansible.builtin.include_tasks: static_dirs.yml when: galaxy_manage_subdomain_static tags: - galaxy_manage_subdomain_static -#- name: Remove static archive -# ansible.builtin.file: -# path: "{{ galaxy_themes_static_path }}/static.gz" -# state: absent -# when: galaxy_manage_subdomain_static - - name: Include copy themes files ansible.builtin.include_tasks: themes.yml # fail only if enabled but dictionary is empty diff --git a/tasks/static_dirs.yml b/tasks/static_dirs.yml new file mode 100644 index 0000000..c59ab2c --- /dev/null +++ b/tasks/static_dirs.yml @@ -0,0 +1,23 @@ +--- +- name: Create welcome.html directory for basedomain + ansible.builtin.file: + state: directory + mode: '0755' + owner: "{{ __galaxy_privsep_user_name }}" + group: "{{ __galaxy_privsep_user_group }}" + path: "{{ galaxy_themes_static_path }}/static/welcome.html" + +- name: Template welcome.html for basedomain + ansible.builtin.template: + src: welcome.html.j2 + dest: "{{ galaxy_themes_static_path }}/static/welcome.html/index.html" + owner: "{{ __galaxy_privsep_user_name }}" + group: "{{ __galaxy_privsep_user_group }}" + mode: '0644' + +- name: Include create subdomain static dirs and copy static files + ansible.builtin.include_tasks: static_subdomain_dirs.yml + loop: "{{ galaxy_themes_subdomains if galaxy_themes_subdomains | length or \ + galaxy_manage_static else [] }}" + loop_control: + loop_var: subdomain diff --git a/tasks/setup_static_dirs.yml b/tasks/static_subdomain_dirs.yml similarity index 100% rename from tasks/setup_static_dirs.yml rename to tasks/static_subdomain_dirs.yml