Skip to content

Commit 6f50e5a

Browse files
committed
fixed db creation and task order
1 parent 2a2230c commit 6f50e5a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

gameserver.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
become: yes
2525

2626
- hosts: web
27-
roles:
28-
- mariadb
29-
#- scorebot_deps_2019
3027
tasks:
3128

3229
- user:
@@ -116,3 +113,8 @@
116113
group: "vagrant"
117114
recurse: yes
118115
become: yes
116+
117+
- hosts: web
118+
roles:
119+
- mariadb
120+
#- scorebot_deps_2019

roles/mariadb/tasks/main.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
become: True
130130

131131

132-
- name: Adding deploy DB user and allow access to news_* databases
132+
- name: Adding deploy DB user and allow access to ctf_* databases
133133
mysql_user:
134134
name: ctf
135135
password: "{{ mysql_ctf_password }}"
@@ -153,7 +153,7 @@
153153
copy:
154154
src: "{{ role_path }}/files/ctf_dump.sql"
155155
dest: /tmp
156-
when: db_created.changed and dump_file.exists
156+
when: db_created.changed and dump_file.stat.exists
157157
become: True
158158

159159

@@ -164,7 +164,7 @@
164164
target: /tmp/ctf_dump.sql
165165
login_user: root
166166
login_password: "{{ mysql_root_password }}"
167-
when: db_created.changed and dump_file.exists
167+
when: db_created.changed and dump_file.stat.exists
168168
become: True
169169

170170

@@ -180,8 +180,7 @@
180180
chdir: /vagrant/ctfdbapi/
181181
environment:
182182
PYTHONPATH: "/vagrant/ctfdbapi/"
183-
#when: db_created.changed and not dump_file.exists
184-
#when: not dump_file.exists
183+
when: db_created.changed and not dump_file.stat.exists
185184
become: yes
186185

187186

0 commit comments

Comments
 (0)