-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR will use the features added by the following PRs: -artefactual/archivematica#681 -artefactual/archivematica-storage-service#213 Specifically, this PR allows to: a) Create a SS superuser b) Create a dashboard admin user and register the pipeline on the SS. To configure SS and pipeline on a deployment, the following boolean extra-vars have to be enabled: - archivematica_src_configure_dashboard: To create the dashboard admin user and to register pipeline on SS - archivematica_src_configure_ss: To create SS superuser They are disabled by default.
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ archivematica_src_install_acceptance_tests: "no" | |
archivematica_src_install_fixity: "no" | ||
archivematica_src_search_enabled: "yes" | ||
|
||
#Components to configure | ||
archivematica_src_configure_dashboard: "no" | ||
archivematica_src_configure_ss: "no" | ||
|
||
# Define the type of environment: "production" or "development". The latter will deploy some extra stuff to make the development workflow easier. | ||
archivematica_src_environment_type: "production" | ||
|
||
|
@@ -122,3 +126,16 @@ archivematica_src_fixity_version: "master" | |
archivematica_src_fixity_ss_url: "http://localhost:8000" | ||
archivematica_src_fixity_ss_user: "test" | ||
archivematica_src_fixity_ss_apikey: "XXXX" | ||
|
||
# Configure AM | ||
# archivematica_src_configure_am_api_key & archivematica_src_configure_ss_api_key can be defined as vars. If not defined they will be autogenerated by the playbook | ||
archivematica_src_configure_ss_user: "test" # SS superuser | ||
archivematica_src_configure_ss_password: "PleaseChangeMe!" # SS superuser password | ||
archivematica_src_configure_ss_email: "[email protected]" # SS superuser email address | ||
archivematica_src_configure_ss_url: "http://localhost:8000" # SS url to register the pipeline | ||
archivematica_src_configure_am_user: "test" # Dashboard admin | ||
archivematica_src_configure_am_password: "PleaseChangeMe!" # Dashboard admin password | ||
archivematica_src_configure_am_email: "[email protected]" # Dashboard admin password | ||
archivematica_src_configure_am_org_name: "test org" # Dashboard admin Org name | ||
archivematica_src_configure_am_org_id: "test id" # Dashboard admin Org id | ||
archivematica_src_configure_am_whitelist: '""' # Dashboard API whitelist, IP address or hostnames separated by blank spaces and inside quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# ss-configure | ||
|
||
# Create api-key if not defined | ||
- set_fact: archivematica_src_configure_ss_api_key={{ 999999999999999999999 | random | to_uuid | hash('md5') }} | ||
when: "archivematica_src_configure_ss_api_key is undefined and archivematica_src_configure_ss|bool" | ||
|
||
# Delete default SS superuser test | ||
- name: "Delete default SS superuser" | ||
become: "yes" | ||
shell: echo "from django.contrib.auth.models import User;User.objects.get(username='test').delete()" | {{ archivematica_src_ss_virtualenv }}/bin/python manage.py shell | ||
args: | ||
chdir: "{{ archviematica_src_ss_app }}" | ||
executable: /bin/bash | ||
environment: "{{ archivematica_src_ss_environment }}" | ||
when: "archivematica_src_configure_ss|bool" | ||
|
||
- name: "Create SS superuser" | ||
django_manage: | ||
command: > | ||
create_user | ||
--username="{{ archivematica_src_configure_ss_user }}" | ||
--password="{{ archivematica_src_configure_ss_password }}" | ||
--email="{{ archivematica_src_configure_ss_email }}" | ||
--api-key="{{ archivematica_src_configure_ss_api_key }}" | ||
--superuser | ||
app_path: "{{ archviematica_src_ss_app }}" | ||
virtualenv: "{{ archivematica_src_ss_virtualenv }}" | ||
environment: "{{ archivematica_src_ss_environment }}" | ||
when: "archivematica_src_configure_ss|bool" | ||
|
||
# dashboard-configure | ||
|
||
# Create api-key if not defined | ||
- set_fact: archivematica_src_configure_am_api_key={{ 999999999999999999998 | random | to_uuid | hash('md5') }} | ||
when: archivematica_src_configure_am_api_key is undefined | ||
|
||
- name: "Create Dashboard user and register pipeline on SS" | ||
django_manage: | ||
command: > | ||
install --username="{{ archivematica_src_configure_am_user }}" | ||
--password="{{ archivematica_src_configure_am_password }}" | ||
--email="{{ archivematica_src_configure_am_email }}" | ||
--org-name="{{ archivematica_src_configure_am_org_name }}" | ||
--org-id="{{ archivematica_src_configure_am_org_id }}" | ||
--api-key="{{ archivematica_src_configure_am_api_key }}" | ||
--ss-url="{{ archivematica_src_configure_ss_url }}" | ||
--ss-user="{{ archivematica_src_configure_ss_user }}" | ||
--ss-api-key="{{ archivematica_src_configure_ss_api_key }}" | ||
--whitelist="{{archivematica_src_configure_am_whitelist}}" | ||
app_path: "{{ archivematica_src_am_dashboard_app }}" | ||
pythonpath: "{{ archivematica_src_am_common_app }}" | ||
virtualenv: "{{ archivematica_src_am_dashboard_virtualenv }}" | ||
when: "archivematica_src_configure_dashboard|bool" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters