1
0
Fork 0
master
Jeffrey C. Ollie 5 years ago
commit 94796f97ec
  1. 1
      .gitignore
  2. 2
      pillar/golang/init.sls
  3. 3
      pillar/top.sls
  4. 6
      salt/go.sh
  5. 43
      salt/init.sls

1
.gitignore vendored

@ -0,0 +1 @@
*~

@ -0,0 +1,2 @@
golang:
version: '1.9.2'

@ -0,0 +1,3 @@
base:
'*':
- golang

@ -0,0 +1,6 @@
GOROOT=/opt/go/{{ pillar['golang']['version'] }}
export GOROOT
GOPATH=~/gocode
export GOPATH
PATH=/opt/go/{{ pillar['golang']['version'] }}/bin:~/gocode/bin:$PATH
export PATH

@ -0,0 +1,43 @@
{% set arch = {'x86_64': 'amd64',
'armv7l': 'armv6l'}.get(grains.cpuarch) %}
go-pkgs:
pkg.purged:
- pkgs:
- golang
- golang-bin
- golang-src
- golang-doc
- golang-go
- golang-go-linux-arm
/opt/go:
file:
- directory
/opt/go/{{ pillar['golang']['version'] }}:
archive.extracted:
- source: https://storage.googleapis.com/golang/go{{ pillar['golang']['version'] }}.linux-{{ arch }}.tar.gz
- skip_verify: true
- archive_format: tar
- options: --verbose --strip-components 1
- enforce_toplevel: false
- if_missing: /opt/go/{{ pillar['golang']['version'] }}/bin/go
- require:
- file: /opt/go
/etc/profile.d/go.sh:
file.managed:
- source: salt://go/go.sh
- template: jinja
- mode: 0755
- require:
- archive: /opt/go/{{ pillar['golang']['version'] }}
{% for oldver in ['1.5.2', '1.6.1', '1.6.2', '1.7', '1.7.1', '1.8', '1.8.1', '1.8.3'] %}
/opt/go/{{ oldver }}:
file.absent
{% endif %}
Loading…
Cancel
Save