add profile paths for redhat systems
This commit is contained in:
7
tasks/pkgs/go_profile_path.yml
Normal file
7
tasks/pkgs/go_profile_path.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Add goroot to /etc/profile.d
|
||||||
|
when:
|
||||||
|
- ansible_os_family == 'RedHat'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
pkg_src: "{{ pkg_src + ['go_profile_path'] }}"
|
||||||
7
tasks/pkgs/usr_local_bin_profile_path.yml
Normal file
7
tasks/pkgs/usr_local_bin_profile_path.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Add /usr/local/bin to PATH
|
||||||
|
when:
|
||||||
|
- ansible_os_family == 'RedHat'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
pkg_src: "{{ pkg_src + ['usr_local_bin_profile_path'] }}"
|
||||||
17
tasks/src/go_profile_path.yml
Normal file
17
tasks/src/go_profile_path.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Add GOROOT/bin to PATH and define GOROOT
|
||||||
|
become: true
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/profile.d/go.sh
|
||||||
|
content: |
|
||||||
|
# enable go
|
||||||
|
GOROOT=/usr/local/go
|
||||||
|
pathmunge ${GOROOT}/bin
|
||||||
|
if [ "$EUID" = "0" ]; then
|
||||||
|
GOBIN=/usr/local/bin
|
||||||
|
else
|
||||||
|
GOBIN=${HOME}/go/bin
|
||||||
|
pathmunge ${HOME}/go/bin
|
||||||
|
fi
|
||||||
|
export GOROOT GOBIN
|
||||||
12
tasks/src/usr_local_bin_profile_path.yml
Normal file
12
tasks/src/usr_local_bin_profile_path.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Add GOROOT/bin to PATH and define GOROOT
|
||||||
|
become: true
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/profile.d/go.sh
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
content: |
|
||||||
|
# add /usr/local/bin to PATH
|
||||||
|
pathmunge /usr/local/bin
|
||||||
Reference in New Issue
Block a user