Skip to content

Commit

Permalink
Merge pull request #3426 from tim-moody/7.3.7-minetest
Browse files Browse the repository at this point in the history
Upgrade MineTest to only use package on all platforms
  • Loading branch information
tim-moody committed Nov 18, 2022
2 parents 6333ea1 + 1f68641 commit fcc8bcc
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 127 deletions.
File renamed without changes.
15 changes: 2 additions & 13 deletions roles/minetest/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If changes are necessary, please edit `/etc/iiab/local_vars.yml <https://wiki.ii
- ``minetest_port:`` port on which client should connect; default is 30000
- ``minetest_server_admin:`` user with all permissions on minetest server; default is Admin

- ``minetest_default_game:`` only carbone-ng and minetest are supported; default is `carbone-ng <https://github.com/Calinou/carbone-ng>`_
- ``minetest_default_game:`` only the default minetest game is supported at present; in future the default will be DreamBuilder
- ``minetest_flat_world:`` use a flat mapgen engine to lower computation on client; default is False

After installation, you can monitor the 'minetest-server' service with command::
Expand All @@ -42,24 +42,13 @@ File Locations

- The config file is ``/etc/minetest/minetest.conf``
- The world files are at ``/library/games/minetest/worlds/world``

File Locations on Raspberry Pi
------------------------------

- The server binary is ``/library/games/minetest/bin/minetestserver``
- The working directory is ``/library/games/minetest``
- mods are in ``/library/games/minetest/games/<game>/mods``

File Locations on Other Platforms
---------------------------------

- The server binary is ``/usr/lib/minetest/minetestserver``
- The working directory is ``/usr/share/games/minetest``
- mods are in ``/usr/share/games/minetest/games/<game>/mods``

To Do
-----

- Add more mods — currently only the default mods are there in carbone-ng
- Add more mods
- Add more games
- Minetest client software for Windows and Android, included onboard IIAB for offline communities (`#1465 <https://github.com/iiab/iiab/issues/1465>`_)
18 changes: 8 additions & 10 deletions roles/minetest/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# minetest_install: False
# minetest_enabled: False

# minetest_port: 30000
# minetest_server_admin: Admin

# minetest_default_game: carbone-ng # only carbone-ng and minetest are supported
# minetest_flat_world: False

# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
# Other vars 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!

# These should not be touched unless minetest packages change
minetest_server_bin: /usr/lib/minetest/minetestserver
minetest_config_file: /etc/minetest/minetest.conf
minetest_world_dir: /library/games/minetest/worlds/world

minetest_runas_user: root
minetest_runas_group: root

#minetest_runas_user: Debian-minetest
#minetest_runas_group: games
48 changes: 48 additions & 0 deletions roles/minetest/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- name: Check for Minetest world file ({{ minetest_world_dir }}/world.mt)
stat:
path: "{{ minetest_world_dir }}/world.mt"
register: minetest_world

- name: mkdir /library/games
file:
state: directory
path: /library/games
# owner: root
# group: root
# mode: '0755'

- include_tasks: minetest_install.yml
when: not minetest_world.stat.exists

# Install games
#- include_tasks: minetest_install_games.yml
# with_items:
# - name: carbone-ng
# url: https://github.com/Calinou/carbone-ng

# Install mods
- include_tasks: minetest_install_mods.yml
with_items:
- name: basic_materials
url: https://content.minetest.net/packages/VanessaE/basic_materials/releases/14936/download/
- name: mesecons
url: https://content.minetest.net/packages/Jeija/mesecons/releases/14247/download/
- name: digilines
url: https://content.minetest.net/packages/Jeija/digilines/releases/13248/download/
- name: pipeworks
url: https://content.minetest.net/packages/VanessaE/pipeworks/releases/7488/download/
- name: Minetest-WorldEdit
url: https://content.minetest.net/packages/sfan5/worldedit/releases/13367/download/
when: minetest_default_game == "minetest"

# RECORD Minetest AS INSTALLED

- name: "Set 'minetest_installed: True'"
set_fact:
minetest_installed: True

- name: "Add 'minetest_installed: True' to {{ iiab_state_file }}"
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^minetest_installed'
line: 'minetest_installed: True'
2 changes: 1 addition & 1 deletion roles/minetest/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- block:

- name: Install Minetest if 'minetest_installed' not defined, e.g. in {{ iiab_state_file }} # /etc/iiab/iiab_state.yml
include_tasks: provision.yml # i.e. install.yml in other roles
include_tasks: install.yml
when: minetest_installed is undefined

- include_tasks: enable-or-disable.yml
Expand Down
10 changes: 0 additions & 10 deletions roles/minetest/tasks/minetest_install.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# For non-rpi installs

- name: Install Minetest package
package:
name: minetest-server
Expand Down Expand Up @@ -35,11 +33,3 @@
mode: 0755
with_items:
- "{{ minetest_world_dir }}"

- 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 }}"' }
83 changes: 0 additions & 83 deletions roles/minetest/tasks/provision.yml

This file was deleted.

File renamed without changes.
7 changes: 6 additions & 1 deletion vars/default_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,13 @@ internetarchive_port: 4244 # for http://box:4244
minetest_install: False
minetest_enabled: False
minetest_port: 30000
minetest_working_dir: /usr/share/games/minetest

minetest_server_admin: Admin
minetest_default_game: carbone-ng # only carbone-ng and minetest are supported
# minetest_default_game: carbone-ng # carbone-ng is not longer compatible so not supported
minetest_default_game: minetest
# minetest_default_game: dreambuilder - after 5.6
minetest_game_dir: "{{ minetest_working_dir }}/games/{{ minetest_default_game }}_game"
minetest_flat_world: False

# Calibre-Web E-Book Library -- Alternative to Calibre, offers a clean/modern UX
Expand Down
9 changes: 0 additions & 9 deletions vars/raspbian-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,3 @@ php_version: "7.4"
postgresql_version: 13
systemd_location: /lib/systemd/system
python_ver: "3.9"

# Minetest for RPi
minetest_server_bin: /library/games/minetest/bin/minetestserver
minetest_working_dir: /library/games/minetest
minetest_game_dir: /library/games/minetest/games/minetest_game
minetest_rpi_src_tar: minetest.5.1.1.tar.gz
#minetest_rpi_src_url: "https://www.nathansalapat.com/downloads/{{ minetest_rpi_src_tar }}"
minetest_rpi_src_url: "{{ iiab_download_url }}/{{ minetest_rpi_src_tar }}"
minetest_rpi_src_untarred: Minetest

0 comments on commit fcc8bcc

Please sign in to comment.