Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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).

## Unreleased [minor]

> 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.

### Added

- Enable PM2 to automatically restart Open Terms Archive applications after a reboot

## 2.0.2 - 2024-06-12

_Full changeset and discussions: [#46](https://github.com/OpenTermsArchive/deployment/pull/46)._
Expand Down
16 changes: 16 additions & 0 deletions roles/pm2/manage/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
- restart
- start

- name: Generate and enable PM2 startup script
ansible.builtin.command:
cmd: sudo env PATH=$PATH:/usr/bin pm2 startup systemd --user {{ ansible_user }} --hp /home/{{ ansible_user }}
tags:
- restart
- start

- name: Start Open Terms Archive applications
ansible.builtin.command:
cmd: pm2 startOrRestart pm2.config.cjs
Expand All @@ -32,3 +39,12 @@
tags:
- restart
- start

- name: Save PM2 process list for auto-restart
ansible.builtin.command:
cmd: pm2 save
chdir: /home/{{ ansible_user }}/{{ ota_directory }}
tags:
- restart
- start
- stop