File tree 5 files changed +21
-13
lines changed
5 files changed +21
-13
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 51
51
- mobileforces-masterserver
52
52
- mobileforces
53
53
- mobileforces-fastdl
54
-
55
- handlers :
56
- - ansible.builtin.import_tasks : handlers/systemctl.yml
Original file line number Diff line number Diff line change 16
16
src : templates/webserver/vhosts/mobileforces.j2
17
17
dest : /etc/apache2/sites-available/mobileforces.conf
18
18
mode : " 644"
19
+ register : apache_vhost
19
20
20
21
- name : Copy website files
21
22
ansible.builtin.copy :
56
57
cmd : " certbot --apache -n --email {{ ServerAdmin }} --agree-tos --no-redirect -d {{ ServerName }}"
57
58
creates : /etc/apache2/sites-enabled/mobileforces-le-ssl.conf
58
59
60
+ - name : Reload apache
61
+ ansible.builtin.service :
62
+ name : apache2
63
+ state : reloaded
64
+ when : apache_vhost.changed
65
+
59
66
- name : PHP tasks (skipped in check mode)
60
67
block :
61
68
- name : Get PHP version
70
77
loop :
71
78
- [= www-data, "= {{ server_user }}"]
72
79
- ["/run/php/php{{ php.stdout }}-fpm.sock", /run/php/www.sock]
80
+ register : fpm_config
73
81
74
- - name : Reload the apache and PHP fpm services
82
+ - name : Reload the PHP fpm service
75
83
ansible.builtin.service :
76
- name : " {{ item }}"
84
+ name : " php {{ php.stdout }}-fpm "
77
85
state : reloaded
78
- loop :
79
- - apache2
80
- - " php{{ php.stdout }}-fpm"
86
+ when : fpm_config.changed
81
87
when : not ansible_check_mode
82
88
83
89
- name : Allow the website to restart game services
Original file line number Diff line number Diff line change 63
63
- [mobileforces.j2, mobileforces.service]
64
64
- [mobileforces-fastdl.j2, mobileforces-fastdl.service]
65
65
- [mobileforces-package.j2, mobileforces-package.service]
66
- notify : Reload systemctl
66
+ register : service_files
67
+
68
+ - name : Reload systemctl
69
+ ansible.builtin.command : systemctl daemon-reload
70
+ when : service_files.changed
67
71
68
72
- name : Create cron job for fastdl
69
73
ansible.builtin.cron :
Original file line number Diff line number Diff line change 31
31
src : templates/masterserver/services/mobileforces-masterserver.j2
32
32
dest : /etc/systemd/system/mobileforces-masterserver.service
33
33
mode : " 644"
34
- notify : Reload systemctl
34
+ register : service_files
35
+
36
+ - name : Reload systemctl
37
+ ansible.builtin.command : systemctl daemon-reload
38
+ when : service_files.changed
You can’t perform that action at this time.
0 commit comments