Skip to content

Commit

Permalink
use rsync
Browse files Browse the repository at this point in the history
  • Loading branch information
mira-miracoli committed Nov 22, 2023
1 parent 06e3b24 commit d9ebb23
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
20 changes: 10 additions & 10 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@
tags:
- galaxy_manage_cleanup

- name: Zip static directory
community.general.archive:
path: "{{ galaxy_themes_static_path }}/static/"
dest: "{{ galaxy_themes_static_path }}/static.gz"
when: galaxy_manage_subdomain_static
#- name: Zip static directory
# community.general.archive:
# path: "{{ galaxy_themes_static_path }}/static/"
# dest: "{{ galaxy_themes_static_path }}/static.gz"
# when: galaxy_manage_subdomain_static

- name: Include create subdomain static dirs and copy static files
ansible.builtin.include_tasks: setup_static_dirs.yml
Expand All @@ -178,11 +178,11 @@
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: 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
Expand Down
11 changes: 6 additions & 5 deletions tasks/setup_static_dirs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
group: "{{ __galaxy_privsep_user_group }}"
path: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}"

- name: Add generic static files to subdomain static dir
ansible.builtin.unarchive:
src: "{{ galaxy_themes_static_path }}/static.gz"
- name: Synchronize contents from static to static-"{{ subdomain.name }}"
ansible.posix.synchronize:
src: "{{ galaxy_themes_static_path }}/static/"
dest: "{{ galaxy_themes_static_path }}/static-{{ subdomain.name }}"
remote_src: yes
rsync_opts: ["--ignore-existing"]
delegate_to: "{{ inventory_hostname }}"

- name: Check if welcome.html is present in files
ansible.builtin.stat:
Expand Down Expand Up @@ -43,7 +44,7 @@
mode: '0644'
when: not custom_welcome.stat.exists

- name: Copy static files
- name: Include copy_static_files.yml
ansible.builtin.include_tasks: copy_static_files.yml
loop: "{{ galaxy_themes_static_keys | dict2items }}"
loop_control:
Expand Down

0 comments on commit d9ebb23

Please sign in to comment.