Chore: Archive gnb-int/build project
[ci-management.git] / packer / provision / local-docker.yaml
index fb158e8..d82a48d 100644 (file)
@@ -7,6 +7,10 @@
   become_user: root
   become_method: sudo
 
+  vars:
+    golang_version: 1.17
+    gopath: '/opt/go/{{golang_version}}/bin'
+
   pre_tasks:
     - include_role: name=lfit.system-update
 
     - include_role:
         name: gantsign.golang
       vars:
-        golang_version: 1.12
         ansible_become: true
+
+    - name: Add Go to Ubuntu path
+      lineinfile:
+        path: /etc/environment
+        regexp: 'PATH=(["]*)((?!.*?{{gopath}}).*?)(["]*)$'
+        line: 'PATH=\1\2:{{gopath}}\3'
+        backrefs: yes
+      when: ansible_distribution == 'Ubuntu'
+      become: yes