Skip to content

Commit

Permalink
Force snap refresh to change node version
Browse files Browse the repository at this point in the history
resolves #143

Co-authored-by: Ryan Heuser <[email protected]>
  • Loading branch information
rlskoeser and quadrismegistus committed Dec 12, 2023
1 parent 3fe6548 commit 8918692
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions roles/build_npm/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
channel: "{{ node_version }}/stable"
state: present
when: ansible_distribution == "Ubuntu"
register: snap_results

# NOTE: upgrading nodejs on cdh-geniza1 failed;
# was able to get it working with refresh
# instead of install:
# sudo snap refresh node --channel=16
# We may want to run refresh as a command, see
# https://serverfault.com/a/1025300
# NOTE: upgrading nodejs with ansible snap fails, even though
# the documentation claims it should refresh when then channel changes.
# Manually run a refresh command to ensure version changes take effect, e.g.:
# sudo snap refresh node --channel=18
# NOTE2: could add a node -v check and only refresh on mismatch

- name: Refresh nodejs to ensure version changes take effect
become: true
ansible.builtin.command: "snap refresh node --channel={{ node_version }}/stable"

- name: install javascript dependencies with npm
become: true
Expand Down

0 comments on commit 8918692

Please sign in to comment.