some more roles
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
name:
|
||||
- cargo
|
||||
|
||||
- name: Add Go to PATH
|
||||
- name: Add Cargo to PATH
|
||||
lineinfile:
|
||||
path: "{{ ansible_user_dir }}/.zshrc"
|
||||
insertafter: 'export PATH="$PATH.*'
|
||||
|
||||
@@ -1,8 +1,37 @@
|
||||
- name: check go version
|
||||
command: /usr/local/go/bin/go version
|
||||
register: result
|
||||
changed_when: no
|
||||
ignore_errors: true
|
||||
|
||||
- name: Install Go
|
||||
become: true
|
||||
package:
|
||||
name:
|
||||
- golang
|
||||
when: result is failed
|
||||
shell: |
|
||||
wget "https://go.dev/dl/go1.22.1.linux-amd64.tar.gz"
|
||||
rm -rf /usr/local/go
|
||||
tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
|
||||
rm -rf go1.22.1.linux-amd64.tar.gz
|
||||
|
||||
# - name: Install Go
|
||||
# become: true
|
||||
# package:
|
||||
# name:
|
||||
# - golang
|
||||
#
|
||||
#wget "https://go.dev/$(curl https://go.dev/dl/ | grep downloadBox.*linux | cut -d '"' -f 4 | cut -c2-)"
|
||||
|
||||
- name: Add go binary path to PATH
|
||||
lineinfile:
|
||||
path: "{{ ansible_user_dir }}/.profile"
|
||||
insertafter: 'export PATH="$PATH.*'
|
||||
line: 'export PATH="$PATH:/usr/local/go/bin:{{ ansible_user_dir }}/go/bin"'
|
||||
regexp: 'export PATH="$PATH:/usr/local/go/bin:{{ ansible_user_dir }}/go/bin"'
|
||||
create: true
|
||||
state: present
|
||||
|
||||
# - name: Source profile
|
||||
# shell: . "{{ ansible_user_dir }}/.profile"
|
||||
|
||||
- name: check go version
|
||||
command: go version
|
||||
@@ -19,7 +48,7 @@
|
||||
go_path: "{{ lookup('env', 'GOPATH') | default(ansible_env.HOME+'/go', true) }}"
|
||||
when: result is succeeded
|
||||
|
||||
- name: Add Go to PATH
|
||||
- name: Add Go programs to PATH
|
||||
lineinfile:
|
||||
path: "{{ ansible_user_dir }}/.zshrc"
|
||||
insertafter: 'export PATH="$PATH.*'
|
||||
|
||||
Reference in New Issue
Block a user