Ubuntu isn't running /etc/profile.d/golang.sh. This will force the
addition of the Go path into the PATH var if it is missing.
Issue-ID: LF-Jira IT-18590
Change-Id: Ic2d3edce11897bc018f6ae2e2a542f46027a09fb
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
-Subproject commit 1d5bbea3f4a9c037228a923e47dd76f70aeae2a9
+Subproject commit da5d5cf92fafcdc0f31a76d2955e8ac9c327c100
become_user: root
become_method: sudo
+ vars:
+ golang_version: 1.12
+ gopath: '/opt/go/{{golang_version}}/bin'
+
pre_tasks:
- include_role: name=lfit.system-update
- include_role:
name: gantsign.golang
vars:
- golang_version: 1.12
ansible_become: true
+
+ - name: Add Go to Ubuntu path
+ lineinfile:
+ path: /etc/environment
+ regexp: 'PATH=(["]*)((?!.*?{{gopath}}).*?)(["]*)$'
+ line: 'PATH=\1\2:{{gopath}}\3'
+ backrefs: yes
+ when: ansible_distribution == 'Ubuntu'
+ become: yes