From ebfc40f3d85649d9584f605941534a2ffe2cc597 Mon Sep 17 00:00:00 2001 From: Miguel Angel Date: Wed, 2 Sep 2020 23:43:25 +0200 Subject: [PATCH] Use dbshell --- tasks/configure.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index ca0d9920..8a857b2f 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -236,20 +236,38 @@ # Get id of the first registered pipeline (id=1) - name: "Configure AM: get default pipeline UUID from SS database" become: "yes" - command: mysql {{ archivematica_src_ss_db_name }} -Ns -e "select uuid from locations_pipeline where id='1';" + shell: > + echo "select \`uuid\` from locations_pipeline where id='1';" + | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1 + args: + chdir: "{{ archivematica_src_ss_app }}" + executable: /bin/bash + environment: "{{ archivematica_src_ss_environment }}" register: pipeline_uuid tags: "configure-am" # Gets the uuid of the first registered space (id=1) - name: "Configure AM: get default Space UUID from SS database" become: "yes" - command: mysql {{ archivematica_src_ss_db_name }} -Ns -e "select uuid from locations_space where id='1';" + shell: > + echo "select \`uuid\` from locations_space where id='1';" + | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1 + args: + chdir: "{{ archivematica_src_ss_app }}" + executable: /bin/bash + environment: "{{ archivematica_src_ss_environment }}" register: space_uuid tags: "configure-am" - name: "Configure AM: get all TS descriptions from SS database" become: "yes" - command: mysql {{ archivematica_src_ss_db_name }} -Ns -e "select description from locations_location;" + shell: > + echo "select description from locations_location;" + | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py dbshell | tail -n1 + args: + chdir: "{{ archivematica_src_ss_app }}" + executable: /bin/bash + environment: "{{ archivematica_src_ss_environment }}" register: location_descriptions tags: "configure-am"