From f722d06a28e2e1747b8fe1c0082945ab65f709d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Wed, 6 Oct 2021 21:18:03 +0200 Subject: [PATCH] Set GOROOT correctly --- playbook.yml | 7 ++++--- user.yml | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/playbook.yml b/playbook.yml index fea6afd..608aaaa 100644 --- a/playbook.yml +++ b/playbook.yml @@ -436,11 +436,12 @@ force: true become: true - - name: add go directory to PATH + - name: add go directory to PATH and set GOROOT copy: dest: /etc/profile.d/go.sh content: | - PATH=$PATH:/usr/local/go/bin + export PATH=$PATH:/usr/local/go/bin + export GOROOT=/usr/local/go owner: root group: root mode: '0644' @@ -507,7 +508,7 @@ when: not yubikey_touch_detector_binary.stat.exists - name: build yubikey-touch-detector - shell: sh -c 'env GOPATH=$(pwd) PATH=/usr/local/go/bin:$PATH go get -u github.com/maximbaz/yubikey-touch-detector' + shell: sh -c 'PATH=/usr/local/go/bin:$PATH env GOROOT=/usr/local/go GOPATH=$(pwd) go get -u github.com/maximbaz/yubikey-touch-detector' args: chdir: "{{ yubikey_touch_detector_build_tempdir.path }}" when: not yubikey_touch_detector_binary.stat.exists diff --git a/user.yml b/user.yml index 09f7448..a0c685e 100644 --- a/user.yml +++ b/user.yml @@ -317,23 +317,23 @@ tags: [update] - name: install vim plugins - command: sh -c 'PATH=/usr/local/go/bin:$PATH GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +PlugInstall +qall' + command: sh -c 'PATH=/usr/local/go/bin:$PATH GOROOT=/usr/local/go GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +PlugInstall +qall' register: vim_plugin_install changed_when: vim_plugin_install.stderr != "" - name: install go binaries for vim - command: sh -c 'PATH=/usr/local/go/bin:$PATH GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +GoInstallBinaries +qall' + command: sh -c 'PATH=/usr/local/go/bin:$PATH GOROOT=/usr/local/go GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +GoInstallBinaries +qall' changed_when: false - name: update vim plugins - command: sh -c 'PATH=/usr/local/go/bin:$PATH GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +PlugUpdate +qall' + command: sh -c 'PATH=/usr/local/go/bin:$PATH GOROOT=/usr/local/go GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +PlugUpdate +qall' changed_when: false register: vim_plugin_update changed_when: vim_plugin_update.stderr != "" tags: [update] - name: update go binaries for vim - command: sh -c 'PATH=/usr/local/go/bin:$PATH GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +GoUpdateBinaries +qall' + command: sh -c 'PATH=/usr/local/go/bin:$PATH GOROOT=/usr/local/go GOPATH=/home/{{ user.name }}/.go /usr/bin/nvim --headless +GoUpdateBinaries +qall' changed_when: false tags: [update]