diff options
Diffstat (limited to 'roles/umurmur')
| -rw-r--r-- | roles/umurmur/handlers/main.yml | 5 | ||||
| -rw-r--r-- | roles/umurmur/tasks/main.yml | 36 | ||||
| -rw-r--r-- | roles/umurmur/templates/umurmurd.conf.j2 | 73 |
3 files changed, 114 insertions, 0 deletions
diff --git a/roles/umurmur/handlers/main.yml b/roles/umurmur/handlers/main.yml new file mode 100644 index 0000000..a21be7f --- /dev/null +++ b/roles/umurmur/handlers/main.yml | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | --- | ||
| 2 | - name: Restart uMurmur | ||
| 3 | ansible.builtin.service: | ||
| 4 | name: umurmur | ||
| 5 | state: restarted | ||
diff --git a/roles/umurmur/tasks/main.yml b/roles/umurmur/tasks/main.yml new file mode 100644 index 0000000..4f08c0c --- /dev/null +++ b/roles/umurmur/tasks/main.yml | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | --- | ||
| 2 | - block: | ||
| 3 | - name: Install uMurmur package | ||
| 4 | community.general.apk: | ||
| 5 | name: | ||
| 6 | - umurmur | ||
| 7 | - umurmur-openrc | ||
| 8 | state: present | ||
| 9 | |||
| 10 | - name: Create uMurmur config directory | ||
| 11 | ansible.builtin.file: | ||
| 12 | path: /etc/umurmur | ||
| 13 | state: directory | ||
| 14 | owner: root | ||
| 15 | group: root | ||
| 16 | mode: '0755' | ||
| 17 | |||
| 18 | - name: Deploy uMurmur configuration template | ||
| 19 | ansible.builtin.template: | ||
| 20 | src: umurmurd.conf.j2 | ||
| 21 | dest: /etc/umurmur/umurmurd.conf | ||
| 22 | owner: root | ||
| 23 | group: root | ||
| 24 | mode: '0440' | ||
| 25 | validate: /usr/bin/umurmurd -t -c %s | ||
| 26 | notify: Restart uMurmur | ||
| 27 | |||
| 28 | - name: Enable and start uMurmur service | ||
| 29 | ansible.builtin.service: | ||
| 30 | name: umurmur | ||
| 31 | enabled: true | ||
| 32 | state: started | ||
| 33 | runlevel: default | ||
| 34 | |||
| 35 | tags: | ||
| 36 | - umurmur | ||
diff --git a/roles/umurmur/templates/umurmurd.conf.j2 b/roles/umurmur/templates/umurmurd.conf.j2 new file mode 100644 index 0000000..9e8f8c6 --- /dev/null +++ b/roles/umurmur/templates/umurmurd.conf.j2 | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | # {{ ansible_managed }} | ||
| 2 | {# | ||
| 3 | This configuration is based on the official example | ||
| 4 | configuration. More information can be found at | ||
| 5 | http://code.google.com/p/umurmur/wiki/Configuring02x | ||
| 6 | #} | ||
| 7 | |||
| 8 | max_bandwidth = {{ max_bandwidth | default(48000) | int }}; | ||
| 9 | welcometext = "{{ welcometext | default('Welcome to uMurmur!') }}"; | ||
| 10 | certificate = "{{ certificate | default('') }}"; | ||
| 11 | private_key = "{{ private_key | default('') }}"; | ||
| 12 | password = "{{ password | default('') }}"; | ||
| 13 | admin_password = "{{ admin_password | default('') }}"; | ||
| 14 | max_users = {{ max_users | default(10) | int }}; | ||
| 15 | |||
| 16 | bindport = {{ bindport | default(64738) | int }}; | ||
| 17 | bindaddr = "{{ bindaddr | default('0.0.0.0') }}"; | ||
| 18 | |||
| 19 | {# | ||
| 20 | Specify this for privilege dropping. If username is specified but | ||
| 21 | not the groupname, the user's login group is used. | ||
| 22 | #} | ||
| 23 | username = "{{ username | default('umurmur') }}"; | ||
| 24 | groupname = "{{ groupname | default('umurmur') }}"; | ||
| 25 | |||
| 26 | logfile = "{{ logfile | default('/var/log/umurmurd.log') }}"; | ||
| 27 | |||
| 28 | enable_ban = {{ enable_ban | default(false) | lower }}; | ||
| 29 | sync_banfile = {{ sync_banfile | default(false) | lower }}; | ||
| 30 | ban_length = {{ ban_length | default(0) | int }}; | ||
| 31 | banfile = "{{ banfile | default('') }}"; | ||
| 32 | |||
| 33 | channels = ( | ||
| 34 | {% for channel in channels %} | ||
| 35 | { | ||
| 36 | name = "{{ channel.name }}"; | ||
| 37 | parent = "{{ channel.parent | default('') }}"; | ||
| 38 | {% if channel.noenter is defined %} | ||
| 39 | noenter = {{ channel.noenter | lower }}; | ||
| 40 | {% endif %} | ||
| 41 | {% if channel.password is defined and channel.password %} | ||
| 42 | password = "{{ channel.password }}"; | ||
| 43 | {% endif %} | ||
| 44 | {% if channel.description is defined and channel.description %} | ||
| 45 | description = "{{ channel.description }}"; | ||
| 46 | {% endif %} | ||
| 47 | {% if channel.silent is defined %} | ||
| 48 | silent = {{ channel.silent | lower }}; | ||
| 49 | {% endif %} | ||
| 50 | {% if channel.position is defined %} | ||
| 51 | position = {{ channel.position | int }}; | ||
| 52 | {% endif %} | ||
| 53 | }{%- if not loop.last -%},{%- endif %} | ||
| 54 | |||
| 55 | {% endfor %} | ||
| 56 | ); | ||
| 57 | |||
| 58 | {% if channel_links is defined and channel_links %} | ||
| 59 | channel_links = ( | ||
| 60 | {% for link in channel_links %} | ||
| 61 | { | ||
| 62 | source = "{{ link.source }}"; | ||
| 63 | destination = "{{ link.destination }}"; | ||
| 64 | }{%- if not loop.last -%}, | ||
| 65 | {%- endif %} | ||
| 66 | |||
| 67 | {% endfor %} | ||
| 68 | ); | ||
| 69 | {% endif %} | ||
| 70 | |||
| 71 | {% if default_channel is defined and default_channel %} | ||
| 72 | default_channel = "{{ default_channel }}"; | ||
| 73 | {% endif %} | ||
