File tree Expand file tree Collapse file tree 14 files changed +50
-37
lines changed Expand file tree Collapse file tree 14 files changed +50
-37
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,7 @@ libretime_log_dir: /var/log/libretime
19
19
libretime_config_dir : /etc/libretime
20
20
libretime_config_filepath : " {{ libretime_config_dir }}/config.yml"
21
21
libretime_storage_dir : /srv/libretime
22
-
23
- # Experimental !
24
- # libretime_venv:
22
+ libretime_venv_dir : /opt/libretime
25
23
26
24
# > Analyzer
27
25
# #######################################################################################
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ provisioner:
32
32
instance2 :
33
33
libretime_public_url : http://localhost:{{ libretime_listen_port }}/
34
34
libretime_listen_port : 9002
35
- libretime_venv : /opt/libretime
36
35
37
36
verifier :
38
37
name : testinfra
Original file line number Diff line number Diff line change 10
10
libretime-analyzer[{{ libretime_analyzer_pip_extras | join(',') }}]
11
11
@ file://{{ libretime_checkout_dest }}/analyzer
12
12
state : latest # noqa package-latest
13
- virtualenv : " {{ libretime_venv | default(omit) }}"
13
+ virtualenv : " {{ libretime_venv_dir }}"
14
14
notify : Restart libretime
15
15
when : libretime_checkout is changed
16
16
17
+ - name : Create analyzer entrypoint symlinks
18
+ ansible.builtin.file :
19
+ src : " {{ libretime_venv_dir }}/bin/libretime-analyzer"
20
+ dest : /usr/local/bin/libretime-analyzer
21
+ owner : root
22
+ group : root
23
+ state : link
24
+ force : true
25
+
17
26
- name : Create analyzer home directory
18
27
ansible.builtin.file :
19
28
path : " {{ libretime_home }}/analyzer"
Original file line number Diff line number Diff line change 10
10
libretime-api[{{ (['prod'] + libretime_api_pip_extras) | join(',') }}]
11
11
@ file://{{ libretime_checkout_dest }}/api
12
12
state : latest # noqa package-latest
13
- virtualenv : " {{ libretime_venv | default(omit) }}"
13
+ virtualenv : " {{ libretime_venv_dir }}"
14
14
notify : Restart libretime
15
15
when : libretime_checkout is changed
16
16
17
+ - name : Create api entrypoint symlinks
18
+ ansible.builtin.file :
19
+ src : " {{ libretime_venv_dir }}/bin/libretime-api"
20
+ dest : /usr/local/bin/libretime-api
21
+ owner : root
22
+ group : root
23
+ state : link
24
+ force : true
25
+
17
26
- name : Setup api systemd socket
18
27
ansible.builtin.import_tasks : _systemd.yml
19
28
vars :
Original file line number Diff line number Diff line change 5
5
libretime-api-client
6
6
@ file://{{ libretime_checkout_dest }}/api-client
7
7
state : latest # noqa package-latest
8
- virtualenv : " {{ libretime_venv | default(omit) }}"
8
+ virtualenv : " {{ libretime_venv_dir }}"
9
9
notify : Restart libretime
10
10
when : libretime_checkout is changed
Original file line number Diff line number Diff line change 107
107
ansible.builtin.pip :
108
108
name : [pip, setuptools, wheel]
109
109
state : latest # noqa package-latest
110
- virtualenv : " {{ libretime_venv | default(omit) }}"
110
+ virtualenv : " {{ libretime_venv_dir }}"
111
111
virtualenv_command : python3 -m venv
112
112
virtualenv_site_packages : true
113
113
155
155
- name : Run database migration
156
156
become : true
157
157
become_user : " {{ libretime_user }}"
158
- ansible.builtin.command : " {{ libretime_venv | default('/usr/local') }}/bin/libretime-api migrate"
158
+ ansible.builtin.command : " {{ libretime_venv_dir }}/bin/libretime-api migrate"
159
159
register : migration
160
160
changed_when : >
161
161
"No migrations to apply." not in migration.stdout
Original file line number Diff line number Diff line change 10
10
libretime-playout[{{ libretime_playout_pip_extras | join(',') }}]
11
11
@ file://{{ libretime_checkout_dest }}/playout
12
12
state : latest # noqa package-latest
13
- virtualenv : " {{ libretime_venv | default(omit) }}"
13
+ virtualenv : " {{ libretime_venv_dir }}"
14
14
notify : Restart libretime
15
15
when : libretime_checkout is changed
16
16
17
+ - name : Create playout entrypoint symlinks
18
+ ansible.builtin.file :
19
+ src : " {{ libretime_venv_dir }}/bin/{{ item }}"
20
+ dest : /usr/local/bin/{{ item }}
21
+ owner : root
22
+ group : root
23
+ state : link
24
+ force : true
25
+ with_items :
26
+ - libretime-liquidsoap
27
+ - libretime-playout
28
+ - libretime-playout-notify
29
+
17
30
- name : Create playout home directory
18
31
ansible.builtin.file :
19
32
path : " {{ libretime_home }}/playout"
Original file line number Diff line number Diff line change 5
5
libretime-shared
6
6
@ file://{{ libretime_checkout_dest }}/shared
7
7
state : latest # noqa package-latest
8
- virtualenv : " {{ libretime_venv | default(omit) }}"
8
+ virtualenv : " {{ libretime_venv_dir }}"
9
9
notify : Restart libretime
10
10
when : libretime_checkout is changed
Original file line number Diff line number Diff line change 5
5
libretime-worker[{{ libretime_worker_pip_extras | join(',') }}]
6
6
@ file://{{ libretime_checkout_dest }}/worker
7
7
state : latest # noqa package-latest
8
- virtualenv : " {{ libretime_venv | default(omit) }}"
8
+ virtualenv : " {{ libretime_venv_dir }}"
9
9
notify : Restart libretime
10
10
when : libretime_checkout is changed
11
11
Original file line number Diff line number Diff line change @@ -17,15 +17,12 @@ ProtectKernelTunables=true
17
17
ProtectProc=invisible
18
18
ProtectSystem=full
19
19
20
- {% if libretime_venv is defined %}
21
- Environment=PATH={{ libretime_venv }}/bin:/usr/local/bin:/usr/bin:/bin
22
- {% endif %}
23
-
20
+ Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
24
21
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
25
22
Environment=LIBRETIME_LOG_FILEPATH={{ libretime_log_dir }}/analyzer.log
26
23
WorkingDirectory={{ libretime_home }}/analyzer
27
24
28
- ExecStart={{ libretime_venv | default('/usr/local') }}/bin/libretime-analyzer
25
+ ExecStart={{ libretime_venv_dir }}/bin/libretime-analyzer
29
26
Restart=always
30
27
31
28
User={{ libretime_user }}
Original file line number Diff line number Diff line change @@ -18,16 +18,13 @@ ProtectKernelTunables=true
18
18
ProtectProc=invisible
19
19
ProtectSystem=full
20
20
21
- {% if libretime_venv is defined %}
22
- Environment=PATH={{ libretime_venv }}/bin:/usr/local/bin:/usr/bin:/bin
23
- {% endif %}
24
-
21
+ Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
25
22
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
26
23
Environment=LIBRETIME_LOG_FILEPATH={{ libretime_log_dir }}/api.log
27
24
28
25
Type=notify
29
26
KillMode=mixed
30
- ExecStart={{ libretime_venv | default('/usr') }}/bin/python3 -m gunicorn \
27
+ ExecStart={{ libretime_venv_dir }}/bin/python3 -m gunicorn \
31
28
--workers 4 \
32
29
--worker-class uvicorn.workers.UvicornWorker \
33
30
--log-file - \
Original file line number Diff line number Diff line change @@ -17,15 +17,12 @@ ProtectKernelTunables=true
17
17
ProtectProc=invisible
18
18
ProtectSystem=full
19
19
20
- {% if libretime_venv is defined %}
21
- Environment=PATH={{ libretime_venv }}/bin:/usr/local/bin:/usr/bin:/bin
22
- {% endif %}
23
-
20
+ Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
24
21
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
25
22
Environment=LIBRETIME_LOG_FILEPATH={{ libretime_log_dir }}/liquidsoap.log
26
23
WorkingDirectory={{ libretime_home }}/playout
27
24
28
- ExecStart={{ libretime_venv | default('/usr/local') }}/bin/libretime-liquidsoap
25
+ ExecStart={{ libretime_venv_dir }}/bin/libretime-liquidsoap
29
26
Restart=always
30
27
31
28
User={{ libretime_user }}
Original file line number Diff line number Diff line change @@ -19,15 +19,12 @@ ProtectKernelTunables=true
19
19
ProtectProc=invisible
20
20
ProtectSystem=full
21
21
22
- {% if libretime_venv is defined %}
23
- Environment=PATH={{ libretime_venv }}/bin:/usr/local/bin:/usr/bin:/bin
24
- {% endif %}
25
-
22
+ Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
26
23
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
27
24
Environment=LIBRETIME_LOG_FILEPATH={{ libretime_log_dir }}/playout.log
28
25
WorkingDirectory={{ libretime_home }}/playout
29
26
30
- ExecStart={{ libretime_venv | default('/usr/local') }}/bin/libretime-playout
27
+ ExecStart={{ libretime_venv_dir }}/bin/libretime-playout
31
28
Restart=always
32
29
33
30
User={{ libretime_user }}
Original file line number Diff line number Diff line change @@ -17,15 +17,12 @@ ProtectKernelTunables=true
17
17
ProtectProc=invisible
18
18
ProtectSystem=full
19
19
20
- {% if libretime_venv is defined %}
21
- Environment=PATH={{ libretime_venv }}/bin:/usr/local/bin:/usr/bin:/bin
22
- {% endif %}
23
-
20
+ Environment=PATH={{ libretime_venv_dir }}/bin:/usr/local/bin:/usr/bin:/bin
24
21
Environment=LIBRETIME_CONFIG_FILEPATH={{ libretime_config_filepath }}
25
22
Environment=LIBRETIME_LOG_FILEPATH={{ libretime_log_dir }}/worker.log
26
23
WorkingDirectory={{ libretime_home }}/worker
27
24
28
- ExecStart=/usr/bin/sh -c '{{ libretime_venv | default('/usr/local') }}/bin/celery worker \
25
+ ExecStart=/usr/bin/sh -c '{{ libretime_venv_dir }}/bin/celery worker \
29
26
--app=libretime_worker.tasks:worker \
30
27
--config=libretime_worker.config \
31
28
--time-limit=1800 \
You can’t perform that action at this time.
0 commit comments