Skip to content

Commit 72d548b

Browse files
committed
Update variables.yml
1 parent c444ff5 commit 72d548b

File tree

8 files changed

+57
-193
lines changed

8 files changed

+57
-193
lines changed

icpc-wf/ansible/common_tasks_all.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
apt:
1212
state: present
1313
pkg:
14+
- acl
1415
- ack-grep
1516
- git
1617
- htop
@@ -51,7 +52,7 @@
5152

5253
- name: set PHP timezone for CLI
5354
lineinfile:
54-
dest: /etc/php/7.2/cli/php.ini
55+
dest: /etc/php/7.4/cli/php.ini
5556
state: present
5657
regexp: 'date\.timezone\s*='
5758
line: 'date.timezone = {{TIMEZONE}}'
@@ -94,17 +95,6 @@
9495
mode: 0600
9596
when: DJ_GIT_SSH_KEY is defined
9697

97-
- name: Create SSH config
98-
template: src=files/ssh-config-domjudge.j2 dest=/home/domjudge/.ssh/config owner=domjudge group=domjudge mode=0600
99-
when: DJ_GIT_HOST is defined
100-
101-
- name: add all hosts to hosts file
102-
lineinfile:
103-
dest: /etc/hosts
104-
regexp: '{{ item }}$'
105-
line: "{{ hostvars[item].ansible_host }} {{ item }}"
106-
loop: "{{ groups['all'] }}"
107-
10898
- name: configure domjudge logging
10999
copy: src=files/rsyslog.domjudge.conf dest=/etc/rsyslog.d/domjudge.conf
110100
notify: restart rsyslog

icpc-wf/ansible/common_tasks_packages_icpc-wf.yml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
11
# Common packaging stuff during ICPC World Finals.
22
---
3-
- name: fix apt sources list
4-
tags: packages
5-
replace:
6-
dest: /etc/apt/sources.list
7-
regexp: 'pc2cancer\.ecs\.csus\.edu'
8-
replace: 'packages'
9-
10-
- name: remove pycharm repo
11-
tags: packages
12-
replace:
13-
dest: /etc/apt/sources.list
14-
regexp: '^([^#].*pycharm.*)$'
15-
replace: '# \1'
16-
17-
- name: add packages to hosts file
18-
tags: packages
19-
lineinfile:
20-
dest: /etc/hosts
21-
regexp: '^10\.3\.3\.209'
22-
line: "10.3.3.209 packages"
23-
24-
- name: remove some packages
25-
tags: packages
26-
apt:
27-
pkg: ntp
28-
state: absent
3+
# - name: remove some packages
4+
# tags: packages
5+
# apt:
6+
# pkg: ntp
7+
# state: absent
298

309
- meta: flush_handlers
3110
tags: packages

icpc-wf/ansible/common_tasks_prebuild.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -70,44 +70,6 @@
7070
owner: domjudge
7171
group: domjudge
7272

73-
- name: copy collectd configuration
74-
template: src=files/collectd.conf.j2 dest=/etc/collectd/collectd.conf
75-
notify: restart collectd
76-
when: COLLECTD_MYSQL_PASSWORD is defined
77-
78-
- name: create directory for collectd mysql modules
79-
file: path=/etc/collectd/collectd-python state=directory mode=0755
80-
when:
81-
- COLLECTD_MYSQL_PASSWORD is defined
82-
- "'domjudge' == ansible_hostname or 'domjudge-laptop' in ansible_hostname or 'domjudge-backup' in ansible_hostname"
83-
84-
- name: copy mysql metrics collection script
85-
copy: src=files/collectd-mysql.py dest=/etc/collectd/collectd-python/mysql.py mode=0755
86-
when:
87-
- COLLECTD_MYSQL_PASSWORD is defined
88-
- "'domjudge' == ansible_hostname or 'domjudge-laptop' in ansible_hostname or 'domjudge-backup' in ansible_hostname"
89-
90-
- name: copy DOMjudge logo binary
91-
copy: src=files/domlogo dest=/home/domjudge/domlogo owner=domjudge group=domjudge mode=0755
92-
93-
- name: enable GDM autologin
94-
lineinfile:
95-
path: /etc/gdm3/custom.conf
96-
regexp: 'AutomaticLoginEnable'
97-
line: 'AutomaticLoginEnable=true'
98-
notify: restart gdm
99-
100-
- name: Automatically login domjudge user
101-
lineinfile:
102-
path: /etc/gdm3/custom.conf
103-
regexp: 'AutomaticLogin'
104-
line: 'AutomaticLogin=domjudge'
105-
notify: restart gdm
106-
107-
- name: make sure autostart directory exists
108-
file: dest=/home/domjudge/.config/autostart state=directory owner=domjudge group=domjudge
109-
tags: fix_autostart
110-
11173
- name: install SSL server certificates
11274
copy:
11375
src: "{{ item }}"

icpc-wf/ansible/domserver.yml

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- name: restart nginx
1212
service: name=nginx state=restarted
1313
- name: restart PHP FPM
14-
service: name=php7.2-fpm state=restarted
14+
service: name=php7.4-fpm state=restarted
1515
- name: update-ca-certificates
1616
command: update-ca-certificates
1717
- name: restart collectd
@@ -35,25 +35,26 @@
3535
- mariadb-server
3636
- nginx
3737
- php-fpm
38-
- python-mysqldb
38+
- python3-mysqldb
3939
- php-intl
4040
- mycli
4141
- macchanger
42+
- acl
4243

4344
- name: copy in MySQL config
4445
copy: src=files/my.cnf dest=/root/.my.cnf
4546

4647
- name: set PHP timezone for FPM
4748
lineinfile:
48-
dest: /etc/php/7.2/fpm/php.ini
49+
dest: /etc/php/7.4/fpm/php.ini
4950
state: present
5051
regexp: 'date\.timezone\s*='
5152
line: 'date.timezone = {{TIMEZONE}}'
5253

5354
- name: enable php modules
5455
command: phpenmod {{item}}
5556
args:
56-
creates: /etc/php/7.2/fpm/conf.d/20-{{item}}.ini
57+
creates: /etc/php/7.4/fpm/conf.d/20-{{item}}.ini
5758
with_items:
5859
- zip
5960
- intl
@@ -69,32 +70,6 @@
6970
copy: src=files/mysql.domjudge.cnf dest=/etc/mysql/mariadb.conf.d/zz_domjudge.cnf
7071
notify: restart mysql
7172

72-
- name: add mysql config snippet for replication
73-
template: src=files/mysql.replication.cnf.j2 dest=/etc/mysql/mariadb.conf.d/zzz_replication.cnf
74-
notify: restart mysql
75-
when: REPLICATION_PASSWORD is defined
76-
77-
- name: disable mysql listen on localhost only
78-
replace:
79-
path: /etc/mysql/mariadb.conf.d/50-server.cnf
80-
regexp: '^bind-address\s*='
81-
replace: '#bind-address ='
82-
when: REPLICATION_PASSWORD is defined
83-
84-
- name: copy script to setup replication
85-
template: src=files/setup-replication.sh.j2 dest=/usr/local/sbin/setup-replication.sh mode=0755
86-
when: REPLICATION_PASSWORD is defined
87-
88-
- name: create mysql replication user
89-
mysql_user:
90-
name: replication
91-
host: '%'
92-
password: "{{REPLICATION_PASSWORD}}"
93-
append_privs: true
94-
priv: '*.*:REPLICATION SLAVE'
95-
state: present
96-
when: REPLICATION_PASSWORD is defined
97-
9873
- name: make sure mysql is restarted
9974
meta: flush_handlers
10075

@@ -110,34 +85,10 @@
11085

11186
- include: common_tasks_build.yml
11287

113-
# When using replication, the DB will be dropped and recreated on the slave later.
114-
- name: check if the database is configured
115-
command: "{{DJ_DIR}}/bin/dj_setup_database -u root status"
116-
register: db_status
117-
ignore_errors: true
118-
- name: make sure the database is configured
119-
command: "{{DJ_DIR}}/bin/dj_setup_database -u root bare-install"
120-
when: "'failed' in db_status.stdout"
121-
122-
- name: fix background color
123-
lineinfile:
124-
regexp: '^(\s*background-color):\s+white\s*;'
125-
line: '\1: {{BACKGROUND_COLOR}};'
126-
backrefs: yes
127-
dest: "{{DJ_DIR}}/webapp/web/style.css"
128-
when: BACKGROUND_COLOR is defined
129-
13088
- name: disable developer mode
13189
lineinfile:
13290
regexp: '^APP_ENV=dev'
13391
state: absent
13492
dest: "{{DJ_DIR}}/webapp/.env.local"
13593

13694
- include: nginx-setup.yml
137-
138-
- name: add autostart shortcuts
139-
copy: src=files/{{item}}.desktop dest=/home/domjudge/.config/autostart/ owner=domjudge group=domjudge mode=0755
140-
with_items:
141-
- htop
142-
- taillog-domserver-nginx-error
143-
- taillog-domserver-symfony-error

icpc-wf/ansible/hosts

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,9 @@
11
[all:vars]
2-
ansible_user=root
2+
ansible_user=vmcj
33
ansible_python_interpreter=/usr/bin/python3
44

55
[domserver]
6-
domjudge ansible_host=10.3.3.215
7-
domjudge-backup ansible_host=10.3.3.216
8-
domjudge-laptop ansible_host=10.3.3.200
6+
domjudge-vm ansible_host=192.168.122.222
97

108
[judgehost]
11-
domjudge-judgehost1 ansible_host=10.2.2.192
12-
domjudge-judgehost2 ansible_host=10.2.2.193
13-
domjudge-judgehost3 ansible_host=10.2.2.194
14-
domjudge-judgehost4 ansible_host=10.2.2.195
15-
domjudge-judgehost5 ansible_host=10.2.2.196
16-
domjudge-judgehost6 ansible_host=10.2.2.197
17-
domjudge-judgehost7 ansible_host=10.2.2.198
18-
domjudge-judgehost8 ansible_host=10.2.2.199
19-
domjudge-judgehost9 ansible_host=10.2.2.200
20-
domjudge-judgehost10 ansible_host=10.2.2.201
21-
22-
[admin]
23-
domjudge-ccsadmin1 ansible_host=10.3.3.223
24-
domjudge-ccsadmin2 ansible_host=10.3.3.224
25-
domjudge-ccsadmin3 ansible_host=10.3.3.225
26-
domjudge-ccsadmin4 ansible_host=10.3.3.226
27-
domjudge-ccsadmin5 ansible_host=10.3.3.227
9+
judgehost-vm ansible_host=192.168.122.230

icpc-wf/ansible/judgehost.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
user: name={{item}} createhome=no home=/nonexistent group=nogroup shell=/bin/false
2525
with_items:
2626
- domjudge-run-0
27-
- domjudge-run-1
28-
- domjudge-run-2
29-
- domjudge-run-3
27+
#- domjudge-run-1
28+
#- domjudge-run-2
29+
#- domjudge-run-3
3030
- name: create domjudge-run group
3131
group: name=domjudge-run state=present
3232

@@ -42,7 +42,7 @@
4242
line: '#\1'
4343
backrefs: yes
4444

45-
- include: common_tasks_build.yml
45+
#- include: common_tasks_build.yml
4646

4747
- name: re-enable clearing Symfony cache when building
4848
lineinfile:
@@ -51,12 +51,12 @@
5151
line: '\1'
5252
backrefs: yes
5353

54-
- name: enable internal monitor
55-
file: path=/usr/share/X11/xorg.conf.d/22-icpc.conf state=absent
54+
#- name: enable internal monitor
55+
# file: path=/usr/share/X11/xorg.conf.d/22-icpc.conf state=absent
5656

57-
- name: remove apt-transport-https from bionic debootstrap file
57+
- name: remove apt-transport-https from focal debootstrap file
5858
lineinfile:
59-
path: /usr/share/debootstrap/scripts/bionic
59+
path: /usr/share/debootstrap/scripts/focal
6060
regexp: 'ca-certificates'
6161
line: ' base="$base ca-certificates"'
6262

@@ -105,10 +105,10 @@
105105
- tune_cpu
106106
notify: restart systemctl
107107

108-
- name: copy create-cgroups systemd unit file
109-
copy: src={{DJ_DIR}}/misc-tools/create-cgroups.service dest=/etc/systemd/system/ remote_src=yes
110-
tags: updateservice
111-
notify: restart systemctl
108+
#- name: copy create-cgroups systemd unit file
109+
# copy: src={{DJ_DIR}}/misc-tools/create-cgroups.service dest=/etc/systemd/system/ remote_src=yes
110+
# tags: updateservice
111+
# notify: restart systemctl
112112

113113
- name: copy judgedaemon systemd unit file
114114
copy: src={{DJ_DIR}}/judge/domjudge-judgehost.service dest=/etc/systemd/system/ remote_src=yes
@@ -125,18 +125,18 @@
125125
- tune_cpu
126126
- domjudge-judgehost
127127

128-
- name: add autostart shortcuts
129-
copy: src=files/{{item}}.desktop dest=/home/domjudge/.config/autostart/ owner=domjudge group=domjudge mode=0755
130-
with_items:
131-
- taillog
132-
- rotate
133-
- domjudgelogo
134-
135-
- name: disable systemd timers
136-
command: systemctl mask {{item}}
137-
args:
138-
creates: /etc/systemd/system/{{item}}
139-
with_items:
140-
- apt-daily-upgrade.timer
141-
- apt-daily.timer
142-
- systemd-tmpfiles-clean.timer
128+
#- name: add autostart shortcuts
129+
# copy: src=files/{{item}}.desktop dest=/home/domjudge/.config/autostart/ owner=domjudge group=domjudge mode=0755
130+
# with_items:
131+
# - taillog
132+
# - rotate
133+
# - domjudgelogo
134+
135+
#- name: disable systemd timers
136+
# command: systemctl mask {{item}}
137+
# args:
138+
# creates: /etc/systemd/system/{{item}}
139+
# with_items:
140+
# - apt-daily-upgrade.timer
141+
# - apt-daily.timer
142+
# - systemd-tmpfiles-clean.timer

icpc-wf/ansible/nginx-setup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
notify: update-ca-certificates
1313

1414
- name: copy in domjudge FPM conf
15-
copy: src={{DJ_DIR}}/etc/domjudge-fpm.conf remote_src=yes dest=/etc/php/7.2/fpm/pool.d/domjudge.conf
15+
copy: src={{DJ_DIR}}/etc/domjudge-fpm.conf remote_src=yes dest=/etc/php/7.4/fpm/pool.d/domjudge.conf
1616
notify: restart PHP FPM
1717

1818
- name: copy in domjudge nginx conf
@@ -101,7 +101,7 @@
101101

102102
- name: Set PHP settings
103103
lineinfile:
104-
dest: /etc/php/7.2/fpm/pool.d/domjudge.conf
104+
dest: /etc/php/7.4/fpm/pool.d/domjudge.conf
105105
regexp: "{{item.regexp}}"
106106
line: "{{item.key}} = {{item.value}}"
107107
with_items:

0 commit comments

Comments
 (0)