Add factorio service/game-server
This commit is contained in:
parent
d6c2dd419a
commit
1a6395f602
3 changed files with 139 additions and 0 deletions
playbooks/roles/factorio/tasks
36
playbooks/roles/factorio/tasks/main.yml
Normal file
36
playbooks/roles/factorio/tasks/main.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
- name: Set common facts
|
||||
ansible.builtin.import_tasks: tasks/set-default-facts.yml
|
||||
|
||||
- name: Deploy {{ role_name }}
|
||||
vars:
|
||||
svc: "{{ factorio_svc }}"
|
||||
env: "{{ factorio_env }}"
|
||||
json: "{{ factorio_json }}"
|
||||
compose: "{{ factorio_compose }}"
|
||||
block:
|
||||
- name: Import prepare tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/prepare-common-service.yml
|
||||
|
||||
- name: Set config path
|
||||
ansible.builtin.set_fact:
|
||||
config_path: "{{ (service_path, 'config') | path_join }}"
|
||||
- name: Create config directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ config_path }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
owner: "{{ factorio_uid }}"
|
||||
group: "{{ factorio_gid }}"
|
||||
become: true
|
||||
- name: Template the server settings
|
||||
ansible.builtin.template:
|
||||
src: "json.j2"
|
||||
dest: "{{ (config_path, 'server-settings.json') | path_join }}"
|
||||
mode: "0644"
|
||||
owner: "{{ factorio_uid }}"
|
||||
group: "{{ factorio_gid }}"
|
||||
become: true
|
||||
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
Loading…
Add table
Add a link
Reference in a new issue