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:
TeoV
2019-09-09 15:46:24 +03:00
committed by Dan Christian Bogos
parent 99c72534d6
commit b24d17852b
2 changed files with 25 additions and 0 deletions

View File

@@ -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 }}'

View File

@@ -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