diff --git a/meta/main.yml b/meta/main.yml index 1129419..450985f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,7 +7,7 @@ galaxy_info: description: Node.js installation for Linux company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 2.10 + min_ansible_version: "2.15" platforms: - name: Debian versions: diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 1cb8413..bbdcb51 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -7,34 +7,24 @@ - gnupg2 state: present -- name: Download NodeSource's signing key. - # NodeSource's web server discriminates the User-Agent used by the deb822_repository module. - # https://github.com/nodesource/distributions/issues/1723 - ansible.builtin.get_url: - url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key - dest: /etc/apt/signing-key-nodesource-repo.asc - owner: root - group: root - mode: '0444' - register: node_signing_key +- name: "Add nodejs apt key" + ansible.builtin.apt_key: + url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key + state: present -- name: Add NodeSource repositories for Node.js. - ansible.builtin.deb822_repository: - name: nodesource_{{ nodejs_version }} - uris: "https://deb.nodesource.com/node_{{ nodejs_version }}" - types: deb - suites: nodistro - components: main - signed_by: "{{ node_signing_key.dest }}" +- name: "Add nodejs ppa for node.js {{ nodejs_version }}" + ansible.builtin.apt_repository: + repo: "deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main" state: present register: node_repo - name: Update apt cache if repo was added. ansible.builtin.apt: update_cache=yes when: node_repo is changed - tags: ['skip_ansible_lint'] + tags: ["skip_ansible_lint"] - name: Ensure Node.js and npm are installed. ansible.builtin.apt: name: "nodejs={{ nodejs_version | regex_replace('x', '') }}*" state: present + allow_downgrades: true