mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 11:06:25 +05:00
Update ansible script for generating packages to verify if the version of go is current and is /usr/bin/python exist
This commit is contained in:
committed by
Dan Christian Bogos
parent
99c72534d6
commit
b24d17852b
@@ -11,6 +11,18 @@
|
||||
mode: 'u=rwx,go=rx'
|
||||
dest: '{{ golang_download_dir }}'
|
||||
|
||||
- name: Register the current Go version (if any)
|
||||
command: /usr/local/go/bin/go version
|
||||
ignore_errors: yes
|
||||
register: go_version
|
||||
changed_when: false
|
||||
|
||||
- name: Remove old installation of Go
|
||||
file:
|
||||
path: /usr/local/go
|
||||
state: absent
|
||||
when: go_version is failed or go_version.stdout != go_version_target
|
||||
|
||||
- name: download Go language SDK
|
||||
get_url:
|
||||
url: '{{ golang_mirror }}/{{ golang_redis_filename }}'
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
---
|
||||
- name: symlink /usr/bin/python -> /usr/bin/python3
|
||||
hosts: all
|
||||
remote_user: '{{ gouser }}'
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: symlink /usr/bin/python -> /usr/bin/python3
|
||||
raw: |
|
||||
if [ -f /usr/bin/python3 ] && [ ! -f /usr/bin/python ]; then
|
||||
ln --symbolic /usr/bin/python3 /usr/bin/python;
|
||||
fi
|
||||
become: true
|
||||
|
||||
- hosts: all
|
||||
vars:
|
||||
###############################################################
|
||||
@@ -6,6 +18,7 @@
|
||||
###############################################################
|
||||
# Go language SDK version number
|
||||
golang_version: '1.13'
|
||||
go_version_target: "go version go{{ golang_version }} linux/amd64"
|
||||
# Mirror to download the Go language SDK redistributable package from
|
||||
golang_mirror: 'https://storage.googleapis.com/golang'
|
||||
# Base installation directory the Go language SDK distribution
|
||||
|
||||
Reference in New Issue
Block a user