Skip to content

Commit

Permalink
Merge pull request #34 from mjanez/dev
Browse files Browse the repository at this point in the history
Improve ckan-pycsw deployment and add new vars
  • Loading branch information
mjanez authored Dec 5, 2024
2 parents d0977ec + 8c846a5 commit bdfc315
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
5 changes: 5 additions & 0 deletions playbook/inventories/development/host_vars/development_01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ deployment_version_name: Development
### Webserver #########################################
proxy_server_name: localhost
proxy_server_url: http://{{ proxy_server_name }}
# WARNING: This variable is for internal use only if using NGINX in the CKAN-Ansible deployment.
# It is not necessary to modify it.
proxy_local_services_url: http://localhost
proxy_ckan_location: /catalog
proxy_pycsw_location: /csw
Expand Down Expand Up @@ -195,6 +197,8 @@ ckanext__spatial__common_map__attribution: "Map tiles by <a href=\"http://openst
ckanext__xloader__jobs_db__uri: "postgresql://{{ ckan_database.ckan_db_user }}:{{ ckan_database.ckan_db_password }}@{{ ckan_database.postgres_host }}:{{ ckan_database.postgres_port }}/{{ ckan_database.ckan_db }}"
#### Enable or disable SSL certificate verification. Setting verify to False should only be enabled during local development or testing.
ckanext__xloader__ssl_verify: True
#### Maximum content length for uploaded files (in bytes). Default 1000000000 (1GB)
ckanext__xloader__max_content_length: 1000000000

#### ckanext-pages
ckanext__pages__organization: True
Expand Down Expand Up @@ -332,6 +336,7 @@ pycsw_output_schema: iso19139_inspire
pycsw_cron_days_interval: 2
pycsw_cron_hour_start: 4
pycsw_app_dir: "{{ ckan_src_dir }}/ckan-pycsw"
pycsw_local_ssl_unverified: false
#### pycsw conf
pycsw_identification_title: Sample Geospatial Catalogue
pycsw_identification_abstract: OGC CSW server powered by pycsw
Expand Down
5 changes: 5 additions & 0 deletions playbook/inventories/production/host_vars/production_01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ deployment_version_name: Production
### Webserver #########################################
proxy_server_name: localhost
proxy_server_url: http://{{ proxy_server_name }}
# WARNING: This variable is for internal use only if using NGINX in the CKAN-Ansible deployment.
# It is not necessary to modify it.
proxy_local_services_url: http://localhost
proxy_ckan_location: /catalog
proxy_pycsw_location: /csw
Expand Down Expand Up @@ -194,6 +196,8 @@ ckanext__spatial__common_map__attribution: "Map tiles by <a href=\"http://openst
ckanext__xloader__jobs_db__uri: "postgresql://{{ ckan_database.ckan_db_user }}:{{ ckan_database.ckan_db_password }}@{{ ckan_database.postgres_host }}:{{ ckan_database.postgres_port }}/{{ ckan_database.ckan_db }}"
#### Enable or disable SSL certificate verification. Setting verify to False should only be enabled during local development or testing.
ckanext__xloader__ssl_verify: True
#### Maximum content length for uploaded files (in bytes). Default 1000000000 (1GB)
ckanext__xloader__max_content_length: 1000000000

#### ckanext-pages
ckanext__pages__organization: True
Expand Down Expand Up @@ -331,6 +335,7 @@ pycsw_output_schema: iso19139_inspire
pycsw_cron_days_interval: 2
pycsw_cron_hour_start: 4
pycsw_app_dir: "{{ ckan_src_dir }}/ckan-pycsw"
pycsw_local_ssl_unverified: false
#### pycsw conf
pycsw_identification_title: Sample Geospatial Catalogue
pycsw_identification_abstract: OGC CSW server powered by pycsw
Expand Down
5 changes: 5 additions & 0 deletions playbook/inventories/staging/host_vars/staging_01.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ deployment_version_name: Staging
### Webserver #########################################
proxy_server_name: localhost
proxy_server_url: http://{{ proxy_server_name }}
# WARNING: This variable is for internal use only if using NGINX in the CKAN-Ansible deployment.
# It is not necessary to modify it.
proxy_local_services_url: http://localhost
proxy_ckan_location: /catalog
proxy_pycsw_location: /csw
Expand Down Expand Up @@ -194,6 +196,8 @@ ckanext__spatial__common_map__attribution: "Map tiles by <a href=\"http://openst
ckanext__xloader__jobs_db__uri: "postgresql://{{ ckan_database.ckan_db_user }}:{{ ckan_database.ckan_db_password }}@{{ ckan_database.postgres_host }}:{{ ckan_database.postgres_port }}/{{ ckan_database.ckan_db }}"
#### Enable or disable SSL certificate verification. Setting verify to False should only be enabled during local development or testing.
ckanext__xloader__ssl_verify: True
#### Maximum content length for uploaded files (in bytes). Default 1000000000 (1GB)
ckanext__xloader__max_content_length: 1000000000

#### ckanext-pages
ckanext__pages__organization: True
Expand Down Expand Up @@ -331,6 +335,7 @@ pycsw_output_schema: iso19139_inspire
pycsw_cron_days_interval: 2
pycsw_cron_hour_start: 4
pycsw_app_dir: "{{ ckan_src_dir }}/ckan-pycsw"
pycsw_local_ssl_unverified: false
#### pycsw conf
pycsw_identification_title: Sample Geospatial Catalogue
pycsw_identification_abstract: OGC CSW server powered by pycsw
Expand Down
3 changes: 2 additions & 1 deletion playbook/roles/ckan/templates/ckan.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ ckanext.geoview.geojson.max_file_size = {{ ckanext__geoview__geojson__max_file_s

### ckanext-xloader
ckanext.xloader.api_token = xloader_api_token
ckanext.xloader.jobs_db.uri={{ ckanext__xloader__jobs_db__uri }}
ckanext.xloader.jobs_db.uri = {{ ckanext__xloader__jobs_db__uri }}
ckanext.xloader.ssl_verify = {{ ckanext__xloader__ssl_verify }}
ckanext.xloader.max_content_length = {{ ckanext__xloader__max_content_length }}

### ckanext-pages
ckan.pages.allow_html = False
Expand Down
25 changes: 1 addition & 24 deletions playbook/roles/ckan_pycsw/tasks/ckan_pycsw_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,14 @@
path: "{{ pycsw_app_dir }}/.git"
register: repo

- name: Get current ckan-pycsw version
become: true
become_user: "{{ ckan_user }}"
shell: "git -C {{ pycsw_app_dir }} describe --tags"
register: current_version
when: repo.stat.exists

- name: Pull ckan-pycsw:{{ ckan_pycsw_version }} from GitHub
become: true
become_user: "{{ ckan_user }}"
git:
repo: https://github.com/mjanez/ckan-pycsw
dest: "{{ pycsw_app_dir }}"
version: "{{ ckan_pycsw_version }}"
when: not repo.stat.exists or (repo.stat.exists and ckan_pycsw_version is version(current_version.stdout, 'gt'))

- name: Confirm update
pause:
prompt: "Do you want to update ckan-pycsw to version {{ ckan_pycsw_version }}? (y/n)"
echo: yes
register: confirm_update
when: repo.stat.exists and ckan_pycsw_version is version(current_version.stdout, 'gt')

- name: "Update ckan-pycsw to version: {{ ckan_pycsw_version }}"
become: true
become_user: "{{ ckan_user }}"
git:
repo: https://github.com/mjanez/ckan-pycsw
dest: "{{ pycsw_app_dir }}"
version: "{{ ckan_pycsw_version }}"
when: confirm_update is defined and confirm_update.user_input is defined and confirm_update.user_input | lower == 'y'
force: yes

- name: Install PDM
shell: curl -sSL https://pdm-project.org/install-pdm.py | python3 -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ environment=
APP_DIR={{ pycsw_app_dir }},
PYCSW_CKAN_SCHEMA={{ pycsw_ckan_schema }},
PYCSW_OUPUT_SCHEMA={{ pycsw_output_schema}},
SSL_UNVERIFIED_MODE={{ pycsw_local_ssl_unverified }},
user={{ ckan_user }}
numprocs=1
stdout_logfile={{ ckan_log_dir }}/ckan_pycsw.log
Expand Down

0 comments on commit bdfc315

Please sign in to comment.