Skip to content

Commit

Permalink
update Redis configuration server to accept url (local or external) a…
Browse files Browse the repository at this point in the history
…nd allow in non protected mode
  • Loading branch information
khaledk2 committed Mar 14, 2024
1 parent c3462c8 commit c6abfa4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ omero_ms_image_region_download_URL: 'https://github.com/khaledk2/ice-archh-64/re
omero_ms_image_region_ms_sha256: f984bb78fa81d4fa603387df919d383485944a15a6a762f5c136cf35aefafeaa

omero_ms_image_region_ms_name: "{{ omero_ms_image_region_download_URL | basename }}"

omero_ms_image_region_ms_redis_url: 'localhost'
omero_ms_image_region_ms_redis_port: '6379'
omero_ms_image_region_ms_redis_username: ''
omero_ms_image_region_ms_redis_user_pass: ''
13 changes: 13 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@
- stat_ssh256.stat.checksum is undefined or omero_ms_image_region_ms_sha256 != stat_ssh256.stat.checksum
- not stat_result.stat.exists

- name: omero-ms-image-region | set redis url in protected mode
ansible.builtin.set_fact:
omero_ms_image_region_ms_redis_uri:
"redis://:@'{{ omero_ms_image_region_ms_redis_url }}':omero_ms_image_region_ms_redis_port/0"
when: omero_ms_image_region_ms_redis_username and omero_ms_image_region_ms_redis_user_pass

- name: omero-ms-image-region | set redis uri in not protected mode
ansible.builtin.set_fact:
omero_ms_image_region_ms_redis_uri:
"redis://'{{ omero_ms_image_region_ms_redis_username }}':'{{ omero_ms_image_region_ms_redis_user_pass }}'@'{{ omero_ms_image_region_ms_redis_url }}':omero_ms_image_region_ms_redis_port/0"
when: not omero_ms_image_region_ms_redis_username and not omero_ms_image_region_ms_redis_user_pass


- name: omero-ms-image-region | copy config file
become: true
become_user: "{{ omero_ms_image_region_user }}"
Expand Down
15 changes: 6 additions & 9 deletions templates/config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ omero:
omero.server:
omero.data.dir: "{{ omero_data_dir }}"
omero.db.host: "{{ omero_ms_image_region_db_url }}"
omero.db.name: "{{ omero_ms_image_region_db_name }}"
omero.db.port: "{{ omero_ms_image_region_db_port }}"
omero.db.user: "{{ omero_ms_image_region_db_username }}"
omero.db.pass: "{{ omero_ms_image_region_db_pass }}"
omero.db.name: "{{ db_name }}"
omero.db.port: "{{ db_port }}"
omero.db.user: "{{ db_user_name }}"
omero.db.pass: "{{ db_pass }}"
# OMERO_HOME/lib/scripts
omero.script_repo_root: "{{ omero_script_repo_root }}"
omero.pixeldata.max_tile_length: "2048"
Expand All @@ -38,7 +38,7 @@ omero.web:


# Size of the worker pool (defaults to CPUs x 2)
omero_ms_image_region_ms_worker_pool_size: {{ omero_ms_image_region_ms_worker_pool_size }}
worker_pool_size: {{ worker_pool_size }}
#
# Configuration for zipkin http tracing
http-tracing:
Expand All @@ -63,10 +63,7 @@ session-store:
# * https://jdbc.postgresql.org/documentation/80/connect.html
# * https://github.com/lettuce-io/lettuce-core/wiki/Redis-URI-and-connection-details
# uri: "jdbc:postgresql://localhost:5432/omero_database?user=omero&password=omero"
# For Redis in protected mode
uri: "redis://:@localhost:6379/0"
# For Redis in non-protected mode
# uri: "redis://:password@localhost:6379/0"
uri: "{{ omero_ms_image_region_ms_redis_uri }}"

redis-cache:
#uri: "redis://cf33da71-d81f-42e3-9932-71c82d52de32@localhost:6379/1"
Expand Down

0 comments on commit c6abfa4

Please sign in to comment.