Skip to content

Commit

Permalink
refactor: Version changed via changed_when + changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Leko committed Dec 3, 2015
1 parent d45fa2e commit d4c0b6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions provisioning/playbook.yml
Expand Up @@ -52,15 +52,16 @@
register: go_exists
- name: check Go version
shell: go version | awk '{ print $3 }'
register: go_version_matched
register: go_version
ignore_errors: yes
changed_when: "go_version.stdout.find('go{{ goversion }}')"
when: go_exists.stat.exists
- name: get a go
shell: wget https://storage.googleapis.com/golang/go{{ goversion }}.linux-amd64.tar.gz
when: not go_exists.stat.exists or go_version_matched.stdout.find('go{{ goversion }}')
when: not go_exists.stat.exists or go_version|changed
- name: extract files from an archive
shell: sudo tar -C {{ goroot }} -xzf go{{ goversion }}.linux-amd64.tar.gz
when: not go_exists.stat.exists or go_version_matched.stdout.find('go{{ goversion }}')
when: not go_exists.stat.exists or go_version|changed
- name: set GOPATH
lineinfile: dest=/home/vagrant/.bash_profile state=present insertafter=EOF regexp='export GOPATH=' line='export GOPATH={{ gopath }}'
- name: set PATH to Go bin
Expand Down

0 comments on commit d4c0b6f

Please sign in to comment.