mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
wip
This commit is contained in:
parent
6333ea1483
commit
cd8f599dd7
7 changed files with 12 additions and 53 deletions
|
@ -1,23 +0,0 @@
|
|||
# For rpi installs
|
||||
|
||||
- name: Set some facts for RPi
|
||||
set_fact:
|
||||
minetest_server_bin: /library/games/minetest/bin/minetestserver
|
||||
minetest_working_dir: /library/games/minetest
|
||||
# only works if server run as root
|
||||
minetest_runas_user: root
|
||||
minetest_runas_group: root
|
||||
when: is_raspbian
|
||||
|
||||
# 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_raspbian
|
||||
|
||||
- name: Set some facts for all
|
||||
set_fact:
|
||||
minetest_game_dir: "{{ minetest_working_dir }}/games/{{ minetest_default_game }}"
|
|
@ -1,6 +1,3 @@
|
|||
# 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"
|
||||
|
@ -14,29 +11,8 @@
|
|||
# group: root
|
||||
# mode: '0755'
|
||||
|
||||
# rpi only
|
||||
- include_tasks: rpi_minetest_install.yml
|
||||
when: not minetest_world.stat.exists and is_raspbian
|
||||
|
||||
# not rpi
|
||||
- include_tasks: minetest_install.yml
|
||||
when: not minetest_world.stat.exists and not is_raspbian
|
||||
|
||||
- git:
|
||||
repo: https://github.com/Calinou/carbone-ng.git
|
||||
dest: "{{ minetest_game_dir }}"
|
||||
depth: 1
|
||||
when: not minetest_world.stat.exists and 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"
|
||||
when: not minetest_world.stat.exists
|
||||
|
||||
# Install games
|
||||
#- include_tasks: minetest_install_games.yml
|
||||
|
@ -63,13 +39,6 @@
|
|||
url: https://github.com/Uberi/Minetest-WorldEdit/archive/master.zip
|
||||
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"
|
||||
|
||||
|
||||
# RECORD Minetest AS INSTALLED
|
||||
|
||||
- name: "Set 'minetest_installed: True'"
|
|
@ -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
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
# For non-rpi installs
|
||||
|
||||
- name: Install Minetest package
|
||||
package:
|
||||
name: minetest-server
|
||||
|
@ -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 }}"' }
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
# For rpi installs
|
||||
|
||||
- name: Install 'libhiredis-dev' package for Minetest
|
||||
package:
|
||||
name: libhiredis-dev
|
||||
state: present
|
||||
|
||||
- name: Download Minetest {{ minetest_rpi_src_url }} for RPi
|
||||
get_url:
|
||||
url: "{{ minetest_rpi_src_url }}"
|
||||
dest: "{{ downloads_dir }}/{{ minetest_rpi_src_tar }}"
|
||||
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
|
||||
path: "{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
with_items:
|
||||
- /etc/minetest
|
||||
- /var/log/minetest
|
||||
|
||||
- name: Extract {{ downloads_dir }}/{{ minetest_rpi_src_tar }} into /library/games
|
||||
unarchive:
|
||||
src: "{{ downloads_dir }}/{{ minetest_rpi_src_tar }}"
|
||||
dest: /library/games
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create symlink /library/games/minetest => /library/games/{{ minetest_rpi_src_untarred }}
|
||||
file:
|
||||
state: link
|
||||
src: /library/games/{{ minetest_rpi_src_untarred }}
|
||||
dest: /library/games/minetest
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Create /etc/minetest/minetest.conf and minetest-server.service
|
||||
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-server.service.j2', dest: '/etc/systemd/system/minetest-server.service' }
|
||||
when: minetest_install
|
Loading…
Add table
Add a link
Reference in a new issue