mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
commit
5a2f550e56
10 changed files with 72 additions and 149 deletions
|
@ -2,6 +2,8 @@
|
|||
Minetest README
|
||||
===============
|
||||
|
||||
Minetest is an open source clone of `Minecraft <https://en.wikipedia.org/wiki/Minecraft>`_, the creative/explorational building blocks game.
|
||||
|
||||
For the first release, the Minetest server can only be installed on a Raspberry Pi.
|
||||
|
||||
Please note that the initial configuration is for creative mode, and a number of mods are installed (see the list in `tasks/main.yml <tasks/main.yml>`_).
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
# minetest_install: False
|
||||
# minetest_enabled: False
|
||||
# minetest_port: 30000
|
||||
|
||||
# minetest_server_admin: Admin
|
||||
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
|
||||
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
|
||||
|
||||
minetest_runas_user: minetest
|
||||
minetest_runas_group: minetest
|
||||
|
||||
minetest_config_file: /etc/minetest/minetest.conf
|
||||
minetest_server_admin: Admin
|
||||
minetest_default_runas_user: Debian-minetest
|
||||
minetest_default_runas_group: games
|
||||
|
|
|
@ -1,38 +1,19 @@
|
|||
# Give message and end play for unsupported platforms
|
||||
# For now only support rpi
|
||||
|
||||
- name: No install except Raspberry Pi for now
|
||||
debug:
|
||||
msg: "No install except Raspberry Pi for now."
|
||||
when: not is_rpi
|
||||
|
||||
# CAUTION: this stanza causes iiab-install to exit on Ubuntu/Debian/etc -- without completing roles/network
|
||||
- name: Terminate play if not Raspberry Pi
|
||||
meta: end_play
|
||||
when: not is_rpi
|
||||
|
||||
- include_tasks: calc_vars.yml
|
||||
|
||||
- name: Ensure Linux group '{{ minetest_runas_group }}' exists
|
||||
group:
|
||||
name: "{{ minetest_runas_group }}"
|
||||
state: present
|
||||
when: minetest_runas_user != 'root'
|
||||
|
||||
- name: Ensure Linux user '{{ minetest_runas_user }}' exists
|
||||
user:
|
||||
name: "{{ minetest_runas_user }}"
|
||||
groups: "{{ minetest_runas_group }}"
|
||||
state: present
|
||||
createhome: no
|
||||
shell: /bin/false
|
||||
when: minetest_runas_user != 'root'
|
||||
|
||||
- name: Check for minetest world file ({{ minetest_world_dir }}/world.mt)
|
||||
stat:
|
||||
path: "{{ minetest_world_dir }}/world.mt"
|
||||
register: minetest_world
|
||||
|
||||
- name: Create /library/games
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
with_items:
|
||||
- /library/games
|
||||
when: minetest_install
|
||||
|
||||
# rpi only
|
||||
- include_tasks: rpi_minetest_install.yml
|
||||
when: minetest_install and not minetest_world.stat.exists and is_rpi
|
||||
|
@ -61,18 +42,18 @@
|
|||
when: minetest_install
|
||||
|
||||
# enable or disable
|
||||
- name: Enable & Restart 'minetest-serve' service
|
||||
- name: Enable & Restart 'minetest-server' service
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: minetest-serve
|
||||
name: minetest-server
|
||||
enabled: yes
|
||||
state: restarted
|
||||
when: minetest_install and minetest_enabled
|
||||
|
||||
- name: Disable 'minetest-serve' service
|
||||
- name: Disable 'minetest-server' service
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
name: minetest-serve
|
||||
name: minetest-server
|
||||
enabled: no
|
||||
state: stopped
|
||||
when: minetest_install and not minetest_enabled
|
||||
|
|
|
@ -1,82 +1,36 @@
|
|||
# For non-rpi installs
|
||||
# Still a work in progress
|
||||
|
||||
# COMPARE tasks/calc_vars.yml
|
||||
- name: Set some facts
|
||||
set_fact:
|
||||
minetest_server_bin: /usr/lib/minetest/minetestserver
|
||||
# minetest_world_dir: /var/games/minetest-server/.minetest/worlds/world/ should be in library
|
||||
minetest_mods_dir: /usr/share/games/minetest_game/mods/
|
||||
- name: Install Minetest package
|
||||
package:
|
||||
name: minetest-server
|
||||
state: present
|
||||
|
||||
# Taken care of near top of tasks/main.yml
|
||||
#
|
||||
#- name: Ensure Linux group '{{ minetest_runas_group }}' exists
|
||||
# group:
|
||||
# name: "{{ minetest_runas_group }}"
|
||||
# state: present
|
||||
# when: minetest_runas_user != 'root'
|
||||
#
|
||||
#- name: Ensure Linux user '{{ minetest_runas_user }}' exists
|
||||
# user:
|
||||
# name: "{{ minetest_runas_user }}"
|
||||
# groups: "{{ minetest_runas_group }}"
|
||||
# state: present
|
||||
# createhome: no
|
||||
# shell: /bin/false
|
||||
# when: minetest_runas_user != 'root'
|
||||
- name: Add some parameters to /etc/minetest/minetest.conf that was automatically created
|
||||
lineinfile:
|
||||
path: /etc/minetest/minetest.conf
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
with_items:
|
||||
- { regexp: '^server_name = ', line: 'server_name = Internet in a Box Minetest Server' }
|
||||
- { regexp: '^name = ', line: 'name = Admin' }
|
||||
- { regexp: '^creative_mode = ', line: 'creative_mode = true' }
|
||||
- { regexp: '^port = ', line: 'port = {{ minetest_port }}' }
|
||||
|
||||
# SEE "Check for minetest world file" in tasks/main.yml
|
||||
#
|
||||
#- name: Create dir minetest_world_dir ({{ minetest_world_dir }})
|
||||
# file:
|
||||
# state: directory
|
||||
# path: "{{ minetest_world_dir }}"
|
||||
# owner: "{{ minetest_runas_user }}"
|
||||
# group: "{{ minetest_runas_group }}"
|
||||
# mode: 0755
|
||||
|
||||
#- name: Warn if not Raspberry Pi
|
||||
# debug:
|
||||
# msg: "No install except Raspberry Pi for now."
|
||||
# when: not is_rpi
|
||||
|
||||
- name: Download Minetest if not package
|
||||
get_url:
|
||||
url: "{{ rpi_src_url }}"
|
||||
dest: "{{ downloads_dir }}/{{ rpi_src }}"
|
||||
timeout: "{{ download_timeout }}"
|
||||
#when: is_rpi
|
||||
|
||||
- name: Install Minetest if not package
|
||||
debug:
|
||||
msg: "placeholder."
|
||||
#when: is_rpi
|
||||
|
||||
- name: Create /etc/minetest
|
||||
- name: Create /library/games/minetest/worlds/world
|
||||
file:
|
||||
state: directory
|
||||
path: /etc/minetest
|
||||
owner: root
|
||||
group: root
|
||||
path: "{{ item }}"
|
||||
owner: "{{ minetest_default_runas_user }}"
|
||||
group: "{{ minetest_default_runas_group }}"
|
||||
mode: 0755
|
||||
|
||||
# - name: move files to world dir
|
||||
|
||||
- name: 'Change minetest_server_bin: /usr/bin/minetest-server if not RPi'
|
||||
set_fact:
|
||||
minetest_server_bin: /usr/bin/minetest-server
|
||||
#when: not is_rpi
|
||||
|
||||
- name: Create minetest-server service and minetest.conf file
|
||||
template:
|
||||
backup: no
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
with_items:
|
||||
- { src: 'minetest.conf.j2', dest: '/etc/minetest/minetest.conf' }
|
||||
- { src: 'minetest-serve.service.j2', dest: '/etc/systemd/system/minetest-serve.service' }
|
||||
- "{{ minetest_world_dir }}"
|
||||
|
||||
# - name: Start minetest
|
||||
- name: Change exec line in generated unit file
|
||||
lineinfile:
|
||||
path: /lib/systemd/system/minetest-server.service
|
||||
regexp: "{{ item.regexp }}"
|
||||
line: "{{ item.line }}"
|
||||
with_items:
|
||||
- { regexp: '^ExecStart=/usr/lib/minetest/minetestserver', line: 'ExecStart=/usr/lib/minetest/minetestserver --config /etc/minetest/minetest.conf --logfile /var/log/minetest/minetest.log --world "{{ minetest_world_dir }}"' }
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
unarchive:
|
||||
src: "{{ downloads_dir }}/{{ item.name }}.zip"
|
||||
dest: "{{ minetest_game_dir }}/mods"
|
||||
owner: "{{ minetest_runas_user }}"
|
||||
group: "{{ minetest_runas_group }}"
|
||||
when: not minetest_mod.stat.exists
|
||||
|
||||
- name: Check if mod name has 'master' in it
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
# For rpi installs
|
||||
|
||||
- name: Set some facts
|
||||
set_fact:
|
||||
rpi_src_url: http://www.nathansalapat.com/downloads/0.4.17.1.tar.gz
|
||||
rpi_src: minetest-0.4.17.1.tar.gz
|
||||
|
||||
- name: Install 'libhiredis-dev' package for Minetest
|
||||
package:
|
||||
name: libhiredis-dev
|
||||
state: present
|
||||
|
||||
#- name: Minetest already installed - terminate play
|
||||
# meta: end_play
|
||||
# when: minetest_world.stat.exists
|
||||
|
||||
- name: Download Minetest {{ rpi_src_url }} for RPi
|
||||
- name: Download Minetest {{ minetest_rpi_src_url }} for RPi
|
||||
get_url:
|
||||
url: "{{ rpi_src_url }}"
|
||||
dest: "{{ downloads_dir }}/{{ rpi_src }}"
|
||||
url: "{{ minetest_rpi_src_url }}"
|
||||
dest: "{{ downloads_dir }}/{{ minetest_rpi_src }}"
|
||||
timeout: "{{ download_timeout }}"
|
||||
|
||||
- name: Create dirs /etc/minetest and /library/games
|
||||
|
@ -29,32 +20,24 @@
|
|||
mode: 0755
|
||||
with_items:
|
||||
- /etc/minetest
|
||||
- /library/games
|
||||
|
||||
- name: Create dir /var/log/minetest
|
||||
file:
|
||||
state: directory
|
||||
path: /var/log/minetest
|
||||
owner: "{{ minetest_runas_user }}"
|
||||
group: "{{ minetest_runas_group }}"
|
||||
mode: 0755
|
||||
- /var/log/minetest
|
||||
|
||||
- name: Extract {{ downloads_dir }}/{{ rpi_src }} into /library/games
|
||||
unarchive:
|
||||
src: "{{ downloads_dir }}/{{ rpi_src }}"
|
||||
src: "{{ downloads_dir }}/{{ minetest_rpi_src }}"
|
||||
dest: /library/games
|
||||
owner: "{{ minetest_runas_user }}"
|
||||
group: "{{ minetest_runas_group }}"
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create symbolic link /library/games/minetest
|
||||
file:
|
||||
state: link
|
||||
src: /library/games/0.4.17.1
|
||||
dest: /library/games/minetest
|
||||
owner: "{{ minetest_runas_user }}"
|
||||
group: "{{ minetest_runas_group }}"
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create /etc/minetest/minetest.conf and minetest-serve.service
|
||||
- name: Create /etc/minetest/minetest.conf and minetest-server.service
|
||||
template:
|
||||
backup: no
|
||||
src: "{{ item.src }}"
|
||||
|
@ -64,4 +47,5 @@
|
|||
mode: 0644
|
||||
with_items:
|
||||
- { src: 'minetest.conf.j2', dest: '/etc/minetest/minetest.conf' }
|
||||
- { src: 'minetest-serve.service.j2', dest: '/etc/systemd/system/minetest-serve.service' }
|
||||
- { src: 'minetest-serve.service.j2', dest: '/etc/systemd/system/minetest-server.service' }
|
||||
when: minetest_install
|
||||
|
|
|
@ -4,11 +4,11 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ minetest_runas_user }}
|
||||
Group={{ minetest_runas_group }}
|
||||
WorkingDirectory=/library/games/minetest
|
||||
ExecStart={{ minetest_server_bin }} --port {{ minetest_port }} --config {{ minetest_config_file }} --logfile /var/log/minetest/minetest.log --world {{ minetest_world_dir }}
|
||||
Restart=on-abort
|
||||
RestartSec=5s
|
||||
TimeoutStartSec=900
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -2,7 +2,12 @@
|
|||
PBX README
|
||||
==========
|
||||
|
||||
This 'pbx' playbook adds `Asterisk <https://asterisk.org/>`_ and `FreePBX <https://freepbx.org/>`_ to Internet-in-a-Box (IIAB) for VoIP and SIP functionality.
|
||||
This 'pbx' playbook adds `Asterisk <https://asterisk.org/>`_ and `FreePBX <https://freepbx.org/>`_ to Internet-in-a-Box (IIAB) for VoIP and SIP functionality e.g. for rural telephony.
|
||||
|
||||
This initial release (for IIAB 6.7 in February 2019) supports Ubuntu 18.04 and Debian 9 "Stretch" — in future Raspberry Pi (Raspbian) might also be possible! (`#1467 <https://github.com/iiab/iiab/issues/1467>`_)
|
||||
|
||||
Explanation
|
||||
-----------
|
||||
|
||||
Asterisk is a software implementation of a private branch exchange (PBX). In conjunction with suitable telephony hardware interfaces and network applications, Asterisk is used to establish and control telephone calls between telecommunication endpoints, such as customary telephone sets, destinations on the public switched telephone network (PSTN), and devices or services on Voice over Internet Protocol (VoIP) networks. Its name comes from the asterisk (*) symbol for a signal used in dual-tone multi-frequency (DTMF) dialing.
|
||||
|
||||
|
@ -20,7 +25,7 @@ Optionally, you may want to enable `chan_dongle <https://github.com/wdoekes/aste
|
|||
|
||||
asterisk_chan_dongle: True
|
||||
|
||||
After installing PBX as part of IIAB, please visit http://pbx.lan/freepbx and proceed with initial configuration — which asks you to create a login/password.
|
||||
After installing PBX as part of IIAB, please visit http://pbx.lan/freepbx and proceed with initial configuration (no login/password is required initially — you will be asked to set this up).
|
||||
|
||||
You can monitor the PBX service with command::
|
||||
|
||||
|
@ -29,4 +34,4 @@ You can monitor the PBX service with command::
|
|||
Attribution
|
||||
-----------
|
||||
|
||||
This 'pbx' playbook was heavily inspired by Yannik Sembritzki's `Asterisk <https://github.com/Yannik/ansible-role-asterisk>`_ and `FreePBX <https://github.com/Yannik/ansible-role-freepbx>`_ Ansible work.
|
||||
This 'pbx' playbook was heavily inspired by Yannik Sembritzki's `Asterisk <https://github.com/Yannik/ansible-role-asterisk>`_ and `FreePBX <https://github.com/Yannik/ansible-role-freepbx>`_ Ansible work, Thank You!
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# sugarizer_port is set to 8089 in /opt/iiab/iiab/vars/default_vars.yml
|
||||
# If you need to change this, edit /etc/iiab/local_vars.yml prior to installing
|
||||
|
||||
RedirectMatch ^/sugar$ /sugarizer
|
||||
|
||||
ProxyPass /sugarizer http://localhost:{{ sugarizer_port }}/sugarizer
|
||||
ProxyPassReverse /sugarizer http://localhost:{{ sugarizer_port }}/sugarizer
|
||||
|
|
|
@ -454,6 +454,7 @@ minetest_working_dir: /usr/share/games/minetest
|
|||
minetest_game_dir: /usr/share/games/minetest/games/minetest_game
|
||||
minetest_config_file: /etc/minetest/minetest.conf
|
||||
|
||||
|
||||
# CONSIDER THESE 2 NEW OPENSTREETMAP (OSM) APPROACHES INSTEAD, AS OF 2018:
|
||||
# - http://download.iiab.io/content/OSM/vector-tiles/
|
||||
# - http://oer2go.org/viewmod/en-worldmap-10
|
||||
|
|
Loading…
Add table
Reference in a new issue