From 4c749316c58cea5986dd38987df5bb41d55f77ff Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Thu, 21 Apr 2016 15:01:34 -0400 Subject: [PATCH] golang: update to go1.6.2, allow specifying user, fix directory permissions --- roles/golang/tasks/main.yml | 6 +++--- roles/golang/vars/main.yml | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/roles/golang/tasks/main.yml b/roles/golang/tasks/main.yml index e5ac497..1a9b13a 100644 --- a/roles/golang/tasks/main.yml +++ b/roles/golang/tasks/main.yml @@ -64,7 +64,7 @@ - golang when: install blockinfile: - dest: "{{ ansible_env.HOME }}/.bashrc" + dest: "{{ golang_user_home }}/.bashrc" marker: "# {mark} ansible-managed Go configuration" block: | export GOROOT={{ golang_root }} @@ -76,13 +76,13 @@ tags: - golang when: install - file: path={{ ansible_env.HOME }}/src/{{ golang_personal_gopath }} state=directory + file: path={{ golang_user_home }}/src/{{ golang_personal_gopath }} owner={{ golang_user }} group={{ golang_user }} state=directory - name: symlink personal GOPATH location to ~/go tags: - golang when: install - file: dest={{ ansible_env.HOME }}/go src={{ ansible_env.HOME }}/src/{{ golang_personal_gopath }} owner={{ ansible_env.USER }} group={{ ansible_env.USER }} state=link + file: dest={{ golang_user_home }}/go src={{ golang_user_home }}/src/{{ golang_personal_gopath }} owner={{ golang_user }} group={{ golang_user }} state=link - name: remove temporary go tarball tags: diff --git a/roles/golang/vars/main.yml b/roles/golang/vars/main.yml index 9502515..78f9b16 100644 --- a/roles/golang/vars/main.yml +++ b/roles/golang/vars/main.yml @@ -1,8 +1,10 @@ --- # Go version to install and its tarball checksum. -golang_version: "go1.6.1" -golang_sha256: "6d894da8b4ad3f7f6c295db0d73ccc3646bce630e1c43e662a0120681d47e988" +golang_version: "go1.6.2" +golang_sha256: "e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a" # Personal Go configuration. +golang_user: "matt" +golang_user_home: "/home/{{ golang_user }}" golang_personal_gopath: "github.com/mdlayher" # Static configuration. golang_url: "https://storage.googleapis.com/golang/{{ golang_version }}.linux-amd64.tar.gz"