Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Add support for Redis configuration #98

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions roles/artemis/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@ hazelcast_address: "{% if is_multinode_install is defined and is_multinode_insta
artemis_eureka_urls: "{% if registry.url is defined and registry.url is not none %}http://admin:${jhipster.registry.password}@{{ registry.url }}:8761/eureka/{% endif %}"
artemis_eureka_instance_id: "{{ node_id }}"

#redis:
# host:
# port:
# username:
# password:

##############################################################################
# Iris Configuration
##############################################################################
Expand Down
21 changes: 6 additions & 15 deletions roles/artemis/tasks/docker_deploy_artemis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,14 @@
- name: Create artemis data directory
become: true
file:
path: "{{ artemis_working_directory }}/data"
state: directory
mode: '0770'

- name: Create artemis database directory
become: true
file:
path: "{{ artemis_working_directory }}/data/database"
state: directory
mode: '0770'

- name: Create artemis data/artemis directory
become: true
file:
path: "{{ artemis_working_directory }}/data/artemis"
path: "{{ artemis_working_directory }}/{{ item }}"
state: directory
mode: '0770'
loop:
- "data"
- "data/database"
- "data/artemis"
- "data/redis"

- name: Set permissions for artemis directory
become: true
Expand Down
10 changes: 10 additions & 0 deletions roles/artemis/templates/application-prod.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ spring:
addresses: "{{ broker.url }}:61613"
{% endif %}
{% endif %}

{% if redis is defined and redis is not none %}
data:
redis:
host: {{ redis.host }}
port: {{ redis.port}}
username: {{ redis.username}}
password: {{ redis.password }}
{% endif %}

{% if is_multinode_install and hazelcast_address is defined %}
hazelcast:
interface: "{{ hazelcast_address }}"
Expand Down
9 changes: 9 additions & 0 deletions roles/artemis/templates/artemis.env.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SPRING_PROFILES_ACTIVE: '{{ artemis_spring_profiles }}'
_JAVA_OPTIONS: '-Xmx3g -Xms1g'

{% if artemis_computed_is_core_node %}
SPRING_DATASOURCE_TYPE='com.zaxxer.hikari.HikariDataSource'
SPRING_DATASOURCE_URL='jdbc:{{ artemis_database_type }}://{{ artemis_database_host }}:{{ artemis_database_port }}/{{ artemis_database_dbname }}?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC'
SPRING_DATASOURCE_USERNAME='{{ artemis_database_username }}'
Expand All @@ -22,6 +23,14 @@ SPRING_WEBSOCKET_BROKER_USERNAME='{{ broker.username }}'
SPRING_WEBSOCKET_BROKER_PASSWORD='{{ broker.password }}'
SPRING_WEBSOCKET_BROKER_ADDRESSES='{{ broker.url }}:61613'
{% endif %}
{% endif %}

{% if redis is defined and redis is not none %}
SPRING_DATA_REDIS_HOST='{{ redis.host }}'
SPRING_DATA_REDIS_PORT='{{ redis.port}}'
SPRING_DATA_REDIS_USERNAME='{{ redis.username}}'
SPRING_DATA_REDIS_PASSWORD='{{ redis.password }}'
{% endif %}
{% if is_multinode_install and hazelcast_address is defined %}
SPRING_HAZELCAST_INTERFACE='{{ hazelcast_address }}'
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions roles/artemis/templates/docker.env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ARTEMIS_DATA_EXPORT_MOUNT='{{ artemis_working_directory }}/data-exports'
DATABASE_ENV_FILE='{{ artemis_working_directory }}/database.env'
DATABASE_VOLUME_MOUNT='{{ artemis_working_directory }}/data/database'

REDIS_DATA_VOLUME='{{ artemis_working_directory }}/data/redis'
REDIS_PASSWORD='{{ redis.password }}'

# Broker & Registry vars
{% if is_multinode_install %}
REGISTRY_PASSWORD='{{ artemis_jhipster_registry_password }}'
Expand Down
Loading