homelab/roles/minecraft/tasks/system.yml

27 lines
684 B
YAML

- name: Install Screen
ansible.builtin.apt:
name: screen
state: present
- name: Create Minecraft user
ansible.builtin.user:
name: "{{ minecraft_user }}"
state: present
ansible.builtin.shell: /bin/bash
- name: Create Minecraft directory
ansible.builtin.file:
path: "{{ minecraft_home }}/{{ item.name }}"
state: directory
owner: "{{ minecraft_user }}"
group: "{{ minecraft_user }}"
loop: "{{ minecraft }}"
- name: Answer to Mojang's EULA
ansible.builtin.template:
src: eula.txt.j2
dest: "{{ minecraft_home }}/{{ item.name }}/eula.txt"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_user }}"
loop: "{{ minecraft }}"