|
11 | 11 | - name: restart nginx
|
12 | 12 | service: name=nginx state=restarted
|
13 | 13 | - name: restart PHP FPM
|
14 |
| - service: name=php7.2-fpm state=restarted |
| 14 | + service: name=php7.4-fpm state=restarted |
15 | 15 | - name: update-ca-certificates
|
16 | 16 | command: update-ca-certificates
|
17 | 17 | - name: restart collectd
|
|
35 | 35 | - mariadb-server
|
36 | 36 | - nginx
|
37 | 37 | - php-fpm
|
38 |
| - - python-mysqldb |
| 38 | + - python3-mysqldb |
39 | 39 | - php-intl
|
40 | 40 | - mycli
|
41 | 41 | - macchanger
|
| 42 | + - acl |
42 | 43 |
|
43 | 44 | - name: copy in MySQL config
|
44 | 45 | copy: src=files/my.cnf dest=/root/.my.cnf
|
45 | 46 |
|
46 | 47 | - name: set PHP timezone for FPM
|
47 | 48 | lineinfile:
|
48 |
| - dest: /etc/php/7.2/fpm/php.ini |
| 49 | + dest: /etc/php/7.4/fpm/php.ini |
49 | 50 | state: present
|
50 | 51 | regexp: 'date\.timezone\s*='
|
51 | 52 | line: 'date.timezone = {{TIMEZONE}}'
|
52 | 53 |
|
53 | 54 | - name: enable php modules
|
54 | 55 | command: phpenmod {{item}}
|
55 | 56 | 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 |
57 | 58 | with_items:
|
58 | 59 | - zip
|
59 | 60 | - intl
|
|
69 | 70 | copy: src=files/mysql.domjudge.cnf dest=/etc/mysql/mariadb.conf.d/zz_domjudge.cnf
|
70 | 71 | notify: restart mysql
|
71 | 72 |
|
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 |
| - |
98 | 73 | - name: make sure mysql is restarted
|
99 | 74 | meta: flush_handlers
|
100 | 75 |
|
|
110 | 85 |
|
111 | 86 | - include: common_tasks_build.yml
|
112 | 87 |
|
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 |
| - |
130 | 88 | - name: disable developer mode
|
131 | 89 | lineinfile:
|
132 | 90 | regexp: '^APP_ENV=dev'
|
133 | 91 | state: absent
|
134 | 92 | dest: "{{DJ_DIR}}/webapp/.env.local"
|
135 | 93 |
|
136 | 94 | - 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 |
0 commit comments