diff --git a/README.md b/README.md index c958829d..ccd921ae 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/local/Dockerfile b/local/Dockerfile index 1f82d61c..fbdda5f6 100644 --- a/local/Dockerfile +++ b/local/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:11.6 +FROM debian:12 ENV container=docker RUN apt-get update -y && apt-get dist-upgrade -y diff --git a/local/Vagrantfile b/local/Vagrantfile index 8abb0d8c..2816576a 100644 --- a/local/Vagrantfile +++ b/local/Vagrantfile @@ -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` @@ -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 diff --git a/roles/bootstrap/defaults/main.yaml b/roles/bootstrap/defaults/main.yaml index 283c6ddc..65da11ce 100644 --- a/roles/bootstrap/defaults/main.yaml +++ b/roles/bootstrap/defaults/main.yaml @@ -5,3 +5,4 @@ server_user_group: aides_jeunes webroot_path: /var/www is_default: false challenge_proxy: false +node_version: "18" diff --git a/roles/bootstrap/tasks/install_mongodb.yaml b/roles/bootstrap/tasks/install_mongodb.yaml index ef992c39..feb57e25 100644 --- a/roles/bootstrap/tasks/install_mongodb.yaml +++ b/roles/bootstrap/tasks/install_mongodb.yaml @@ -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 diff --git a/roles/bootstrap/tasks/install_node.yaml b/roles/bootstrap/tasks/install_node.yaml index 26d08c20..a83de61a 100644 --- a/roles/bootstrap/tasks/install_node.yaml +++ b/roles/bootstrap/tasks/install_node.yaml @@ -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