Files
ansible-role-chill/tasks/chill/main.yml
T
julienfastreandClaude Sonnet 5.5 c699983b80 Add optional mount of template overrides and use chill in env templates
- add `load_template_override` (default false) to `default_chill`: controls
  the creation and the mount of the `templates` directory
- use `chill.chill_config` instead of `item.chill_config` in env_file.env,
  rabbitmq.env and postgres.env

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VnXP3D1srf5k8MrtPFUz93
2026-11-18 15:25:34 +01:00

84 lines
2.4 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: "82"
mode: '0500'
- name: Create directory for template overrides (mounted in the app container)
ansible.builtin.file:
path: "{{ install_dir }}/{{ chill['chill_environment'] }}/templates"
state: directory
mode: '0755'
owner: "{{ as_user }}"
when: chill.load_template_override
- name: Copy configuration files
ansible.builtin.template:
src: "config/prod/{{ file }}"
dest: "{{ install_dir }}/{{ chill['chill_environment'] }}/config/prod/{{ file }}"
owner: "82"
mode: '0400'
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'] }}"
mode: '0777'
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