diff --git a/docs/README.rst b/docs/README.rst index 162a986..a2af213 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -17,6 +17,7 @@ golang-formula Deploy and manage golang using Salt. .. contents:: **Table of Contents** + :depth: 1 General notes ------------- diff --git a/golang/archive/clean.sls b/golang/archive/clean.sls index 9668641..002565e 100644 --- a/golang/archive/clean.sls +++ b/golang/archive/clean.sls @@ -10,6 +10,8 @@ golang-cli-package-archive-clean-file-absent: - names: - {{ golang.pkg.archive.name }} - /usr/local/go + - /usr/local/bin/go + - /usr/local/bin/gofmt {%- if golang.kernel == 'linux' %} - {{ golang.path }} {%- endif %} diff --git a/golang/archive/install.sls b/golang/archive/install.sls index 3086d37..538695e 100644 --- a/golang/archive/install.sls +++ b/golang/archive/install.sls @@ -29,13 +29,16 @@ golang-package-archive-install-archive-extracted: - user: {{ golang.rootuser }} - group: {{ golang.rootgroup }} - {%- if golang.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS',) %} + {%- if golang.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'FreeBSD', 'MacOS') %} + {% for i in ('go', 'gofmt') %} -golang-archive-install-file-symlink-golang: +golang-package-archive-install-symlink-{{ i }}: file.symlink: - - name: /usr/local/bin/go - - target: {{ golang.path }}/{{ golang.command }} + - name: /usr/local/bin/{{ i }} + - target: {{ golang.path }}/go/bin/{{ i }} + - mode: '0755' - force: True - - onlyif: test -f {{ golang.path }}/{{ golang.command }} + - onlyif: test -x {{ golang.path }}/go/bin/{{ i }} + {%- endfor %} {%- endif %} diff --git a/golang/config/environ.sls b/golang/config/environ.sls index abd33f3..99a15ed 100644 --- a/golang/config/environ.sls +++ b/golang/config/environ.sls @@ -27,20 +27,3 @@ golang-config-file-managed-environ_file: golang: {{ golang|json }} - require: - sls: {{ sls_archive_install if golang.pkg.use_upstream_archive else sls_package_install }} - - - {% for i in ('go', 'gofmt') %} - - # create symlink under certain conditions - # archlinux, freebsd, macos for now -golang-config-file-symlink-{{ i }}-golang-binary: - file.symlink: - - name: /usr/local/bin/{{ i }} - - target: {{ golang.path }}/ {{ i }} - - mode: '0755' - - force: True - - onlyif: - - {{ grains.os_family in ('Arch', 'FreeBSD', 'MacOS') }} - - test -x {{ golang.path }}/ {{ i }} - - {%- endfor %}