Skip to content

Commit 4350877

Browse files
Use handler to clear application cache.
1 parent 9333630 commit 4350877

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

icpc-wf/ansible/admin.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
tags: clusterssh
3939
- role: phpstorm
4040
tags: phpstorm
41+
handlers:
42+
- include: handlers.yml
4143
tasks:
4244
- name: install common required/useful packages
4345
tags: packages
@@ -97,13 +99,7 @@
9799
owner: domjudge
98100
group: domjudge
99101
mode: 0644
100-
register: css_installed
101-
102-
- name: Clear application cache
103-
command: "{{DJ_DIR}}/webapp/bin/console cache:clear"
104-
become: yes
105-
become_user: domjudge
106-
when: css_installed.changed
102+
notify: clear application cache
107103

108104
- name: Install netrc file
109105
template:

icpc-wf/ansible/domserver.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
tags: mysql_replication
3737
- role: keepalived
3838
tags: keepalived
39+
handlers:
40+
- include: handlers.yml
3941
tasks:
4042
- name: install domserver required packages
4143
apt:
@@ -57,11 +59,13 @@
5759
dest: "{{DJ_DIR}}/webapp/public"
5860
owner: no
5961
use_ssh_args: true
62+
notify: clear application cache
6063

6164
- name: Add documentation in DOMjudge team interface
6265
copy:
6366
src: files/docs.yaml
6467
dest: "{{DJ_DIR}}/etc/"
68+
notify: clear application cache
6569

6670
- name: add autostart shortcuts
6771
copy:

icpc-wf/ansible/handlers.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Common definition of handlers
2+
---
3+
- name: clear application cache
4+
command: "{{DJ_DIR}}/webapp/bin/console cache:clear"
5+
become: yes
6+
become_user: domjudge

0 commit comments

Comments
 (0)