Skip to content

Commit

Permalink
#85 Isolate shell tasks into a separate file.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubarhouse committed Jul 2, 2018
1 parent f2fcd11 commit 6931f44
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
16 changes: 16 additions & 0 deletions tasks/install-shell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

- name: "Go-Lang | Ensure shell profiles are configured"
lineinfile:
dest: "{{ item[0] }}"
regexp: "{{ item[1].regex }}"
line: "{{ item[1].lineinfile }}"
state: present
with_nested:
- "{{ golang_shell_profile }}"
- "{{ shell_exports }}"

- name: "Go-Lang | Restart shell"
shell: "{{ golang_shell_profile }}"
changed_when: false
failed_when: false
16 changes: 0 additions & 16 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@
((expected_go_version_output|string not in current_go_version.stdout|default('')) or
(go_install_clean|bool == true))

- name: "Go-Lang | Ensure shell profiles are configured"
lineinfile:
dest: "{{ item[0] }}"
regexp: "{{ item[1].regex }}"
line: "{{ item[1].lineinfile }}"
state: present
with_nested:
- "{{ golang_shell_profile }}"
- "{{ shell_exports }}"
when:
- golang_shell_profile is defined

- name: "Go-Lang | Verify version"
shell: "{{ GOROOT }}/bin/go version"
environment:
Expand All @@ -45,7 +33,3 @@
(go_version_string not in go_version_output.stdout) and
("go version devel" not in go_version_output.stdout)
changed_when: false

- name: "Go-Lang | Restart shell"
shell: "{{ golang_shell_profile }}"
failed_when: false
6 changes: 5 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@

- name: "Include tasks for setting Go permissions"
include_tasks: perm.yml
when: go_uninstall|bool == false
when: go_uninstall|bool == false

- name: "Include tasks for shell installation"
include_tasks: install-shell.yml
when: golang_shell_profile is defined

0 comments on commit 6931f44

Please sign in to comment.