add role golang

This commit is contained in:
Julian Labus 2018-09-11 14:14:02 +02:00
parent 280a6f9da6
commit 51c5330e36
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
2 changed files with 31 additions and 0 deletions

View 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

View file

@ -0,0 +1,2 @@
export GOPATH="{{ gopath }}"
export PATH="$PATH:$GOPATH/bin"