Skip to content

Commit 7bd76a9

Browse files
committed
Update variables.yml
1 parent d9eda51 commit 7bd76a9

File tree

7 files changed

+37
-156
lines changed

7 files changed

+37
-156
lines changed

icpc-wf/ansible/common_tasks_all.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66

77
- include: common_tasks_packages_icpc-wf.yml
88

9+
- name: Update and upgrade apt packages
10+
become: true
11+
apt:
12+
upgrade: yes
13+
update_cache: yes
14+
cache_valid_time: 86400 #One day
15+
916
- name: install common required/useful packages
1017
tags: packages
1118
apt:
1219
state: present
1320
pkg:
21+
- acl
1422
- ack-grep
1523
- git
1624
- htop
@@ -94,17 +102,6 @@
94102
mode: 0600
95103
when: DJ_GIT_SSH_KEY is defined
96104

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-
108105
- name: configure domjudge logging
109106
copy: src=files/rsyslog.domjudge.conf dest=/etc/rsyslog.d/domjudge.conf
110107
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: 'pc2\.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 & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,6 @@
8787
- COLLECTD_MYSQL_PASSWORD is defined
8888
- "'domjudge' == ansible_hostname or 'domjudge-laptop' in ansible_hostname or 'domjudge-backup' in ansible_hostname"
8989

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-
create: yes
99-
notify: restart gdm
100-
101-
- name: Automatically login domjudge user
102-
lineinfile:
103-
path: /etc/gdm3/custom.conf
104-
regexp: 'AutomaticLogin'
105-
line: 'AutomaticLogin=domjudge'
106-
notify: restart gdm
107-
108-
- name: make sure autostart directory exists
109-
file: dest=/home/domjudge/.config/autostart state=directory owner=domjudge group=domjudge
110-
tags: fix_autostart
111-
11290
- name: install SSL server certificates
11391
copy:
11492
src: "{{ item }}"

icpc-wf/ansible/domserver.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
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
@@ -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

@@ -119,25 +94,10 @@
11994
command: "{{DJ_DIR}}/bin/dj_setup_database -u root bare-install"
12095
when: "'failed' in db_status.stdout"
12196

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-
13097
- name: disable developer mode
13198
lineinfile:
13299
regexp: '^APP_ENV=dev'
133100
state: absent
134101
dest: "{{DJ_DIR}}/webapp/.env.local"
135102

136103
- 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.28
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.78

icpc-wf/ansible/judgehost.yml

Lines changed: 7 additions & 22 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

@@ -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

@@ -133,24 +133,9 @@
133133
- tune_cpu
134134
- domjudge-judgehost
135135

136-
- name: add autostart shortcuts
137-
copy: src=files/{{item}}.desktop dest=/home/domjudge/.config/autostart/ owner=domjudge group=domjudge mode=0755
138-
with_items:
139-
- taillog
140-
- rotate
141-
- domjudgelogo
142-
143136
- name: disable apport service
144137
service:
145138
name: apport
146139
enabled: no
147140
state: stopped
148141

149-
- name: disable systemd timers
150-
command: systemctl mask {{item}}
151-
args:
152-
creates: /etc/systemd/system/{{item}}
153-
with_items:
154-
- apt-daily-upgrade.timer
155-
- apt-daily.timer
156-
- systemd-tmpfiles-clean.timer

icpc-wf/ansible/variables.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ DJ_BRANCH: master
99

1010
# URL and IP of domserver from judgehosts. A hostname 'domserver' with
1111
# DOMSERVER_IP will be added to the judgehost /etc/hosts file.
12-
DOMSERVER: https://domjudge
13-
DOMSERVER_IP: 10.3.3.215
12+
DOMSERVER: https://dj.storm.vu
13+
DOMSERVER_IP: 130.37.193.150
1414
DOMSERVER_URL: "{{DOMSERVER}}"
15-
DOMSERVER_SSL_CERT: /etc/ssl/certs/domserver.crt
16-
DOMSERVER_SSL_KEY: /etc/ssl/private/domserver.key
15+
DOMSERVER_SSL_CERT: /etc/ssl/certs/localhost.crt
16+
DOMSERVER_SSL_KEY: /etc/ssl/private/localhost.key
1717

18-
TIMEZONE: "Europe/Moscow"
18+
TIMEZONE: "Europe/Amsterdam"
1919

2020
PHP_FPM_MAX_CHILDREN: 400
2121
PHP_FPM_MAX_REQUESTS: 500
@@ -26,7 +26,7 @@ PHP_MAX_FILE_UPLOADS: 101
2626

2727
# Password for the MySQL replication user.
2828
# Set this to enable master-master replication between two domservers.
29-
REPLICATION_PASSWORD: some-replication-password
29+
#REPLICATION_PASSWORD: some-replication-password
3030

3131
# Password for the collectd MySQL status user.
3232
# Set this to enable collectd for system statistics collection.
@@ -46,15 +46,15 @@ ADMIN_PASSWORD: some-admin-password
4646
#DJ_SHELL_USER_PW: some-hashed-password
4747

4848
# Git repo URL
49-
DJ_GIT_REPO: [email protected]:domjudge
49+
DJ_GIT_REPO: https://github.com/DOMjudge/domjudge.git
5050

5151
# If using a Git repo which requires a SSH key, set the host and key here
52-
DJ_GIT_HOST: 10.3.3.223
53-
DJ_GIT_SSH_KEY: |
54-
-----BEGIN OPENSSH PRIVATE KEY-----
55-
ENTER SSH PRIVATE KEY HERE
56-
-----END OPENSSH PRIVATE KEY-----
52+
DJ_GIT_HOST: github.com
53+
#DJ_GIT_SSH_KEY: |
54+
# -----BEGIN OPENSSH PRIVATE KEY-----
55+
# ENTER SSH PRIVATE KEY HERE
56+
# -----END OPENSSH PRIVATE KEY-----
5757

5858

5959
# Key for domjudge user
60-
DJ_SSH_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPsTOPgh8QYBudu7IOLETq4ek13RBB+pM/spOboCK1wO domjudge@domjudge-ccsadmin1
60+
DJ_SSH_KEY: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAe/eK/AmBHx4cEvvmb+HBg/h9aptCvHfv9sxkdvTr07 vmcj@lenovo

0 commit comments

Comments
 (0)