This repository was archived by the owner on Oct 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.yml
More file actions
60 lines (53 loc) · 1.78 KB
/
main.yml
File metadata and controls
60 lines (53 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- ansible.builtin.set_fact:
_live_symlink_build_target: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_{{ build_number }}"
- ansible.builtin.set_fact:
_live_symlink_build_target: "{{ deploy_base_path }}/{{ project_name }}_{{ build_type }}_build_{{ previous_build_number }}"
when:
- deploy_operation == 'revert'
- live_symlink.revert_on_fail
- ansible.builtin.set_fact:
_live_symlink_dest_target: "{{ live_symlink_dest }}"
- ansible.builtin.set_fact:
_live_symlink_dest_target: "{{ live_symlink_build_dest }}"
when: deploy_code.mount_type == "squashfs"
- name: Symlink build.
ansible.builtin.file:
src: "{{ _live_symlink_build_target }}"
dest: "{{ _live_symlink_dest_target }}"
state: link
follow: false
force: true
- name: Generate additional templates.
ansible.builtin.template:
src: "{{ template.src }}"
dest: "{{ deploy_path }}/{{ template.dest }}"
with_items: "{{ live_symlink.templates }}"
loop_control:
loop_var: template
when:
- live_symlink.templates | length > 0
- deploy_operation == 'deploy'
- name: Handle additional symlinks.
when:
- live_symlink.symlinks | length > 0
- deploy_operation == 'deploy'
block:
- name: Ensure additional symlink sources exist.
ansible.builtin.file:
path: "{{ link.src }}"
state: directory
mode: '0755'
with_items: "{{ live_symlink.symlinks }}"
loop_control:
loop_var: link
- name: Create additional symlinks.
ansible.builtin.file:
src: "{{ link.src }}"
dest: "{{ deploy_path }}/{{ link.dest }}"
state: link
follow: false
force: "{{ link.force | default(true) }}"
with_items: "{{ live_symlink.symlinks }}"
loop_control:
loop_var: link