---
- name: ๐ Find the stamp of the last OpenProject provisioning
ansible.builtin.stat:
path: "{{ NEXTCLOUD_OPENPROJECT_STAMP_FILE }}"
register: nextcloud_op_stamp_file
- name: ๐ Read the stamp of the last OpenProject provisioning
ansible.builtin.slurp:
src: "{{ NEXTCLOUD_OPENPROJECT_STAMP_FILE }}"
register: nextcloud_op_stamp
when: nextcloud_op_stamp_file.stat.exists
- name: ๐งฎ Decide whether the OpenProject coupling needs a provisioning run
set_fact:
nextcloud_op_provision_due: >-
{{ (lookup('config', 'web-app-nextcloud', 'addons.integration_openproject.config.rotate_oauth_client') | bool)
or nextcloud_op_stamp is skipped
or (nextcloud_op_stamp.content | b64decode | trim) != nextcloud_op_digest }}
- name: ๐ง Provision the OpenProject coupling and stamp the state it leaves
when: nextcloud_op_provision_due | bool
block:
- name: ๐ง Converge the bidirectional OpenProject <-> Nextcloud OAuth coupling
include_tasks: integration_openproject_provision.yml
- name: ๐ Read the OpenProject coupling state the provisioning left
include_tasks: integration_openproject_state.yml
- name: ๐ Stamp the OpenProject coupling state the provisioning left
stack_host_copy:
content: "{{ nextcloud_op_digest }}\n"
dest: "{{ NEXTCLOUD_OPENPROJECT_STAMP_FILE }}"
mode: "0600"