Install Go directly from upstream, not through RPM

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
This commit is contained in:
Steve Kuznetsov 2017-09-29 11:49:12 -07:00
parent e5749088b2
commit 40132d786d
No known key found for this signature in database
GPG key ID: 366E054B30FC03A2
8 changed files with 100 additions and 120 deletions

View file

@ -1,22 +1,30 @@
---
- name: set up GOPATH if it is not already set
lineinfile:
dest: /etc/environment
line: 'GOPATH={{ ansible_env.HOME }}/go'
regexp: 'GOPATH='
state: present
when: ansible_env.GOPATH is not defined
- name: fetch Golang
unarchive:
remote_src: yes
src: https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz
dest: /usr/local
- name: link go toolchain
file:
src: "/usr/local/go/bin/{{ item }}"
dest: "/usr/bin/{{ item }}"
state: link
with_items:
- go
- gofmt
- godoc
- name: ensure user profile exists
file:
path: "{{ ansible_user_dir }}/.profile"
state: touch
- name: set up PATH for Go binaries
- name: set up PATH for Go toolchain and built binaries
lineinfile:
dest: "{{ ansible_user_dir }}/.profile"
line: 'PATH={{ ansible_env.PATH }}:{{ ansible_env.GOPATH }}/bin'
line: 'PATH={{ ansible_env.PATH }}:{{ ansible_env.GOPATH }}/bin:/usr/local/go/bin'
regexp: '^PATH='
state: present
@ -39,3 +47,5 @@
- onsi/gomega
- cloudflare/cfssl/cmd/...
- jteeuwen/go-bindata/go-bindata
- vbatts/git-validation
- cpuguy83/go-md2man