Skip to content

Commit

Permalink
Configure replicators for each configured AIPstore
Browse files Browse the repository at this point in the history
  • Loading branch information
scollazo committed Nov 13, 2024
1 parent e7198e9 commit 0885992
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ archivematica_src_syslog_mcpserver_level: "DEBUG"
# Configure SS locations
#
#am_ss_default_locations:
# - { location_purpose: "RP", location_path: "/replicator", location_description: "Replicator location", location_default: "false" }
# - { location_purpose: "RP", location_path: "/replicator", location_description: "Replicator location", location_default: "false", location_replication_from: "AipStore" }
# - { location_purpose: "AS", location_path: "/aipstore", location_description: "AipStore", location_default: "true" }
# - { location_purpose: "TS", location_path: "/transfer-source/", location_description: "Transfer Source", location_default: "false" }

Expand Down
16 changes: 16 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,20 @@
when: not location_descriptions.stdout | join('') | regex_search( '(^|\n)'+item.location_description+'(\n|$)' )
with_items: "{{ am_ss_default_locations }}"
tags: "configure-am"

- name: "Configure SS: configure replication locations "
mysql_query:
login_db: "{{ archivematica_src_ss_db_name }}"
login_user: "{{ archivematica_src_ss_db_user }}"
login_password: "{{ archivematica_src_ss_db_password }}"
login_host: "{{ archivematica_src_ss_db_host }}"
query:
- INSERT IGNORE INTO locations_location_replicators(from_location_id,to_location_id) VALUES ((SELECT id FROM locations_location where description = %(aipstore)s and purpose = "AS"),(SELECT id FROM locations_location where description = %(replica)s and purpose = "RP" ));
named_args:
aipstore: "{{ item.location_replication_from }}"
replica: "{{ item.location_description }}"
when:
- item.location_replication_from is defined
with_items:
- "{{ am_ss_default_locations }}"
when: am_ss_default_locations is defined

0 comments on commit 0885992

Please sign in to comment.