new version
Some checks failed
Ansible Minecraft CI/CD / Ansible Lint (push) Successful in 8s
Ansible Minecraft CI/CD / Syntax Check (push) Failing after 7s
Ansible Minecraft CI/CD / Deploy to Staging (push) Has been skipped
Ansible Minecraft CI/CD / Deploy to Production (push) Has been skipped

This commit is contained in:
2025-08-27 15:11:08 +02:00
parent 3e64946953
commit 8f0877cd53
105 changed files with 911 additions and 2540 deletions

View File

@@ -1,32 +1,9 @@
---
- name: Check if ops.json exists
ansible.builtin.stat:
path: "{{ minecraft_server_dir }}/ops.json"
register: ops_file
- name: Create ops.json file
- name: Génération du fichier ops.json
ansible.builtin.template:
src: ops.json.j2
dest: "{{ minecraft_server_dir }}/ops.json"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0644'
backup: yes
when: minecraft_ops is defined and minecraft_ops | length > 0
- name: Create empty ops.json if no ops defined
ansible.builtin.copy:
content: "[]"
dest: "{{ minecraft_server_dir }}/ops.json"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0644'
force: no
when: not ops_file.stat.exists and (minecraft_ops is not defined or minecraft_ops | length == 0)
- name: Set permissions on ops.json
ansible.builtin.file:
path: "{{ minecraft_server_dir }}/ops.json"
owner: "{{ minecraft_user }}"
group: "{{ minecraft_group }}"
mode: '0644'
notify: restart minecraft