Skip to content

Commit

Permalink
Use dbshell
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Angel committed Jun 11, 2021
1 parent d537db5 commit ebfc40f
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit ebfc40f

Please sign in to comment.