-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.yml
174 lines (121 loc) · 6.26 KB
/
main.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Default variables for the playbook, override them in your playbook or inventory
# General Settings
###############################################
# Name of the deployed application
#
# This will be included in directory names, so don't use special chars and stay short
deploy_app_name: "app"
# Under which user the application should be started
deploy_app_user: "{{ deploy_app_name | lower }}"
# Under which group the application should be started
deploy_app_group: "{{ deploy_app_name | lower }}"
# Remove and re-add application directory during deployment
deploy_setting_clear_instance_app_dir: True
# Extract contents from subdir of the artifact instead of root-level
#
# Some artifact contain exactly one subdirectory, where the application is stored. Most asset archives (e.g. in Java),
# contain exactly one directory (which ist often named after the asset itself) where the application is located.
# This is a kinda special switch which enables extracting the contents of this subdir instead of the archive root.
deploy_setting_artifact_contains_subdir: False
# Name of the subdirectory in the asset which contains the application
#
# Defaults to the asset extraction directory name. See description of deploy_setting_artifact_contains_subdir.
deploy_setting_artifact_contains_subdir_name: "{{ deploy_artifact_dirname }}"
# If false, downloads will be removed after successful installation
#
# Keep this vfalue true, if you deploy different instances of the same artifact, so it has only to be downloaded once
deploy_setting_keep_downloads: False
# Instance
###############################################
# The number of the instance to deploy. This can be used to deploy multiple instances on the same server.
#
# Almost every config, like the application_dir contain this number.
deploy_instance_nr: 1
# The URL, where the artifact (zip, tar.gz) should be downloaded
deploy_artifact_url: "INVALID_PLEASE_SET_deploy_artifact_url_VARIABLE"
# Filename of the downloaded artifact
#
# Defaults to the basename of the download url
deploy_artifact_filename: "{{ deploy_artifact_url | basename }}"
# Directory name for extraction target
#
# Default is the filename of the artifact without extension
deploy_artifact_dirname: "{{ (deploy_artifact_filename | splitext)[0] }}"
# Directories
###############################################
# Base directory where all application instances are deployed to (must be an absoslute path)
#
# Ensure that this directory exists and the ansible use has write access to it
deploy_dir_base: "/opt/{{ deploy_app_name }}"
# Base directory for all application instances
deploy_dir_instances: "{{ deploy_dir_base }}/instances"
# Directory where the application instance is being deployed
deploy_dir_instance: "{{ deploy_dir_instances }}/{{ deploy_instance_nr }}"
# Base directory for app instances
deploy_dir_app: "{{ deploy_dir_instance }}/app"
# Base directory for logs
#
# By default, we stay sandboxed in 'deploy_dir_base', but feel free to change this to e.g. /var/log/myapp if you have write access to it.
deploy_dir_logs: "{{ deploy_dir_instance }}/logs"
# Base directory for configuration files
#
# By default, we stay sandboxed in 'deploy_dir_base', but feel free to change this to e.g. /etc/myapp if you have write access to it.
deploy_dir_config: "{{ deploy_dir_instance }}/conf"
# Downloads
###############################################
# Directory to store downloaded artifacts (this can be temporary)
deploy_download_dir: "{{ deploy_dir_base }}/downloads"
# Filename of the downloaded file
deploy_download_file: "{{ deploy_download_dir }}/{{ deploy_artifact_filename }}"
# Directory where downloaded artifact is being extracted
deploy_download_extract_dir: "{{ deploy_download_dir }}/{{ deploy_artifact_dirname }}"
# Logs
###############################################
deploy_log_stdout: True
deploy_log_stdout_path: "{{ deploy_dir_logs }}/stdout.log"
deploy_log_stderr: True
deploy_log_stderr_path: "{{ deploy_dir_logs }}/stderr.log"
# Service
###############################################
# If true, use deploy_service_prestart_script to run every time before the service is (re-)started
deploy_service_has_prestart_script: False
# If true, use deploy_service_poststart_script to run every time after the service is (re-)started
deploy_service_has_poststart_script: False
# Shell script to run if deploy_service_has_prestart_script is true
deploy_service_prestart_script: ""
# Shell script to run if deploy_service_has_poststart_script is true
deploy_service_poststart_script: ""
# The shell command used by the service to start your application
deploy_service_start_command: "bin/{{ deploy_app_name }}"
# PID file location for service installation
deploy_service_pidfile: "/var/run/{{ deploy_service_name }}.pid"
# If true, use deploy_service_prestop_script to run every time before the service is stopped
deploy_service_has_prestop_script: False
# If true, use deploy_service_poststop_script to run every time after the service is stopped
deploy_service_has_poststop_script: False
# Shell script to run if deploy_service_has_prestop_script is true
deploy_service_prestop_script: ""
# Shell script to run if deploy_service_has_poststop_script is true
deploy_service_poststop_script: ""
# If true, service will start at boot time
deploy_start_at_boot_time: False
# Which service wrapper / system loader you want to use
#
# This can be default, upstart, systemd or none
#
# If you keep the "default" value, the default systemloader of the used target OS will be used. This will be:
# upstart for: Ubuntu <=14.4, RHEL
# systemd for: Ubuntu >=16.4
deploy_service_type: default
deploy_service_name: "{{ deploy_app_name | lower }}-{{ deploy_instance_nr }}"
deploy_service_description: "Service definition for {{ deploy_app_name }}"
deploy_service_upstart_template: "service/upstart.conf.j2"
deploy_service_upstart_location: "/etc/init/{{ deploy_app_name | lower }}-{{ deploy_instance_nr }}.conf"
deploy_service_systemd_template: "service/systemd.service.j2"
deploy_service_systemd_location: "/etc/systemd/system/{{ deploy_app_name | lower }}-{{ deploy_instance_nr }}.service"
# Additional files
###############################################
# Additional template files to deploy. See readme for usage instructions
deploy_additional_templates: []
deploy_additional_copy: []
create_additional_dir: []