Refactor: JJB code
[ci-management.git] / packer / provision / local-docker.yaml
deleted file mode 120000 (symlink)
index a60e9be9464aa504f510bbad60e80b67a771432d..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../common-packer/provision/local-docker.yaml
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..2f5b9629b746894fd509f1043eb2cec17fff4641
--- /dev/null
@@ -0,0 +1,45 @@
+# This Ansible playbook adds packages to the
+# O-RAN-SC build minion image that has Docker.
+---
+- import_playbook: ../common-packer/provision/docker.yaml
+
+- hosts: all
+  become_user: root
+  become_method: sudo
+
+  vars:
+    golang_version: 1.19
+    gopath: "/opt/go/{{golang_version}}/bin"
+
+  pre_tasks:
+    - include_role: name=lfit.system-update
+
+  tasks:
+    - include_role:
+        name: geerlingguy.ruby
+      vars:
+        ruby_install_gems:
+          - rake
+        ruby_install_bundler: false
+        ruby_install_from_source: true
+        ansible_become: true
+        ruby_download_url: http://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz
+        ruby_version: 2.5.1
+
+    - name: "Install PackageCloud"
+      command: "gem install package_cloud"
+      become: true
+
+    - include_role:
+        name: gantsign.golang
+      vars:
+        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