| # 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: |
| ansible_user: root |
| 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.6/ruby-2.6.0.tar.gz |
| ruby_version: 2.6.0 |
| |
| - name: "Install dependency version of domain_name for PackageCloud" |
| command: "gem install domain_name -v 0.5.20190701" |
| become: true |
| |
| - 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 |