add role golang
This commit is contained in:
parent
280a6f9da6
commit
51c5330e36
2 changed files with 31 additions and 0 deletions
29
roles/golang/tasks/main.yml
Normal file
29
roles/golang/tasks/main.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
- name: install golang package
|
||||||
|
package:
|
||||||
|
name: golang-1.8
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: create symlink to golang binary
|
||||||
|
file:
|
||||||
|
src: /usr/lib/go-1.8/bin/go
|
||||||
|
dest: /usr/bin/go
|
||||||
|
state: link
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- name: create GOPATH directory
|
||||||
|
file:
|
||||||
|
path: "{{ gopath }}"
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: set GOPATH globally via profile.d
|
||||||
|
template:
|
||||||
|
src: go.sh.j2
|
||||||
|
dest: /etc/profile.d/go.sh
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
2
roles/golang/templates/go.sh.j2
Normal file
2
roles/golang/templates/go.sh.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
export GOPATH="{{ gopath }}"
|
||||||
|
export PATH="$PATH:$GOPATH/bin"
|
Loading…
Reference in a new issue