-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.yml
64 lines (55 loc) · 3.22 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
---
# whether to install mysql on the host and the root password to set
mysql_root_password: "root"
semaphore_mysql_install: true
# whether to create the mysql db and user
semaphore_mysql_create_db: true
# database options
semaphore_mysql_host: "127.0.0.1"
semaphore_mysql_port: "3306"
semaphore_mysql_db: "semaphore"
semaphore_mysql_user: "semaphore"
semaphore_mysql_password: "semaphore"
semaphore_mysql_allowed_host: "localhost"
# the default user that should be created
semaphore_default_user: "admin"
semaphore_default_user_name: "{{ semaphore_default_user }}"
semaphore_default_user_password: "admin"
semaphore_default_user_mail: "[email protected]"
# sempahore binary source
semaphore_version: "2.8.77"
semaphore_download_url: "https://github.com/ansible-semaphore/semaphore/releases/download/v{{ semaphore_version }}/semaphore_{{ semaphore_version }}_linux_amd64.tar.gz"
semaphore_download_checksum: "sha256:a67a6ef4a49bf7613e87628bf35db7d239050a99d7123a278c6cc85b2bff7997"
# binary paths and service identifiers
semaphore_user: "semaphore"
semaphore_path: "/opt/semaphore"
semaphore_config_path: "/etc/semaphore/semaphore.json"
semaphore_tmp_path: "{{ semaphore_path }}/tmp"
semaphore_executable: "{{ semaphore_path }}/semaphore"
semaphore_command: "{{ semaphore_executable }} --config {{ semaphore_config_path | quote }}"
semaphore_version_dir: "{{ semaphore_executable }}_{{ semaphore_version }}"
semaphore_identifier: "{{ semaphore_user }}"
semaphore_systemd_unit_path: "/etc/systemd/system/{{ semaphore_identifier }}.service"
# semaphore config options
semaphore_port: 3000
semaphore_addn_config: {}
# mysql command lines to create default user
semaphore_mysql_client_package: "{% if ansible_distribution == 'CentOS' or ansible_distribution == 'Redhat' %}mariadb{% elif ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' %}mysql-client{% endif %}"
semaphore_mysql_server_package: "{% if ansible_distribution == 'CentOS' or ansible_distribution == 'Redhat' %}mariadb-server{% elif ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' %}mysql-server{% endif %}"
semaphore_mysql_service_name: "{% if ansible_distribution == 'CentOS' or ansible_distribution == 'Redhat' %}mariadb{% elif ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' %}mysql{% endif %}"
semaphore_python_mysql_module: "{% if ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat' %}python3-PyMySQL{% elif ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' %}python3-mysqldb{% endif %}"
# generated secrets in case they dont exist yet
semaphore_config_previous: {}
semaphore_config_base_generated_secrets:
cookie_hash: "{{ lookup('password', '/dev/null length=32') | b64encode }}"
cookie_encryption: "{{ lookup('password', '/dev/null length=32') | b64encode }}"
access_key_encryption: "{{ lookup('password', '/dev/null length=32') | b64encode }}"
# temporary object to merge the previous given options with the generated ones
semaphore_config_object:
mysql:
host: "{{ semaphore_mysql_host }}:{{ semaphore_mysql_port }}"
user: "{{ semaphore_mysql_user }}"
pass: "{{ semaphore_mysql_password }}"
name: "{{ semaphore_mysql_db }}"
port: ":{{ semaphore_port }}"
tmp_path: "{{ semaphore_tmp_path }}"