Skip to content

Commit

Permalink
Merge pull request #706 from manala/apt/nodejs-22
Browse files Browse the repository at this point in the history
[Apt] Nodejs 22 support
  • Loading branch information
nervo authored Jul 3, 2024
2 parents fab83be + 6ab64b6 commit 2aa9c08
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/molecule.nodejs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
with:
debug: ${{ inputs.debug == true }}
scenario: nodejs
versions: '[4, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20]'
versions: '[4, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22]'
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- [Apt] Nodejs 22 support

## [4.0.0] - 2024-04-12
### Changed
Expand Down
24 changes: 12 additions & 12 deletions molecule/apt/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@
# Short syntax
- git@backports
- libssl1.0.0@backports
- php@sury_php:300
- sury_php:100
- sury_php:200
- nginx-dbg@nginx:300
- nginx:100
- nginx:200
# Pattern syntax
- preference: ansible@ansible
- preference: ansible@ansible
Expand Down Expand Up @@ -308,7 +308,7 @@
tasks_from: repositories
vars:
manala_apt_preferences:
- sury_php:100
- nginx:100
manala_apt_repositories:
# Short syntax
- matomo
Expand All @@ -327,41 +327,41 @@
signed_by: https://www.postgresql.org/media/keys/ACCC4CF8.asc
# Flatten
-
- nginx
- aptly
# State
# Implicit present
- name: nodesource_12
uris: https://deb.nodesource.com/node_12.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
# Explicit absent
- name: nodesource_14
uris: https://deb.nodesource.com/node_14.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
state: absent
# Explicit Present
- name: nodesource_16
uris: https://deb.nodesource.com/node_16.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
state: present
# Existing Ignore
- name: nodesource_18
uris: https://deb.nodesource.com/node_18.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
state: ignore
# Not existing Ignore
- name: nodesource_20
uris: https://deb.nodesource.com/node_20.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
state: ignore
always:
- name: Goss
Expand Down Expand Up @@ -416,7 +416,7 @@
uris: https://deb.nodesource.com/node_14.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
# Existing ignore
- name: nodesource_18
state: ignore
Expand All @@ -425,7 +425,7 @@
uris: https://deb.nodesource.com/node_20.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
state: ignore
always:
- name: Goss
Expand Down
12 changes: 6 additions & 6 deletions molecule/apt/goss/preferences.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ file:
Package: libssl1.0.0
Pin: release n={{ ansible_facts.distribution_release }}-backports
Pin-Priority: 1000
{{ tests_dir }}/default/php:
{{ tests_dir }}/default/nginx-dbg:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
contents: |
Package: php php-* /^php[1-9]+/
Pin: origin packages.sury.org
Package: nginx-dbg
Pin: origin nginx.org
Pin-Priority: 300
{{ tests_dir }}/default/sury_php:
{{ tests_dir }}/default/nginx:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
contents: |
Package: *
Pin: origin packages.sury.org
Package: nginx*
Pin: origin nginx.org
Pin-Priority: 200
# Default - Pattern syntax
{{ tests_dir }}/default/ansible:
Expand Down
22 changes: 11 additions & 11 deletions molecule/apt/goss/repositories.default.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

file:
# Default - From preferences
{{ manala_apt_repositories_dir }}/sury-php.sources:
{{ manala_apt_repositories_dir }}/nginx.sources:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
contents: |
X-Repolib-Name: sury_php
URIs: https://packages.sury.org/php/
X-Repolib-Name: nginx
URIs: http://nginx.org/packages/debian
Suites: {{ ansible_facts.distribution_release }}
Components: main
Signed-By: /etc/apt/keyrings/sury-php.gpg
Components: nginx
Signed-By: /etc/apt/keyrings/nginx.asc
Types: deb
# Default - Short syntax
{{ manala_apt_repositories_dir }}/matomo.sources:
Expand Down Expand Up @@ -71,18 +71,18 @@ file:
Signed-By: /etc/apt/keyrings/postgresql.asc
Types: deb
# Default - Flatten
{{ manala_apt_repositories_dir }}/nginx.sources:
{{ manala_apt_repositories_dir }}/aptly.sources:
exists: true
filetype: file
owner: root
group: root
mode: "0644"
contents: |
X-Repolib-Name: nginx
URIs: http://nginx.org/packages/debian
Suites: {{ ansible_facts.distribution_release }}
Components: nginx
Signed-By: /etc/apt/keyrings/nginx.asc
X-Repolib-Name: aptly
URIs: http://repo.aptly.info/
Suites: squeeze
Components: main
Signed-By: /etc/apt/keyrings/aptly.asc
Types: deb
# Default - State
{{ manala_apt_repositories_dir }}/nodesource-12.sources:
Expand Down
20 changes: 20 additions & 0 deletions molecule/nodejs.22/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---

###########
# Default #
###########

- name: Default
tags: [default]
hosts: debian
tasks:
- block: # noqa: name[missing]
- name: Role
ansible.builtin.import_role:
name: manala.roles.nodejs
always:
- name: Goss
ansible.builtin.command:
cmd: goss --gossfile - validate
stdin: "{{ lookup('ansible.builtin.template', 'goss/default.yaml.j2') }}"
changed_when: false
15 changes: 15 additions & 0 deletions molecule/nodejs.22/goss/default.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

package:
nodejs:
installed: true

command:
node --version:
exit-status: 0
stdout:
- "/^v22.\\d+\\.\\d+$/"
npm --version:
exit-status: 0
stdout:
- "/^10.\\d+\\.\\d+$/"
Empty file added molecule/nodejs.22/molecule.yml
Empty file.
12 changes: 12 additions & 0 deletions molecule/nodejs.22/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

- name: Prepare
tags: [always]
hosts: debian
tasks:
- name: Apt
ansible.builtin.import_role:
name: manala.roles.apt
vars:
manala_apt_preferences:
- nodejs@nodesource_22
1 change: 1 addition & 0 deletions roles/apt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ manala_apt_repositories:
- nodesource_16
- nodesource_18
- nodesource_20
- nodesource_22
- postgresql
- mongodb_4_2
- mongodb_4_4
Expand Down
31 changes: 19 additions & 12 deletions roles/apt/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,68 +81,73 @@ manala_apt_repositories_patterns:
uris: https://deb.nodesource.com/node_4.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_4_x.list
nodesource_6:
uris: https://deb.nodesource.com/node_6.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_6_x.list
nodesource_7:
uris: https://deb.nodesource.com/node_7.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_7_x.list
nodesource_8:
uris: https://deb.nodesource.com/node_8.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_8_x.list
nodesource_9:
uris: https://deb.nodesource.com/node_9.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_9_x.list
nodesource_10:
uris: https://deb.nodesource.com/node_10.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_10_x.list
nodesource_12:
uris: https://deb.nodesource.com/node_12.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_12_x.list
nodesource_14:
uris: https://deb.nodesource.com/node_14.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_14_x.list
nodesource_16:
uris: https://deb.nodesource.com/node_16.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_16_x.list
nodesource_18:
uris: https://deb.nodesource.com/node_18.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_18_x.list
nodesource_20:
uris: https://deb.nodesource.com/node_20.x
suites: "{{ ansible_facts.distribution_release }}"
components: main
key: nodesource
key: nodesource_legacy
legacy_file: deb_nodesource_com_node_20_x.list
nodesource_22:
uris: https://deb.nodesource.com/node_22.x
suites: nodistro
components: main
key: nodesource
mysql_5_7:
uris: http://repo.mysql.com/apt/{{ ansible_facts.distribution | lower }}/
suites: "{{ ansible_facts.distribution_release }}"
Expand Down Expand Up @@ -564,8 +569,10 @@ manala_apt_keys_patterns:
signed_by: https://nginx.org/keys/nginx_signing.key
bearstech:
signed_by: http://deb.bearstech.com/bearstech-archive.gpg
nodesource:
nodesource_legacy:
signed_by: http://deb.nodesource.com/gpgkey/nodesource.gpg.key
nodesource:
signed_by: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key
mysql:
signed_by: https://repo.mysql.com/RPM-GPG-KEY-mysql-2023
mariadb:
Expand Down

0 comments on commit 2aa9c08

Please sign in to comment.