mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-07 19:32:17 +00:00
26 lines
1.2 KiB
YAML
26 lines
1.2 KiB
YAML
---
|
|
# include-gated: when: stalwart_cert_missing | bool
|
|
- name: "🔧 Register the platform TLS certificate with Stalwart"
|
|
include_tasks: "{{ role_path }}/tasks/jmap_call.yml"
|
|
vars:
|
|
stalwart_jmap_body: >-
|
|
{{ {'using': ['urn:ietf:params:jmap:core', 'urn:stalwart:jmap'],
|
|
'methodCalls': [['x:Certificate/set', {'create': {'c': {
|
|
'certificate': {'@type': 'File', 'filePath': '/etc/stalwart/certs/cert.pem'},
|
|
'privateKey': {'@type': 'File', 'filePath': '/etc/stalwart/certs/key.pem'}
|
|
}}}, 'c0']]} | to_json }}
|
|
|
|
- name: "🔄 Restart Stalwart to activate the registered certificate (compose)"
|
|
ansible.builtin.command: "container restart {{ STALWART_CONTAINER }}"
|
|
changed_when: true
|
|
when: DEPLOYMENT_MODE == 'compose'
|
|
|
|
- name: "🔄 Restart Stalwart to activate the registered certificate (swarm)"
|
|
ansible.builtin.command: "container service update --force {{ lookup('container_service', application_id, 'stalwart') }}"
|
|
changed_when: true
|
|
timeout: "{{ lookup('timeout', 600) | int }}"
|
|
when: DEPLOYMENT_MODE == 'swarm'
|
|
|
|
- name: "⏳ Wait for Stalwart API after the certificate restart"
|
|
include_tasks: "{{ role_path }}/tasks/01_wait_for_api.yml"
|