Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ansible/roles/minecraft/files/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
image: itzg/minecraft-server:2026.8.2@sha256:efa878ddb49cf5251b2e5f2ad71b08fd2f7236c1f7907433f6697258b31d2ce4
tty: true
stdin_open: true
user: "${UID:?}:${GID:?}"
ports:
- "25565:25565"
environment:
Expand Down
13 changes: 13 additions & 0 deletions ansible/roles/minecraft/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
- name: Look up the letsbuilda account
ansible.builtin.getent:
database: passwd
key: letsbuilda
- name: Create configuration directory
ansible.builtin.file:
path: /opt/letsbuilda/minecraft/
Expand All @@ -13,6 +17,15 @@
owner: letsbuilda
group: letsbuilda
mode: '0600'
- name: Create the .env file
ansible.builtin.copy:
content: |
UID={{ ansible_facts.getent_passwd['letsbuilda'][1] }}
GID={{ ansible_facts.getent_passwd['letsbuilda'][2] }}
dest: /opt/letsbuilda/minecraft/.env
owner: letsbuilda
group: letsbuilda
mode: '0600'
- name: Run the containers
become: true
become_user: letsbuilda
Expand Down