-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
54 lines (46 loc) · 1.39 KB
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
- name: Setup MF server on a Linux server
hosts: servers
become: true
vars_files:
- vars.yml
vars:
game_path: "{{ install_path }}/MobileForces"
website_path: "{{ install_path }}/website"
tasks:
- name: Ensure server user exists
ansible.builtin.user:
name: "{{ server_user }}"
- name: Ensure install directory exists
ansible.builtin.file:
path: "{{ install_path }}/"
state: directory
owner: "{{ server_user }}"
group: "{{ server_user }}"
mode: "755"
- name: Install common dependencies
ansible.builtin.package:
name: unzip
state: latest
update_cache: yes
- name: Create MF masterserver
ansible.builtin.include_tasks:
file: tasks/create_mf_masterserver.yml
- name: Create MF gameserver
ansible.builtin.include_tasks:
file: tasks/create_mf_gameserver.yml
- name: Create apache webserver (site + FastDL)
ansible.builtin.include_tasks:
file: tasks/create_apache_webserver.yml
- name: Start MF services
ansible.builtin.service:
name: "{{ item }}"
state: started
enabled: yes
loop:
- mobileforces-masterserver
- mobileforces
- mobileforces-fastdl
handlers:
- ansible.builtin.import_tasks: handlers/systemctl.yml
- ansible.builtin.import_tasks: handlers/apache.yml