d82a48d51c3c63a4fa9920ef13b308b31de04ef0
[ci-management.git] / 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
27     - name: 'Install PackageCloud'
28       command: 'gem install package_cloud'
29       become: true
30
31     - include_role:
32         name: gantsign.golang
33       vars:
34         ansible_become: true
35
36     - name: Add Go to Ubuntu path
37       lineinfile:
38         path: /etc/environment
39         regexp: 'PATH=(["]*)((?!.*?{{gopath}}).*?)(["]*)$'
40         line: 'PATH=\1\2:{{gopath}}\3'
41         backrefs: yes
42       when: ansible_distribution == 'Ubuntu'
43       become: yes