diff --git a/roles/common/tasks/golang.yml b/roles/common/tasks/golang.yml index 5891f2c..75bb036 100644 --- a/roles/common/tasks/golang.yml +++ b/roles/common/tasks/golang.yml @@ -1,26 +1,9 @@ --- - block: - - name: 'golang : download golang 1.12.4 archive' - get_url: - url: https://dl.google.com/go/go1.12.4.linux-amd64.tar.gz - dest: /tmp/golang.tar.gz - checksum: sha256:d7d1f1f88ddfe55840712dc1747f37a790cbcaa448f6c9cf51bbe10aa65442f5 - - - name: 'golang : extract archive' - unarchive: - dest: /usr/local - remote_src: yes - src: /tmp/golang.tar.gz - - - name: 'golang : add golang directory to $PATH' - lineinfile: - insertafter: EOF - line: export PATH=$PATH:/usr/local/go/bin - path: '{{ item }}' - state: present - with_items: - - /etc/profile - - /etc/zsh/zprofile + - name: 'golang : install golang snap' + snap: + name: go + classic: yes - name: 'golang : setup $GOPATH' lineinfile: @@ -42,11 +25,6 @@ - /etc/profile - /etc/zsh/zprofile - - name: 'golang : cleanup fragments' - file: - dest: /tmp/golang.tar.gz - state: absent - tags: - common - golang diff --git a/roles/common/tasks/node.yml b/roles/common/tasks/node.yml index a2aff3b..fba3c95 100644 --- a/roles/common/tasks/node.yml +++ b/roles/common/tasks/node.yml @@ -1,19 +1,12 @@ --- - block: - - name: 'node : download setup script' - get_url: - url: https://deb.nodesource.com/setup_10.x - dest: /tmp/node_setup.sh - - - name: 'node : execute PPA setup script' - shell: bash /tmp/node_setup.sh - - - name: 'node : install Node' - apt: - name: nodejs - state: present - update_cache: yes + - name: 'node : install LTS version with snap' + snap: + name: go + classic: yes +# add the following if version 10.x is preferred to LTS + # channel: "10" - name: 'node : import Yarn APT key' apt_key: @@ -32,11 +25,6 @@ name: yarn state: present - - name: 'node : cleanup temp files' - file: - path: /tmp/node_setup.sh - state: absent - tags: - common - node