Files
computer-playbook/roles/sys-svc-cdn/tasks/main.yml

41 lines
1.0 KiB
YAML

---
- block:
- name: Ensure shared root and vendor exist (run once)
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ NGINX.USER }}"
group: "{{ NGINX.USER }}"
mode: "0755"
loop: "{{ CDN_DIRS_GLOBAL }}"
- include_tasks: utils/once/flag.yml
when:
- run_once_sys_svc_cdn is not defined
- name: Overwritte CDN handlers with neutral handlers
ansible.builtin.include_tasks: "tasks/utils/load_handlers.yml"
loop:
- svc-prx-openresty
- docker-compose
loop_control:
label: "{{ item }}"
vars:
handler_role_name: "{{ item }}"
- name: Ensure CDN directories exist
file:
path: "{{ item }}"
state: directory
owner: "{{ NGINX.USER }}"
group: "{{ NGINX.USER }}"
mode: "0755"
loop: "{{ cdn_dirs_role }}"
- name: Ensure 'latest' symlink points to current release
file:
src: "{{ cdn_paths_all.role.release.root }}"
dest: "{{ [cdn_paths_all.role.root, 'latest'] | path_join }}"
state: link
force: true
when: CDN_VERSION != 'latest'