Files
ansible-role-chill/tasks/chill/main.yml
Julien Fastré 43a8ccff28 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.
2026-01-27 16:21:34 +01:00

78 lines
2.2 KiB
YAML

- name: Merge defaults with item
ansible.builtin.set_fact:
chill: "{{ default_chill | combine(item, recursive=True) }}"
- name: Create directories to store compose project
ansible.builtin.file:
path: "{{ install_dir }}/{{ chill['chill_environment'] }}"
state: directory
mode: '0755'
owner: "{{ as_user }}"
- name: Add compose.yml file
ansible.builtin.template:
src: compose.yaml
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/compose.yaml"
owner: "{{ as_user }}"
mode: '0444'
- name: Add application environment file
ansible.builtin.template:
src: env_file.env
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/env_file.env"
owner: "{{ as_user }}"
mode: '0400'
- name: Add postgresql environment file if need
ansible.builtin.template:
src: postgres.env
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/postgres.env"
owner: "{{ as_user }}"
mode: '0400'
- name: Add rabbitmq environment file
ansible.builtin.template:
src: rabbitmq.env
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/rabbitmq.env"
owner: "{{ as_user }}"
mode: '0400'
when: chill.rabbitmq_install
- name: Create directory for storing configuration
ansible.builtin.file:
path: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod"
state: directory
owner: "{{ as_user }}"
mode: '0400'
- name: Copy configuration files
ansible.builtin.template:
src: "config/prod/{{ file }}"
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod/{{ file }}"
owner: "{{ as_user }}"
mode: '0444'
loop:
- lexik_jwt_authentication.yaml
- messenger.yaml
- monolog.yaml
- chill_doc_store.yaml
- framework.yaml
loop_control:
loop_var: file
- name: Create directory for storing data
ansible.builtin.file:
path: "{{ doc_storage_dir }}/{{ chill['chill_environment'] }}"
owner: "82"
group: "82"
mode: '0766'
state: directory
# racing condition: on first execution, this is not available...
#
# - name: Ensure systemd timer for cronjob is up
# ansible.builtin.systemd_service:
# name: "chill-cronjob@{{ chill['chill_environment'] }}.timer"
# state: restarted
# enabled: true