feat: add go package installer
This commit is contained in:
parent
519d4bf742
commit
6288c7bc04
18
tasks/install-go-package.yml
Normal file
18
tasks/install-go-package.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user