ansible-role-mumble/tasks/murmur.yml

116 lines
2.6 KiB
YAML
Raw Normal View History

2020-06-14 14:01:16 +02:00
- name: Install mumble-server package
package:
name: mumble-server
2020-06-14 14:01:16 +02:00
state: present
register: murmur_installed
2021-03-28 10:48:06 +02:00
tags: murmur_install
2020-06-14 14:01:16 +02:00
2020-06-14 19:56:23 +02:00
- name: Install ICE dependencies for Python
package:
2021-03-28 10:48:06 +02:00
name:
- python3-zeroc-ice
- python3-yaml
- zeroc-ice-compilers
state: present
2021-03-28 10:48:06 +02:00
tags: murmur_install
2020-06-14 19:56:23 +02:00
- name: Append ssl-cert group to {{ murmur_owner }} user
user:
name: "{{ murmur_owner }}"
state: present
groups:
- "{{ acme_ssl_group }}"
append: yes
system: yes
notify: restart murmur
2021-03-28 10:48:06 +02:00
tags: murmur_install
2020-06-14 14:01:16 +02:00
- name: Copy Murmur config file
template:
2021-03-26 23:48:36 +01:00
src: murmur/mumble-server.ini.j2
2020-06-14 14:01:16 +02:00
dest: /etc/mumble-server.ini
owner: root
group: "{{ murmur_group }}"
mode: "640"
notify: restart murmur
2021-03-28 10:48:06 +02:00
tags:
- murmur_install
- murmur_config
2020-06-14 14:01:16 +02:00
- name: Start mumble-server service
service:
name: mumble-server
enabled: yes
state: started
2021-03-28 10:48:06 +02:00
tags: murmur_install
2020-06-14 14:01:16 +02:00
2020-06-14 16:20:28 +02:00
- name: Write superuser password to a file
copy:
content: "{{ murmur_superuser_password }}"
dest: /etc/mumble-server.secret
owner: root
group: root
mode: "600"
when: murmur_superuser_password is defined
notify: change murmur superuser password
2021-03-28 10:48:06 +02:00
tags:
- murmur_install
- murmur_config
2020-06-14 19:56:23 +02:00
- name: Trigger Murmur handlers
meta: flush_handlers
2020-06-14 19:56:23 +02:00
- name: Create mumble-ice directory
file:
path: "{{ murmur_ice_script_dir }}"
2020-06-14 19:56:23 +02:00
state: directory
owner: root
group: root
2020-06-14 19:58:32 +02:00
mode: "755"
2021-03-28 10:48:06 +02:00
tags:
- murmur_install
- murmur_ice
2020-06-14 19:56:23 +02:00
- name: Copy mice Python script
copy:
src: murmur/scripts/mice.py
dest: "{{ murmur_ice_script_dir }}/mice.py"
2020-06-14 19:56:23 +02:00
owner: root
group: root
2020-06-14 19:58:32 +02:00
mode: "755"
notify: create murmur channels
register: _murmur_mice_script_copied
2021-03-28 10:48:06 +02:00
tags:
- murmur_install
- murmur_ice
2020-06-14 19:56:23 +02:00
- name: Compile Murmur.ice slice file
command: |-
slice2py --checksum \
-I/usr/local/share/Ice \
-I/usr/share/Ice/slice \
-I/usr/share/ice/slice \
/usr/share/slice/Murmur.ice
args:
chdir: "{{ murmur_ice_script_dir }}"
when: _murmur_mice_script_copied is changed
2021-03-28 10:48:06 +02:00
tags:
- murmur_install
- murmur_ice
- name: Copy mice config
copy:
2020-12-26 11:04:38 +01:00
# See https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#formatting-data-yaml-and-json
content: "{{ murmur_channels | to_nice_yaml(indent=2, width=10000) }}"
dest: "{{ murmur_ice_config_path }}"
owner: root
group: root
mode: "644"
notify: create murmur channels
2021-03-28 10:48:06 +02:00
tags:
- murmur_install
- murmur_config
- murmur_ice
- name: Trigger Mice handlers
meta: flush_handlers