refactor(mumble): add molecule and readme; attempt permissions

Add the expected molecule files as well as the readme for the role.
Attempt to change permissions to the uid/gid used inside the Mumble
container for the data directory.

Refs: #620
This commit is contained in:
Justin D. Fetherolf 2022-12-09 17:47:32 -07:00
parent b0e69bd74b
commit aeaecbafe4
6 changed files with 74 additions and 2 deletions

View file

@ -0,0 +1,15 @@
# Mumble
Homepage: <https://www.mumble.info/>
Mumble is a free, open source, low latency, high quality voice chat application.
## Usage
Set `mumble_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The configuration here applies a server password, via `mumble_server_password`, to the Mumble instance, so that if you make this application available externally it won't be
accessible to everyone by default. That being said, it is **strongly** encouraged that
you change this value to something unique.
Clients can then connect to the service at `ansible_nas_host_or_ip:64738` using the
password that you've definitely changed.

View file

@ -0,0 +1,7 @@
---
provisioner:
inventory:
group_vars:
all:
mumble_enabled: true

View file

@ -0,0 +1,11 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
mumble_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
name: "{{ mumble_container_name }}"
register: result
- name: Check Mumble is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Mumble
docker_container:
name: "{{ mumble_container_name }}"
state: absent
register: result
- name: Check Mumble is stopped
assert:
that:
- not result.changed

View file

@ -7,11 +7,12 @@
state: directory state: directory
# The mumble image gets uid/gid at build time, and uses 1000 for both, by default. # The mumble image gets uid/gid at build time, and uses 1000 for both, by default.
# This ends up with permission denied on the data directory, unless we fully open the permissions. # This ends up with permission denied on the data directory, unless we fully open the permissions.
mode: "0777" owner: 1000
group: 1000
with_items: with_items:
- "{{ mumble_data_directory }}" - "{{ mumble_data_directory }}"
- name: Mumble Docker Container - name: Create Mumble Docker Container
docker_container: docker_container:
name: "{{ mumble_container_name }}" name: "{{ mumble_container_name }}"
image: mumblevoip/mumble-server:latest image: mumblevoip/mumble-server:latest