feat: add go package installer

This commit is contained in:
Price Hiller 2022-08-03 01:10:59 -05:00
parent 519d4bf742
commit 6288c7bc04

View File

@ -0,0 +1,18 @@
---
- name: Install golang
ansible.builtin.import_tasks: install-golang.yml
- name: Check if package is installed
ansible.builtin.command: "which {{ go_package_name }}"
environment:
PATH: "{{ ansible_env.PATH }}:{{ gopath }}/bin"
changed_when: false
register: go_package_installed
failed_when: go_package_installed.rc > 1
- name: Install package
ansible.builtin.command: "go install {{ go_install_package }}"
environment:
PATH: "{{ ansible_env.PATH }}:{{ gopath }}/bin"
changed_when: true
when: go_package_installed.rc != 0