-
Notifications
You must be signed in to change notification settings - Fork 12
/
install.yml
135 lines (117 loc) · 4.67 KB
/
install.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
---
- name: Deploy miarka software
hosts: deploy
connection: local
# These three variables needs to be overriden when calling ansible-playbook.
#
# Call with e.g. "ansible-playbook install.yml -e deployment_environment=staging -e deployment_version=foo".
# If devel then the version will always be set to USERNAME_BRANCHNAME.
# If staging or production then the playbook will halt if the folder version already exists.
# I.e. the user will then manually have to remove the directory, OR add "-e deployment_override=true"
# to deploy into an already existing folder.
#
# /vulpes/ngi/production/<latest|current> will link to /vulpes/ngi/production/<github release>
# /vulpes/ngi/staging/ will contain a folder wild-wild-west which will be world writeable ON THE RECIEVING end. I.e. the
# sync script will change the permissions? This is to make sure that not everyone that is able to login to miarka3 can
# upload data into the cluster.
pre_tasks:
- fail:
msg: "You must specify '-e site=<upps | sthlm>'"
when: site is not defined or site is not in [ "upps", "sthlm" ]
- include: tasks/set-paths.yml
tags: always
- include_vars:
dir: env_vars
files_matching: site_(all|{{ site }})_env_(all|{{ deployment_environment }}).yml$
tags: always
- include_vars:
dir: env_secrets
files_matching: site_(all|{{ site }})_env_(all|{{ deployment_environment }}).yml$
tags: always
- name: create {{ proj_root }} folder and configure setgid
file:
path: "{{ proj_root }}"
group: "{{ ngi_group }}"
state: directory
recurse: no
mode: g+rwXs,o-rwx
when: deployment_environment in ["staging", "devel"]
tags: always
- name: create folder and configure setgid
file:
path: "{{ item }}"
group: "{{ ngi_sw_group }}"
state: directory
recurse: no
mode: g+rwXs,o=rX
tags: always
with_items:
- "{{ root_path }}"
- "{{ ngi_containers }}"
- "{{ igenomes_dir }}"
- name: initiate list of static folders that must be created on the target, after deployment
set_fact:
static_folders:
- "{{ proj_root }}/{{ uppmax_project }}"
- "{{ ngi_pipeline_path }}"
- "{{ ngi_pipeline_nobackup }}"
- "{{ ngi_pipeline_workdir }}"
- "{{ ngi_log_path }}"
- "{{ static_ngi_pipeline_path }}"
- "{{ static_ngi_pipeline_nobackup }}"
- "{{ static_ngi_log_path }}"
- "{{ ngi_softlinks }}"
tags: always
- name: initiate list of static commands that must be run on the target, after deployment
set_fact:
static_commands: []
tags: always
environment:
"{{ tools_path }}"
roles:
- { role: setup_base_config, tags: setup_base_config }
- { role: ngi_pipeline, tags: ngi_pipeline }
- { role: func_accounts, tags: func_accounts }
- { role: nextflow, tags: nextflow }
- { role: tarzan, tags: tarzan }
- { role: taca, tags: taca }
- { role: ngi_reports, tags: ngi_reports }
- { role: multiqc, tags: multiqc }
- { role: arteria-checksum-ws, tags: arteria-checksum }
- { role: arteria-checkqc-ws, tags: arteria-checkqc }
- { role: arteria-delivery-ws, tags: arteria-delivery }
- { role: arteria-sequencing-report-ws, tags: arteria-sequencing-report }
- { role: snpseq-metadata-service, tags: snpseq-metadata-service }
- { role: standalone_scripts, tags: standalone_scripts }
- { role: misc-tools, tags: misc-tools }
- { role: archive-upload-ws, tags: archive-upload }
- { role: archive-verify-ws, tags: archive-verify }
- { role: nf-core, tags: nf-core }
- { role: kraken2, tags: kraken2 }
tasks:
- name: Add miarka_provision version to deployed tools files
lineinfile:
dest: "{{ deployed_tool_versions }}"
line: "-- Deployed at {{ ansible_date_time.iso8601 }}, miarka_provision ({{ (branch_name, branch_tag, branch_hash) | join('.') }}), by {{ deploy_user }} --"
tags: always
- name: create script for creating static folders
template:
src: create_static_contents.sh.j2
dest: "{{ ngi_resources }}/create_static_contents_{{ site }}.sh"
mode: +x
tags: always
- name: set correct file permission for everything in the deployment
file:
path: "{{ item }}"
group: "{{ ngi_sw_group }}"
state: directory
recurse: yes
mode: g+rwX,o=rX
tags: always
with_items:
- "{{ root_path }}"
- "{{ ngi_containers }}"
- "{{ igenomes_dir }}"
post_tasks:
- debug:
msg: Finished deploying to {{ root_path }}