Skip to content

Commit 92d2df5

Browse files
committed
Command is less risky
Shell opens a real shell and allowes shell features (piping etc.) but command only runs the command prepared from the python shell Also changed some of the services as we already assume systemd and now we can use the reload directly to use less code.
1 parent 9226912 commit 92d2df5

File tree

7 files changed

+28
-21
lines changed

7 files changed

+28
-21
lines changed
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
---
22
# Define here handlers associated to this role.
33

4-
- name: restart systemctl
5-
shell: systemctl daemon-reload
6-
74
- name: restart cds
8-
service: name=cds enabled=true state=restarted
5+
systemd:
6+
name: cds
7+
enabled: true
8+
state: restarted
9+
daemon_reload: true
910

1011
- name: restart nginx
11-
service: name=nginx enabled=true state=restarted
12+
systemd:
13+
name: nginx
14+
enabled: true
15+
state: restarted
16+
daemon_reload: true

icpc-wf/ansible/roles/cds/tasks/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
src: cds.service
9999
dest: /etc/systemd/system/
100100
notify:
101-
- restart systemctl
102101
- restart cds
103102

104103
- name: Setup nginx

icpc-wf/ansible/roles/domjudge_build/handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Define here handlers associated to this role.
33

44
- name: fix permissions on domjudge inplace-install
5-
shell: make -C {{ DJ_DIR }} inplace-postinstall-permissions
5+
command: make -C {{ DJ_DIR }} inplace-postinstall-permissions
66

77
- name: restart rsyslog
88
service: name=rsyslog enabled=true state=restarted

icpc-wf/ansible/roles/icpc_fixes/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
state: absent
1717

1818
- name: Re-order PXEboot
19-
shell: efibootmgr -o {{ EFI_ORDER }}
19+
command: efibootmgr -o {{ EFI_ORDER }}
2020
when: EFI_ORDER is defined
2121

2222
- name: disable mumble,selfie services
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
---
22
# Define here handlers associated to this role.
33

4-
- name: restart systemctl
5-
shell: systemctl daemon-reload
6-
74
- name: enable and restart tune_cpu
8-
service: name=tune_cpu enabled=true state=restarted
5+
systemd:
6+
name: tune_cpu
7+
enabled: true
8+
state: restarted
9+
daemon_reload: true
910

1011
- name: enable and restart create-cgroups
11-
service: name=create-cgroups enabled=true state=restarted
12+
service:
13+
name: create-cgroups
14+
enabled: true
15+
state: restarted
16+
daemon_reload: true
1217

1318
- name: enable and restart judgedaemon
1419
service:
15-
name="domjudge-judgehost.target"
16-
enabled=true
17-
state=restarted
20+
name: "domjudge-judgehost.target"
21+
enabled: true
22+
state: restarted
23+
daemon_reload: true
1824

1925
- name: update grub
20-
shell: update-grub
26+
command: update-grub
2127

2228
- name: reboot
2329
reboot:

icpc-wf/ansible/roles/judgedaemon/tasks/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
src: tune_cpu.service
6161
dest: /etc/systemd/system/
6262
notify:
63-
- restart systemctl
6463
- enable and restart tune_cpu
6564

6665
- name: copy judgedaemon related systemd unit files
@@ -72,15 +71,13 @@
7271
- create-cgroups
7372
- domjudge-judgedaemon@
7473
notify:
75-
- restart systemctl
7674
- enable and restart create-cgroups
7775

7876
- name: template judgedaemon template systemd unit file
7977
template:
8078
src: domjudge-judgehost.target.j2
8179
dest: /etc/systemd/system/domjudge-judgehost.target
8280
notify:
83-
- restart systemctl
8481
- enable and restart judgedaemon
8582

8683
- name: disable systemd timers

icpc-wf/ansible/roles/system_fixes/handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Define here handlers associated to this role.
33

44
- name: update dconf
5-
shell: dconf update
5+
command: dconf update

0 commit comments

Comments
 (0)