Adding Twenty CRM

This commit is contained in:
Ian Roddis
2026-05-02 09:03:08 -03:00
parent c32d528518
commit f282cacf27
10 changed files with 248 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
---
- name: Verify twenty role
hosts: localhost
gather_facts: false
vars:
twenty_data_dir: /tmp/sovereign_test/twenty
twenty_domain: crm.test.example.com
twenty_version: latest
twenty_app_secret: test_twenty_app_secret
twenty_db_password: test_twenty_db
tasks:
- name: Check twenty data directory exists
ansible.builtin.stat:
path: "/tmp/sovereign_test/twenty"
register: data_dir_stat
- name: Assert twenty data directory is present
ansible.builtin.assert:
that: data_dir_stat.stat.isdir
fail_msg: "Data directory /tmp/sovereign_test/twenty was not created"
- name: Check docker-compose.yml exists
ansible.builtin.stat:
path: "/tmp/sovereign_test/twenty/docker-compose.yml"
register: compose_stat
- name: Assert docker-compose.yml was rendered
ansible.builtin.assert:
that: compose_stat.stat.exists
fail_msg: "docker-compose.yml was not rendered for twenty"
- name: Read docker-compose.yml
ansible.builtin.slurp:
src: "/tmp/sovereign_test/twenty/docker-compose.yml"
register: compose_raw
- name: Set compose content fact
ansible.builtin.set_fact:
compose: "{{ compose_raw.content | b64decode }}"
- name: Assert twenty server image is present
ansible.builtin.assert:
that: "'twentycrm/twenty' in compose"
fail_msg: "twentycrm/twenty image not found in docker-compose.yml"
- name: Assert twenty domain traefik rule is present
ansible.builtin.assert:
that: "'Host(`crm.test.example.com`)' in compose"
fail_msg: "Traefik rule for crm.test.example.com not found in docker-compose.yml"
- name: Assert app secret is present in compose
ansible.builtin.assert:
that: "'test_twenty_app_secret' in compose"
fail_msg: "twenty_app_secret not found in docker-compose.yml"
- name: Assert GELF logging address is present
ansible.builtin.assert:
that: "'udp://127.0.0.1:12201' in compose"
fail_msg: "GELF logging address udp://127.0.0.1:12201 not found in docker-compose.yml"
- name: Assert sovereign network is external
ansible.builtin.assert:
that: "'external: true' in compose"
fail_msg: "external: true not found in docker-compose.yml networks section"
- name: Assert worker service is present
ansible.builtin.assert:
that: "'twenty-worker' in compose"
fail_msg: "twenty-worker service not found in docker-compose.yml"
- name: Assert Redis service is present
ansible.builtin.assert:
that: "'twenty-redis' in compose"
fail_msg: "twenty-redis service not found in docker-compose.yml"