diff options
author | heqnx <root@heqnx.com> | 2025-05-25 08:40:36 +0300 |
---|---|---|
committer | heqnx <root@heqnx.com> | 2025-05-25 08:40:36 +0300 |
commit | b6169eb3f2c0f7b05a5f74a12ea2d5942039a8f5 (patch) | |
tree | 37c403c6504be0c801b0db5b5dd0fe2216b7d7e6 | |
parent | 1f073d1d2114bcb66baadaa6bfa15ab8a27faa59 (diff) | |
download | ansible-playbooks-b6169eb3f2c0f7b05a5f74a12ea2d5942039a8f5.tar.gz ansible-playbooks-b6169eb3f2c0f7b05a5f74a12ea2d5942039a8f5.zip |
added systemwide go path
-rw-r--r-- | attackbox/tasks/golang_install.yaml | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/attackbox/tasks/golang_install.yaml b/attackbox/tasks/golang_install.yaml index df9c266..e67d508 100644 --- a/attackbox/tasks/golang_install.yaml +++ b/attackbox/tasks/golang_install.yaml @@ -1,10 +1,4 @@ -- name: check if golang is installed - stat: - path: /usr/local/go/bin/go - register: golang_installed - - name: download and extract golang - when: not golang_installed.stat.exists block: - name: get latest golang version shell: | @@ -28,12 +22,12 @@ path: /tmp/golang.tar.gz state: absent - - name: add golang to PATH - lineinfile: - path: "{{ ansible_env.HOME }}/.bashrc" - line: "{{ item }}" - create: yes - loop: - - "GOPATH={{ ansible_env.HOME }}/go" - - "PATH=$PATH:/usr/local/go/bin:{{ ansible_env.HOME }}/go:{{ ansible_env.HOME }}/go/bin" - + - name: set system-wide go environment variables + copy: + dest: /etc/profile.d/go_env.sh + content: | + export GOPATH=/root/go + export PATH=$PATH:/usr/local/go/bin:$GOPATH:$GOPATH/bin + owner: root + group: root + mode: '0644' |