Chore: Automation adds ric-plt-stslgo.yaml
[ci-management.git] / packer / provision / local-docker.yaml
1 # This Ansible playbook adds packages to the
2 # O-RAN-SC build minion image that has Docker.
3 ---
4 - import_playbook: ../common-packer/provision/docker.yaml
5
6 - hosts: all
7   become_user: root
8   become_method: sudo
9
10   vars:
11     golang_version: 1.17
12     gopath: '/opt/go/{{golang_version}}/bin'
13
14   pre_tasks:
15     - include_role: name=lfit.system-update
16
17   tasks:
18     - include_role:
19         name: geerlingguy.ruby
20       vars:
21         ruby_install_gems:
22           - rake
23         ruby_install_bundler: false
24         ruby_install_from_source: true
25         ansible_become: true
26         ruby_download_url: http://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz
27         ruby_version: 2.5.1
28
29     - name: 'Install PackageCloud'
30       command: 'gem install package_cloud'
31       become: true
32
33     - include_role:
34         name: gantsign.golang
35       vars:
36         ansible_become: true
37
38     - name: Add Go to Ubuntu path
39       lineinfile:
40         path: /etc/environment
41         regexp: 'PATH=(["]*)((?!.*?{{gopath}}).*?)(["]*)$'
42         line: 'PATH=\1\2:{{gopath}}\3'
43         backrefs: yes
44       when: ansible_distribution == 'Ubuntu'
45       become: yes