2020-12-06 19:37:02 +01:00
|
|
|
- name: Install NodeJS
|
|
|
|
import_role:
|
|
|
|
name: geerlingguy.nodejs
|
|
|
|
tags: nodejs
|
|
|
|
|
2020-12-06 14:10:29 +01:00
|
|
|
- name: Install git package
|
|
|
|
package:
|
|
|
|
name: git
|
|
|
|
state: present
|
|
|
|
tags: mumble_web_install
|
|
|
|
|
2020-05-21 22:15:33 +02:00
|
|
|
- name: Install websockify
|
2020-12-06 14:10:29 +01:00
|
|
|
package:
|
2020-05-21 22:15:33 +02:00
|
|
|
name: websockify
|
|
|
|
state: present
|
|
|
|
notify: reload mumble-web
|
|
|
|
tags: mumble_web_install
|
|
|
|
|
|
|
|
- name: Create mumble-web system user
|
|
|
|
user:
|
|
|
|
name: "{{ mumble_web_owner }}"
|
|
|
|
home: "{{ mumble_web_www_dir }}"
|
|
|
|
groups:
|
|
|
|
- www-data
|
|
|
|
shell: /sbin/nologin
|
|
|
|
password: '*'
|
|
|
|
state: present
|
|
|
|
system: yes
|
|
|
|
append: yes
|
|
|
|
create_home: no
|
|
|
|
|
|
|
|
- name: Change mumble-web home directory's permissions
|
|
|
|
file:
|
|
|
|
path: "{{ mumble_web_www_dir }}"
|
|
|
|
owner: "{{ mumble_web_owner }}"
|
|
|
|
group: "{{ mumble_web_group }}"
|
|
|
|
mode: "755"
|
|
|
|
state: directory
|
|
|
|
tags: mumble_web_install
|
|
|
|
|
|
|
|
- name: Clone mumble-web git repository
|
|
|
|
git:
|
|
|
|
repo: https://github.com/Johni0702/mumble-web.git
|
|
|
|
dest: "{{ mumble_web_www_dir }}"
|
|
|
|
version: "{{ mumble_web_version }}"
|
|
|
|
register: mumble_web_cloned
|
|
|
|
become_user: "{{ mumble_web_owner }}"
|
|
|
|
tags: mumble_web_install
|
|
|
|
|
2020-12-06 14:10:29 +01:00
|
|
|
- name: Check if mumble-web dist directory exists
|
|
|
|
stat:
|
|
|
|
path: "{{ mumble_web_www_dir }}/dist"
|
|
|
|
register: _mumble_web_dist
|
|
|
|
|
2020-05-21 22:15:33 +02:00
|
|
|
- name: Build mumble-web from sources
|
|
|
|
command: npm clean-install
|
|
|
|
args:
|
|
|
|
chdir: "{{ mumble_web_www_dir }}"
|
|
|
|
register: _mumble_web_installed
|
|
|
|
become_user: "{{ mumble_web_owner }}"
|
2020-12-06 14:10:29 +01:00
|
|
|
when: mumble_web_cloned is changed or not _mumble_web_dist.stat.exists
|
2020-05-21 22:15:33 +02:00
|
|
|
tags: [mumble_web_install,mumble_web_build]
|
|
|
|
|
|
|
|
- name: Copy mumble-web config file
|
|
|
|
template:
|
|
|
|
src: mumble-web.js.j2
|
|
|
|
dest: "{{ mumble_web_www_dir }}/dist/config.local.js"
|
|
|
|
owner: "{{ mumble_web_owner }}"
|
|
|
|
group: "{{ mumble_web_group }}"
|
|
|
|
mode: "644"
|
|
|
|
tags: [mumble_web_install,mumble_web_config]
|
|
|
|
|
|
|
|
- name: Copy mumble-web systemd service
|
|
|
|
template:
|
|
|
|
src: mumble-web.service.j2
|
|
|
|
dest: /etc/systemd/system/mumble-web.service
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "644"
|
|
|
|
notify:
|
|
|
|
- reload systemd
|
|
|
|
- reload mumble-web
|
|
|
|
tags: [mumble_web_install,mumble_web_config]
|
|
|
|
|
|
|
|
- name: Start mumble-web service
|
|
|
|
service:
|
|
|
|
name: mumble-web
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
register: mumble_web_started
|
|
|
|
tags: mumble_web_run
|
|
|
|
|
|
|
|
- name: Trigger mumble-web handlers
|
|
|
|
meta: flush_handlers
|