From b678433fd264dd0c38c7048c18c4003f9aa17697 Mon Sep 17 00:00:00 2001 From: TeoV Date: Mon, 16 Sep 2019 08:57:55 -0400 Subject: [PATCH] Update ansible scripts to allow updating go when is neccesary --- data/ansible/calls/freeswitch/go.yaml | 9 +++++---- data/ansible/calls/freeswitch/main.yaml | 1 + data/ansible/integration_tests/go.yaml | 9 +++++---- data/ansible/integration_tests/main.yaml | 8 ++++---- data/ansible/packages/go.yaml | 9 +++++---- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/data/ansible/calls/freeswitch/go.yaml b/data/ansible/calls/freeswitch/go.yaml index b76fae2f6..c08fae40b 100644 --- a/data/ansible/calls/freeswitch/go.yaml +++ b/data/ansible/calls/freeswitch/go.yaml @@ -18,6 +18,7 @@ changed_when: false - name: Remove old installation of Go + become: yes file: path: /usr/local/go state: absent @@ -76,7 +77,7 @@ insertafter: last - name: Add GOROOT to PATH for root - become: yes + become: yes lineinfile: dest: ~/.bashrc line: export PATH=$PATH:$GOROOT/bin @@ -88,7 +89,7 @@ dest: ~/.bashrc line: export GOPATH='{{ golang_gopath }}' insertafter: last - + - name: Add GOPATH to PATH for root become: yes lineinfile: @@ -113,9 +114,9 @@ dest: ~/.bashrc line: export GOPATH='{{ golang_gopath }}' insertafter: last - + - name: Add GOPATH to PATH lineinfile: dest: ~/.bashrc line: export PATH=$PATH:$GOPATH/bin - insertafter: last \ No newline at end of file + insertafter: last diff --git a/data/ansible/calls/freeswitch/main.yaml b/data/ansible/calls/freeswitch/main.yaml index 12390c6c8..147ea1083 100644 --- a/data/ansible/calls/freeswitch/main.yaml +++ b/data/ansible/calls/freeswitch/main.yaml @@ -6,6 +6,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 diff --git a/data/ansible/integration_tests/go.yaml b/data/ansible/integration_tests/go.yaml index b76fae2f6..c08fae40b 100644 --- a/data/ansible/integration_tests/go.yaml +++ b/data/ansible/integration_tests/go.yaml @@ -18,6 +18,7 @@ changed_when: false - name: Remove old installation of Go + become: yes file: path: /usr/local/go state: absent @@ -76,7 +77,7 @@ insertafter: last - name: Add GOROOT to PATH for root - become: yes + become: yes lineinfile: dest: ~/.bashrc line: export PATH=$PATH:$GOROOT/bin @@ -88,7 +89,7 @@ dest: ~/.bashrc line: export GOPATH='{{ golang_gopath }}' insertafter: last - + - name: Add GOPATH to PATH for root become: yes lineinfile: @@ -113,9 +114,9 @@ dest: ~/.bashrc line: export GOPATH='{{ golang_gopath }}' insertafter: last - + - name: Add GOPATH to PATH lineinfile: dest: ~/.bashrc line: export PATH=$PATH:$GOPATH/bin - insertafter: last \ No newline at end of file + insertafter: last diff --git a/data/ansible/integration_tests/main.yaml b/data/ansible/integration_tests/main.yaml index c00e399a2..f381bf9a2 100644 --- a/data/ansible/integration_tests/main.yaml +++ b/data/ansible/integration_tests/main.yaml @@ -6,6 +6,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 @@ -28,7 +29,7 @@ kafka_download_folder: "/home/{{ kafka_user }}/Downloads" kafka_install_folder: "/home/{{ kafka_user }}" # kafka_user_password: "123456y" - + ############################################################### # CGRateS location cgrates_dir: "{{ golang_gopath }}/src/github.com/cgrates/cgrates" @@ -40,9 +41,9 @@ ########################################################################################################################### # install dependencies - - name: Install build-essential + - name: Install build-essential apt: - name: build-essential + name: build-essential state: present - name: Install the git @@ -142,4 +143,3 @@ command: 'sh {{ cgrates_dir }}/data/storage/mongo/setup_cgr_db.sh' args: chdir: '{{ cgrates_dir }}/data/storage/mongo/' - diff --git a/data/ansible/packages/go.yaml b/data/ansible/packages/go.yaml index b76fae2f6..c08fae40b 100644 --- a/data/ansible/packages/go.yaml +++ b/data/ansible/packages/go.yaml @@ -18,6 +18,7 @@ changed_when: false - name: Remove old installation of Go + become: yes file: path: /usr/local/go state: absent @@ -76,7 +77,7 @@ insertafter: last - name: Add GOROOT to PATH for root - become: yes + become: yes lineinfile: dest: ~/.bashrc line: export PATH=$PATH:$GOROOT/bin @@ -88,7 +89,7 @@ dest: ~/.bashrc line: export GOPATH='{{ golang_gopath }}' insertafter: last - + - name: Add GOPATH to PATH for root become: yes lineinfile: @@ -113,9 +114,9 @@ dest: ~/.bashrc line: export GOPATH='{{ golang_gopath }}' insertafter: last - + - name: Add GOPATH to PATH lineinfile: dest: ~/.bashrc line: export PATH=$PATH:$GOPATH/bin - insertafter: last \ No newline at end of file + insertafter: last