Make RabbitMQ integration optional in Chill configuration
Introduced a new `rabbitmq_install` variable to conditionally enable RabbitMQ components in `compose.yaml`, `messenger.yaml`, and `env_file.env`. Updated related Ansible tasks to respect this variable.
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/rabbitmq.env"
|
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/rabbitmq.env"
|
||||||
owner: "{{ as_user }}"
|
owner: "{{ as_user }}"
|
||||||
mode: '0400'
|
mode: '0400'
|
||||||
|
when: chill.rabbitmq_install
|
||||||
|
|
||||||
- name: Create directory for storing configuration
|
- name: Create directory for storing configuration
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ services:
|
|||||||
links:
|
links:
|
||||||
- redis
|
- redis
|
||||||
- relatorio
|
- relatorio
|
||||||
|
{% if chill.rabbitmq_install +%}
|
||||||
- rabbitmq
|
- rabbitmq
|
||||||
|
{%+ endif %}
|
||||||
|
|
||||||
{% if chill.add_postgres -%}
|
{% if chill.add_postgres -%}
|
||||||
- database
|
- database
|
||||||
@@ -137,6 +139,7 @@ services:
|
|||||||
# rabbitmq:
|
# rabbitmq:
|
||||||
# condition: service_healthy
|
# condition: service_healthy
|
||||||
|
|
||||||
|
{% if chill.rabbitmq_install +%}
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
image: "{{ chill_image_rabbitmq }}"
|
image: "{{ chill_image_rabbitmq }}"
|
||||||
env_file:
|
env_file:
|
||||||
@@ -149,6 +152,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
restart: always
|
restart: always
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
framework:
|
framework:
|
||||||
messenger:
|
messenger:
|
||||||
transports:
|
transports:
|
||||||
|
{% if chill.rabbitmq_install +%}
|
||||||
async:
|
async:
|
||||||
dsn: '%env(RABBITMQ_URL)%/async'
|
dsn: '%env(RABBITMQ_URL)%/async'
|
||||||
options:
|
options:
|
||||||
@@ -12,5 +13,9 @@ framework:
|
|||||||
async: ~
|
async: ~
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
priority: '%env(RABBITMQ_URL)%/priority'
|
priority: '%env(RABBITMQ_URL)%/priority'
|
||||||
|
{% else +%}
|
||||||
|
async: 'doctrine://default'
|
||||||
|
priority: 'doctrine://default'
|
||||||
|
{% endif +%}
|
||||||
failed: 'doctrine://default?queue_name=failed'
|
failed: 'doctrine://default?queue_name=failed'
|
||||||
sync: 'sync://'
|
sync: 'sync://'
|
||||||
@@ -41,7 +41,9 @@ MAILER_URL={{ chill.chill_config.mailer_url }}
|
|||||||
JWT_PASSPHRASE={{ chill.chill_config.jwt_passphrase }}
|
JWT_PASSPHRASE={{ chill.chill_config.jwt_passphrase }}
|
||||||
JWT_SECRET_KEY={{ chill.chill_config.jwt_secret_key }}
|
JWT_SECRET_KEY={{ chill.chill_config.jwt_secret_key }}
|
||||||
JWT_PUBLIC_KEY={{ chill.chill_config.jwt_public_key }}
|
JWT_PUBLIC_KEY={{ chill.chill_config.jwt_public_key }}
|
||||||
|
{% if chill.rabbitmq_install %}
|
||||||
RABBITMQ_URL=amqp://{{ chill.chill_config.rabbitmq_user }}:{{ chill.chill_config.rabbitmq_password }}@rabbitmq/%2f
|
RABBITMQ_URL=amqp://{{ chill.chill_config.rabbitmq_user }}:{{ chill.chill_config.rabbitmq_password }}@rabbitmq/%2f
|
||||||
|
{% endif %}
|
||||||
DATABASE_URL=postgres://{{ chill.chill_config.database_user }}:{{ chill.chill_config.database_password }}@{% if chill.add_postgres %}database:5432{% else %}{{ chill.chill_config.database_host }}{% endif %}/{{ chill.chill_config.database_name }}?sslmode=prefer&charset=utf8&serverVersion={{ chill.chill_config.database_version }}
|
DATABASE_URL=postgres://{{ chill.chill_config.database_user }}:{{ chill.chill_config.database_password }}@{% if chill.add_postgres %}database:5432{% else %}{{ chill.chill_config.database_host }}{% endif %}/{{ chill.chill_config.database_name }}?sslmode=prefer&charset=utf8&serverVersion={{ chill.chill_config.database_version }}
|
||||||
EDITOR_SERVER={{ chill.chill_config.editor_server }}
|
EDITOR_SERVER={{ chill.chill_config.editor_server }}
|
||||||
OVHCLOUD_DSN={{ chill.chill_config.ovhcloud_dsn }}
|
OVHCLOUD_DSN={{ chill.chill_config.ovhcloud_dsn }}
|
||||||
|
|||||||
Reference in New Issue
Block a user