-
Notifications
You must be signed in to change notification settings - Fork 0
/
semaphore.yml
72 lines (67 loc) · 2.3 KB
/
semaphore.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
---
- name: Create application database
community.postgresql.postgresql_db:
name: "{{ semaphore_db_name }}"
encoding: UTF-8
template: template0
lc_collate: en_US.UTF-8
lc_ctype: en_US.UTF-8
login_user: "{{ postgres_db_user }}"
login_password: "{{ postgres_db_pass }}"
login_host: localhost
no_log: true
- name: Create database users
community.postgresql.postgresql_user:
name: "{{ semaphore_db_user }}"
password: "{{ semaphore_db_pass }}"
login_user: "{{ postgres_db_user }}"
login_password: "{{ postgres_db_pass }}"
login_host: localhost
no_log: true
- name: Update database owner
community.postgresql.postgresql_owner:
db: "{{ semaphore_db_name }}"
new_owner: "{{ semaphore_db_user }}"
obj_name: "{{ semaphore_db_name }}"
obj_type: database
login_user: "{{ postgres_db_user }}"
login_password: "{{ postgres_db_pass }}"
login_host: localhost
no_log: True
- name: Grant database privileges to application user
community.postgresql.postgresql_privs:
db: "{{ semaphore_db_name }}"
privs: ALL
type: database
role: "{{ semaphore_db_user }}"
obj: "{{ semaphore_db_name }}"
login_user: "{{ postgres_db_user }}"
login_password: "{{ postgres_db_pass }}"
login_host: localhost
no_log: True
- name: Create semaphore container
community.docker.docker_container:
name: "{{ semaphore['container_name'] }}"
image: "{{ semaphore['container_image'] }}"
hostname: "{{ semaphore['container_hostname'] }}"
restart_policy: unless-stopped
image_name_mismatch: recreate
recreate: true
env:
SEMAPHORE_DB_USER: "{{ semaphore_db_user }}"
SEMAPHORE_DB_PASS: "{{ semaphore_db_pass }}"
SEMAPHORE_DB_HOST: postgres
SEMAPHORE_DB_PORT: "5432"
SEMAPHORE_DB_DIALECT: postgres
SEMAPHORE_DB: "{{ semaphore_db_name }}"
SEMAPHORE_PLAYBOOK_PATH: "/tmp/semaphore/"
SEMAPHORE_ADMIN_PASSWORD: "{{ semaphore_admin_pass }}"
SEMAPHORE_ADMIN_NAME: "{{ semaphore_admin_name }}"
SEMAPHORE_ADMIN_EMAIL: "{{ semaphore_admin_email }}"
SEMAPHORE_ADMIN: "{{ semaphore_admin_user }}"
SEMAPHORE_ACCESS_KEY_ENCRYPTION: "{{ semaphore_access_key_encryption }}"
TZ: Europe/Bucharest
ports:
- "3002:3000"
networks:
- name: "{{ semaphore['network'] }}"