mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-20 06:38:45 +05:00
81 lines
1.8 KiB
YAML
81 lines
1.8 KiB
YAML
---
|
|
- name: create gopath directory
|
|
file:
|
|
state: directory
|
|
mode: 'u=rwx,go=rx'
|
|
dest: '{{ golang_gopath }}'
|
|
|
|
- name: create download directory
|
|
file:
|
|
state: directory
|
|
mode: 'u=rwx,go=rx'
|
|
dest: '{{ golang_download_dir }}'
|
|
|
|
- name: download Go language SDK
|
|
get_url:
|
|
url: '{{ golang_mirror }}/{{ golang_redis_filename }}'
|
|
dest: '{{ golang_download_dir }}/{{ golang_redis_filename }}'
|
|
mode: 'u=rw,go=r'
|
|
|
|
- name: create Go language SDK installation directory
|
|
become: yes
|
|
file:
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: 'u=rwx,go=rx'
|
|
dest: '{{ golang_install_dir }}'
|
|
|
|
- name: install Go language SDK
|
|
become: yes
|
|
unarchive:
|
|
src: '{{ golang_download_dir }}/{{ golang_redis_filename }}'
|
|
remote_src: yes
|
|
extra_opts: '--strip-components=1'
|
|
dest: '{{ golang_install_dir }}'
|
|
owner: root
|
|
group: root
|
|
creates: '{{ golang_install_dir }}/bin'
|
|
|
|
# Set Go language SDK environment variables
|
|
- name: make sure /etc/profile.d exists
|
|
become: yes
|
|
file:
|
|
path: /etc/profile.d
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: 'u=rwx,go=rx'
|
|
|
|
- name: export Go language SDK environment variables
|
|
become: yes
|
|
template:
|
|
src: golang.sh.j2
|
|
dest: /etc/profile.d/golang.sh
|
|
owner: root
|
|
group: root
|
|
mode: 'u=rw,go=r'
|
|
|
|
- name: Export GOROOT
|
|
lineinfile:
|
|
path: ~/.bashrc
|
|
line: export GOROOT='{{ golang_install_dir }}'
|
|
insertafter: last
|
|
|
|
- name: Add GOROOT to PATH
|
|
lineinfile:
|
|
path: ~/.bashrc
|
|
line: export PATH=$PATH:$GOROOT/bin
|
|
insertafter: last
|
|
|
|
- name: Export GOPATH
|
|
lineinfile:
|
|
path: ~/.bashrc
|
|
line: export GOPATH='{{ golang_gopath }}'
|
|
insertafter: last
|
|
|
|
- name: Add GOPATH to PATH
|
|
lineinfile:
|
|
path: ~/.bashrc
|
|
line: export PATH=$PATH:$GOPATH/bin
|
|
insertafter: last |