Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attention ! A merge après l'update en preprod et prod : Debian 11 to 12 #193

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Set up the [Mes Aides](https://mes-aides.1jeune1solution.beta.gouv.fr/) stack.

## Before starting

The ansible scripts in this repository have been tested only Debian 11 x86_64 server. However, older or newer versions of Debian may be compatible.
The ansible scripts in this repository have been tested only Debian 12 x86_64 server. However, older or newer versions of Debian may be compatible.

## Deployment

Expand Down
2 changes: 1 addition & 1 deletion local/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:11.6
FROM debian:12
ENV container=docker

RUN apt-get update -y && apt-get dist-upgrade -y
Expand Down
4 changes: 2 additions & 2 deletions local/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.vm.box = "debian/bookwarm64"

# Guest have 500MB of RAM by default
# That is not enough to `npm ci`
Expand All @@ -24,7 +24,7 @@ Vagrant.configure("2") do |config|
end

docker.build_args = "--platform=linux/arm64"
docker.name = "ctn_aides_jeunes"
docker.name = "ctn_aides_jeunes_deb12"
override.ssh.insert_key = true
docker.has_ssh = true
docker.privileged = true
Expand Down
1 change: 1 addition & 0 deletions roles/bootstrap/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ server_user_group: aides_jeunes
webroot_path: /var/www
is_default: false
challenge_proxy: false
node_version: "18"
14 changes: 7 additions & 7 deletions roles/bootstrap/tasks/install_mongodb.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
- name: Install mongoDB 6.x
- name: Install mongoDB 7.x
block:
- name: Add mongoDB 6.x apt key
- name: Add mongoDB 7.x apt key
ansible.builtin.apt_key:
url: https://www.mongodb.org/static/pgp/server-6.0.asc
url: https://www.mongodb.org/static/pgp/server-7.0.asc
state: present
- name: Add mongoDB 6.x ppa for apt repo - arm64
- name: Add mongoDB 7.x ppa for apt repo - arm64
ansible.builtin.apt_repository:
repo: deb https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/6.0 multiverse
repo: deb https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse
update_cache: true
when: ansible_facts.machine == 'aarch64'
- name: Add mongoDB 6.x ppa for apt repo - amd64
- name: Add mongoDB 7.x ppa for apt repo - amd64
ansible.builtin.apt_repository:
repo: deb https://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main
repo: deb https://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main
update_cache: true
when: ansible_facts.machine != 'aarch64'
- name: Install mongoDB
Expand Down
31 changes: 21 additions & 10 deletions roles/bootstrap/tasks/install_node.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
---
- name: Add nodejs apt key
ansible.builtin.apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
- name: Add nodejs 18.x ppa for apt repo
ansible.builtin.apt_repository:
repo: deb https://deb.nodesource.com/node_18.x bullseye main
update_cache: true
- name: Install nodejs

- name: Download node.js installation script
ansible.builtin.get_url:
url: https://deb.nodesource.com/setup_{{ node_version }}.x
dest: /tmp/nodesource_setup.sh
mode: '0755'

- name: Run the nodesource setup script
become: true
ansible.builtin.command: sh /tmp/nodesource_setup.sh
args:
creates: /usr/bin/node

- name: Update and install nodejs
become: true
ansible.builtin.apt:
update_cache: true
name: nodejs
state: present
update_cache: true

- name: Clean up NodeSource setup script
ansible.builtin.file:
path: /tmp/nodesource_setup.sh
state: absent
Loading