From 37d4e70d406fbcfb6150e1943b54f3dd64f16011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P=2E?= Date: Tue, 24 Mar 2026 19:14:36 +0100 Subject: [PATCH] Add role to deploy GKS IIIF manifests --- roles/iiif-manif/defaults/main.yml | 1 + roles/iiif-manif/handlers/main.yml | 5 ++++ roles/iiif-manif/tasks/main.yml | 38 ++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 roles/iiif-manif/defaults/main.yml create mode 100644 roles/iiif-manif/handlers/main.yml create mode 100644 roles/iiif-manif/tasks/main.yml diff --git a/roles/iiif-manif/defaults/main.yml b/roles/iiif-manif/defaults/main.yml new file mode 100644 index 0000000..a322d3f --- /dev/null +++ b/roles/iiif-manif/defaults/main.yml @@ -0,0 +1 @@ +iiif_repo_url: "https://git.electricmandarine.cloud/nicolo/greek-manifests" diff --git a/roles/iiif-manif/handlers/main.yml b/roles/iiif-manif/handlers/main.yml new file mode 100644 index 0000000..11f648b --- /dev/null +++ b/roles/iiif-manif/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: Restart PM2 + ansible.builtin.command: '/home/nicolo/node_modules/bin/pm2 restart all --update-env' + become: true + become_user: nicolo diff --git a/roles/iiif-manif/tasks/main.yml b/roles/iiif-manif/tasks/main.yml new file mode 100644 index 0000000..801e02f --- /dev/null +++ b/roles/iiif-manif/tasks/main.yml @@ -0,0 +1,38 @@ +--- +- name: Ensure ACL is installed + ansible.builtin.package: + name: + - acl + state: present + update_cache: yes + when: ansible_os_family == 'RedHat' + +- name: Ensure git is installed + ansible.builtin.package: + name: + - git + state: present + update_cache: yes + +- name: Pull from manifest repo + ansible.builtin.git: + repo: "{{ iiif_repo_url }}" + # To be changed!! + dest: /home/nicolo/greek-manifests + update: true + clone: false + version: master + become: true + become_user: nicolo + +- name: Install Yarn dependencies based on package.json + community.general.yarn: + # To be changed!! + path: /home/nicolo/greek-manifests + executable: /home/nicolo/node_modules/bin/yarn + production: true + become: true + become_user: nicolo + # this should alwasy notify 'Restart PM2' + changed_when: true + notify: Restart PM2