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