Skip to content

Commit d89d11c

Browse files
authored
Fix tags and ensure processes cleanup (#46)
2 parents 8cdee08 + 0874a2b commit d89d11c

File tree

17 files changed

+43
-44
lines changed

17 files changed

+43
-44
lines changed

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@
22

33
All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5-
## Unreleased
5+
## Unreleased [patch]
6+
7+
_Full changeset and discussions: [#46](https://github.com/OpenTermsArchive/deployment/pull/46)._
8+
9+
> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs.
10+
11+
### Fixed
12+
13+
- Ensure configuration changes are taken into account on restart
14+
- Make refined playbook execution work with the `start`, `stop` and `restart` tags
615

716
## 2.0.1 - 2024-06-04
817

18+
_Full changeset and discussions: [#45](https://github.com/OpenTermsArchive/deployment/pull/45)._
19+
20+
> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs.
21+
922
### Fixed
1023

1124
- Set up the Git-based databases at the proper locations

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ all:
8282
ota_directory: demo
8383
```
8484
85+
#### Changes on a existing deployment
86+
87+
If the `ota_source_repository` is changed on an existing target, the application has to be [stopped](#playbook-execution-refinement) before the new configuration is deployed.
88+
8589
- ### PM2 Configuration File — `pm2.config.cjs`
8690

8791
**This file is mandatory**

playbooks/deploy.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
- name: Deploy Open Terms Archive applications
33
hosts: all
44
tasks:
5+
- name: Install common required packages
6+
ansible.builtin.include_role:
7+
name: common
8+
apply:
9+
become: true
10+
11+
- name: Setup GitHub bot SSH key
12+
ansible.builtin.include_role:
13+
name: github
14+
515
- name: Load OTA applications configs
616
tags: [always]
717
ansible.builtin.include_role:
@@ -98,9 +108,10 @@
98108
ansible.builtin.include_role:
99109
name: ota/apps
100110

101-
- name: Start OTA applications
111+
- name: Manage OTA applications processes
102112
ansible.builtin.include_role:
103113
name: pm2/manage
114+
tags: [stop, start, restart]
104115

105116
- name: Configure NGINX
106117
ansible.builtin.include_role:

roles/chromium/meta/main.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

roles/chromium/tasks/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
22
- name: Install Chromium — Debian
3+
when: ansible_distribution == 'Debian'
34
ansible.builtin.apt:
45
pkg:
56
- chromium
67
update_cache: true
78
state: latest
8-
when: ansible_distribution == 'Debian'
99

1010
- name: Install Chromium — Ubuntu
11+
when: ansible_distribution == 'Ubuntu'
1112
ansible.builtin.apt:
1213
pkg:
1314
- chromium-browser
1415
update_cache: true
1516
state: latest
16-
when: ansible_distribution == 'Ubuntu'
1717

1818
# See https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#recommended-enable-user-namespace-cloning
1919
- name: Enable user namespace cloning to allow running Chromium in a sandbox
20-
ansible.builtin.command: sysctl -w kernel.unprivileged_userns_clone=1
2120
when: ansible_facts['architecture'] != 'aarch64'
21+
ansible.builtin.command: sysctl -w kernel.unprivileged_userns_clone=1

roles/github/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
delegate_to: localhost
77

88
- name: Add GitHub Bot SSH key
9+
when: github_bot_private_key_file.stat.exists
910
ansible.builtin.copy:
1011
src: "{{ inventory_dir }}/github-bot-private-key"
1112
dest: /home/{{ ansible_user }}/.ssh/ota-github-bot-key
1213
owner: "{{ ansible_user }}"
1314
group: "{{ ansible_user }}"
1415
mode: "600"
15-
when: github_bot_private_key_file.stat.exists
1616

1717
- name: Add GitHub SSH key to known_hosts
1818
ansible.builtin.known_hosts:

roles/mongo/configure/meta/main.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

roles/mongo/install/meta/main.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

roles/nginx/configure/meta/main.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

roles/nginx/install/meta/main.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)