1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

add flat world and carbone-ng default

This commit is contained in:
Tim Moody 2019-02-10 12:33:30 -05:00
parent 7d4bd29111
commit 9b0d863208
6 changed files with 79 additions and 17 deletions

View file

@ -3,11 +3,21 @@
- name: Set some facts for RPi
set_fact:
minetest_server_bin: /library/games/minetest/bin/minetestserver
minetest_world_dir: /library/games/minetest/worlds/world
minetest_game_dir: /library/games/minetest/games/minetest_game
minetest_working_dir: /library/games/minetest
# only works if server run as root
minetest_runas_user: root
minetest_runas_group: root
when: is_rpi
# For other installs TBD
# For other installs
- name: Set some facts for other platforms
set_fact:
minetest_server_bin: /usr/lib/minetest/minetestserver
minetest_working_dir: /usr/share/games/minetest
minetest_runas_user: Debian-minetest
minetest_runas_group: games
when: not is_rpi
- name: Set some facts for all
set_fact:
minetest_game_dir: "{{ minetest_working_dir }}/games/{{ minetest_default_game }}"

View file

@ -1,3 +1,6 @@
# Calculate local variables
- include_tasks: calc_vars.yml
- name: Check for minetest world file ({{ minetest_world_dir }}/world.mt)
stat:
path: "{{ minetest_world_dir }}/world.mt"
@ -12,15 +15,36 @@
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
when: not minetest_world.stat.exists and is_rpi
# not rpi
- include_tasks: minetest_install.yml
when: minetest_install and not minetest_world.stat.exists and not is_rpi
when: not minetest_world.stat.exists and not is_rpi
- git:
repo: https://github.com/Calinou/carbone-ng.git
dest: "{{ minetest_game_dir }}"
depth: 1
when: minetest_default_game == "carbone-ng"
- name: Give minetest user ownership of carbone-ng
file:
state: directory
path: "{{ minetest_game_dir }}"
recurse: yes
owner: "{{ minetest_runas_user }}"
group: "{{ minetest_runas_group }}"
mode: 0755
when: minetest_default_game == "carbone-ng"
# Install games
#- include: minetest_install_games.yml
# with_items:
# - name: carbone-ng
# url: https://github.com/Calinou/carbone-ng
# Install mods
- include: minetest_install_mods.yml
@ -39,7 +63,13 @@
url: https://github.com/minetest-mods/pipeworks/archive/master.zip
- name: Minetest-WorldEdit
url: https://github.com/Uberi/Minetest-WorldEdit/archive/master.zip
when: minetest_install
when: minetest_default_game == "minetest"
- name: Remove mod from carbone-ng that prevents our Admin name
file:
state: absent
path: "{{ minetest_game_dir }}/mods/name_restrictions"
when: minetest_default_game == "carbone-ng"
# enable or disable
- name: Enable & Restart 'minetest-server' service
@ -48,7 +78,7 @@
name: minetest-server
enabled: yes
state: restarted
when: minetest_install and minetest_enabled
when: minetest_enabled
- name: Disable 'minetest-server' service
systemd:
@ -56,7 +86,7 @@
name: minetest-server
enabled: no
state: stopped
when: minetest_install and not minetest_enabled
when: not minetest_enabled
- name: Add 'minetest' variable values to {{ iiab_ini_file }}
ini_file:

View file

@ -1,5 +1,4 @@
# For non-rpi installs
# Still a work in progress
- name: Install Minetest package
package:
@ -16,13 +15,23 @@
- { regexp: '^name = ', line: 'name = Admin' }
- { regexp: '^creative_mode = ', line: 'creative_mode = true' }
- { regexp: '^port = ', line: 'port = {{ minetest_port }}' }
- { regexp: '^default_game = ', line: 'default_game = {{ minetest_default_game }}' }
- name: Set mapgen engine to flat if enabled
lineinfile:
path: /etc/minetest/minetest.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^mg_name = ', line: 'mg_name = flat' }
when: minetest_flat_world
- name: Create /library/games/minetest/worlds/world
file:
state: directory
path: "{{ item }}"
owner: "{{ minetest_default_runas_user }}"
group: "{{ minetest_default_runas_group }}"
owner: "{{ minetest_runas_user }}"
group: "{{ minetest_runas_group }}"
mode: 0755
with_items:
- "{{ minetest_world_dir }}"

View file

@ -11,6 +11,7 @@
dest: "{{ downloads_dir }}/{{ minetest_rpi_src }}"
timeout: "{{ download_timeout }}"
# we need to create these for rpi, but package creates them for other OSes
- name: Create dirs /etc/minetest and /library/games
file:
state: directory