Commit f385fa8f authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

Fix Ansible playbook setup and build issues (#30)

parent 0c6efabf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,3 +7,4 @@ vendor/
dist/
bin
examples/demo1/bin
playbooks/ansible-venv/
+1 −1
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ prometheus:
    interval: 10s
    additionalLabels: {}
    relabelings: []
    scrapeTimeout: 5s
    scrapeTimeout: 15s
    
codecov:
  enabled: false
+2 −2
Original line number Diff line number Diff line
@@ -44,8 +44,8 @@ allowedCSROriginators=/*

[cse.registrar]
INCSEcseID=/$REMOTE_CSE_ID
;address=https://${basic.config:registrarCseHost}:${basic.config:registrarCsePort}/
;root=$REMOTE_SVC_PATH
address=https://${basic.config:registrarCseHost}:${basic.config:registrarCsePort}/
root=$REMOTE_SVC_PATH

[textui]
startWithTUI=false
+1 −2
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ docker_repo_arch: >-
    else ansible_facts['architecture']
  }}
docker_repo_codename: "{{ ansible_facts['lsb']['codename'] | default('jammy') }}"
docker_version: "5:29.2.1-1~ubuntu.{{ ansible_distribution_version }}~{{ docker_repo_codename }}" # Docker Version


# Kubernetes
@@ -64,7 +63,7 @@ helm_version: "v3.14.4"

# Development environment (optional role)
install_dev_env: true
go_version: "1.17"
go_version: "1.25.0"
go_tar: "go{{ go_version }}.linux-amd64.tar.gz"
go_url: "https://go.dev/dl/go{{ go_version }}.linux-amd64.tar.gz"
node_major: 20
+20 −2
Original line number Diff line number Diff line
@@ -12,18 +12,36 @@
  changed_when: false
  when: go_binary.stat.exists

- name: Download Go tarball
- name: Copy local Go tarball to /tmp if it exists
  copy:
    src: "{{ mec_sandbox_dir }}/go{{ go_version }}.linux-amd64.tar.gz"
    dest: "/tmp/go{{ go_version }}.linux-amd64.tar.gz"
    remote_src: true
    mode: "0644"
  register: local_go_tarball
  ignore_errors: true
  when: not go_binary.stat.exists or go_version_output.stdout is not search("go{{ go_version }}")

- name: Download Go tarball if local copy not found
  get_url:
    url: "https://go.dev/dl/go{{ go_version }}.linux-amd64.tar.gz"
    dest: "/tmp/go{{ go_version }}.linux-amd64.tar.gz"
    mode: "0644"
  when: (not go_binary.stat.exists or go_version_output.stdout is not search("go{{ go_version }}")) and (local_go_tarball is failed or local_go_tarball is skipped)

# Step 2: Remove old /usr/local/go and extract new one
- name: Remove old Go directory
  file:
    path: /usr/local/go
    state: absent
  become: true
  when: not go_binary.stat.exists or go_version_output.stdout is not search("go{{ go_version }}")

# Step 2: Extract to /usr/local
- name: Extract Go tarball to /usr/local
  shell: "tar -C /usr/local -xzf /tmp/go{{ go_version }}.linux-amd64.tar.gz"
  args:
    executable: /bin/bash
  become: true
  when: not go_binary.stat.exists or go_version_output.stdout is not search("go{{ go_version }}")

# Step 3: Create ~/gocode/bin directory
Loading