Skip to content

Commit 59b6b15

Browse files
author
Miguel Angel
committed
Use dbshell
1 parent 6e2051e commit 59b6b15

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

tasks/configure.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,20 +236,38 @@
236236
# Get id of the first registered pipeline (id=1)
237237
- name: "Configure AM: get default pipeline UUID from SS database"
238238
become: "yes"
239-
command: mysql {{ archivematica_src_ss_db_name }} -Ns -e "select uuid from locations_pipeline where id='1';"
239+
shell: >
240+
echo "select \`uuid\` from locations_pipeline where id='1';"
241+
| {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1
242+
args:
243+
chdir: "{{ archivematica_src_ss_app }}"
244+
executable: /bin/bash
245+
environment: "{{ archivematica_src_ss_environment }}"
240246
register: pipeline_uuid
241247
tags: "configure-am"
242248

243249
# Gets the uuid of the first registered space (id=1)
244250
- name: "Configure AM: get default Space UUID from SS database"
245251
become: "yes"
246-
command: mysql {{ archivematica_src_ss_db_name }} -Ns -e "select uuid from locations_space where id='1';"
252+
shell: >
253+
echo "select \`uuid\` from locations_space where id='1';"
254+
| {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1
255+
args:
256+
chdir: "{{ archivematica_src_ss_app }}"
257+
executable: /bin/bash
258+
environment: "{{ archivematica_src_ss_environment }}"
247259
register: space_uuid
248260
tags: "configure-am"
249261

250262
- name: "Configure AM: get all TS descriptions from SS database"
251263
become: "yes"
252-
command: mysql {{ archivematica_src_ss_db_name }} -Ns -e "select description from locations_location;"
264+
shell: >
265+
echo "select description from locations_location;"
266+
| {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1
267+
args:
268+
chdir: "{{ archivematica_src_ss_app }}"
269+
executable: /bin/bash
270+
environment: "{{ archivematica_src_ss_environment }}"
253271
register: location_descriptions
254272
tags: "configure-am"
255273

0 commit comments

Comments
 (0)