Skip to content

Commit

Permalink
Merge pull request #76 from fubarhouse/dev-2.6.x
Browse files Browse the repository at this point in the history
Dev 2.6.x
  • Loading branch information
fubarhouse authored Nov 19, 2017
2 parents c88a15f + a5642df commit b07c1b8
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 19 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
go_reget: false
go_install_clean: false
go_version: 1.9
go_uninstall: false
go_custom_mirror: https://storage.googleapis.com/golang
go_temporary_dir: /tmp
mode_codebase: 0755
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ galaxy_info:
- xenial
- vivid
- wily
# - utopic
- utopic
- trusty
- saucy
- raring
Expand Down
12 changes: 10 additions & 2 deletions tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
state: absent
failed_when: false

- name: "Go-Lang | Removing GOPATH"
file:
path: "{{ GOPATH }}"
state: absent
failed_when: false

- name: "Go-Lang | Removing GOBOOTSTRAP"
file:
path: "{{ GOROOT_BOOTSTRAP }}"
Expand All @@ -22,10 +28,12 @@
lineinfile: "export GOROOT={{ GOROOT }}"
- regex: "export GOPATH"
lineinfile: "export GOPATH={{ GOPATH }}"
- regex: "PATH:{{ GOROOT }}/bin"
lineinfile: "export $PATH:{{ GOROOT }}/bin"
- regex: "PATH:{{ GOPATH }}"
lineinfile: "export PATH=$PATH:{{ GOPATH }}"
lineinfile: "export $PATH=$PATH:{{ GOPATH }}"
- regex: "PATH:{{ GOPATH }}/bin"
lineinfile: "export PATH=$PATH:{{ GOPATH }}/bin"
lineinfile: "export $PATH=$PATH:{{ GOPATH }}/bin"
when: shell_exports is not defined

- name: "Go-Lang | Detect configured shell profiles"
Expand Down
25 changes: 15 additions & 10 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,35 @@
- regex: "export GOPATH"
lineinfile: "export GOPATH={{ GOPATH }}"
- regex: "PATH:{{ GOROOT }}/bin"
lineinfile: "export PATH=$PATH:{{ GOROOT }}/bin"
lineinfile: "export $PATH:{{ GOROOT }}/bin"
- regex: "PATH:{{ GOPATH }}"
lineinfile: "export $PATH=$PATH:{{ GOPATH }}"
- regex: "PATH:{{ GOPATH }}/bin"
lineinfile: "export PATH=$PATH:{{ GOPATH }}/bin"
lineinfile: "export $PATH=$PATH:{{ GOPATH }}/bin"
when: shell_exports is not defined

- name: "Go-Lang | Include bootstrap tasks"
include: install-bootstrap.yml
when:
- install_go_bootstrap|bool == true
- go_binary_bootstrap.stat.exists|bool == false
- GOROOT_BOOTSTRAP is defined
- expected_go_version_output|string not in current_go_version.stdout|default('')
(install_go_bootstrap|bool == true) and
((go_binary_bootstrap.stat.exists|bool == false) or
(expected_go_version_output|string not in current_go_version.stdout|default('')) or
(go_install_clean|bool == true)) and
(GOROOT_BOOTSTRAP is defined)

- name: "Go-Lang | Include source build tasks"
include: install-git.yml
when:
- build_go_from_source|bool == true
- expected_go_version_output|string not in current_go_version.stdout|default('')
(build_go_from_source|bool == true) and
((expected_go_version_output|string not in current_go_version.stdout|default('')) or
(go_install_clean|bool == true))

- name: "Go-Lang | Include distro install tasks"
include: install-distro.yml
when:
- build_go_from_source|bool == false
- expected_go_version_output|string not in current_go_version.stdout|default('')
(build_go_from_source|bool == false) and
((expected_go_version_output|string not in current_go_version.stdout|default('')) or
(go_install_clean|bool == true))

- name: "Go-Lang | Detect configured shell profiles"
stat:
Expand Down
15 changes: 10 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@

- name: "Include tasks for installation"
include: install.yml
when: (current_go_version is not defined) or
(expected_go_version_output|string not in current_go_version.stdout|default(''))
when: ((current_go_version is not defined) or
(expected_go_version_output|string not in current_go_version.stdout|default('')) or
(go_install_clean|bool == true)) and
(go_uninstall|bool == false)

- name: "Include tasks for Go Get"
include: go-get.yml
when: go_get.0 is defined
when: (go_get.0 is defined) and
(go_uninstall|bool == false)

- name: "Include tasks for Go Install"
include: go-install.yml
when: go_install.0 is defined
when: (go_install.0 is defined) and
(go_uninstall|bool == false)

- name: "Include tasks for setting Go permissions"
include: perm.yml
include: perm.yml
when: go_uninstall|bool == false
2 changes: 1 addition & 1 deletion tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

- name: "Go-Lang | Define GOROOT_BOOTSTRAP"
set_fact:
GOROOT_BOOTSTRAP: /usr/local/go1.4"
GOROOT_BOOTSTRAP: /usr/local/go1.4
when:
- fubarhouse_user_dir is defined
- GOROOT_BOOTSTRAP is not defined
Expand Down

0 comments on commit b07c1b8

Please sign in to comment.