Merge "[validation] Build images for 2.0.1 tag"
[ci-management.git] / packer / provision / helm.yaml
1 ---
2 - import_playbook: ../common-packer/provision/docker.yaml
3
4 - hosts: all
5   become_user: root
6   become_method: sudo
7
8   vars:
9     golang_version: 1.13.5
10     helm_version: 2.16.1
11     kubectl_version: 1.16.3
12
13   tasks:
14     - name: 'Install GoLang {{golang_version}}'
15       block:
16         - name: 'Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-amd64.tar.gz'
17           get_url:
18             url: 'https://storage.googleapis.com/golang/go{{golang_version}}.linux-amd64.tar.gz'
19             dest: '/tmp/go{{golang_version}}.linux-amd64.tar.gz'
20             checksum: '{{golang_checksum}}'
21         - name: 'Install golang {{golang_version}} to /usr/local'
22           unarchive:
23             src: '/tmp/go{{golang_version}}.linux-amd64.tar.gz'
24             dest: /usr/local
25             remote_src: true
26           become: true
27         - name: Create symbolic link to go bin
28           file:
29             src: "/usr/local/go/bin/go"
30             dest: "/usr/bin/go"
31             state: link
32           become: true
33
34     - name: 'Install kubectl {{kubectl_version}}'
35       get_url:
36         url: https://storage.googleapis.com/kubernetes-release/release/v{{kubectl_version}}/bin/linux/amd64/kubectl
37         dest: /usr/local/bin/kubectl
38         mode: 0775
39       become: yes
40
41     - name: 'Install Helm {{helm_version}}'
42       block:
43         - name: 'Fetch tar.gz'
44           get_url:
45             url: https://get.helm.sh/helm-v{{helm_version}}-linux-amd64.tar.gz
46             dest: /tmp/helm-v{{helm_version}}-linux-amd64.tar.gz
47         - name: 'Unarchive'
48           unarchive:
49             src: /tmp/helm-v{{helm_version}}-linux-amd64.tar.gz
50             dest: /tmp
51             remote_src: true
52           become: yes
53         - name: 'Move helm to /usr/local/bin and set as executable'
54           command: 'mv /tmp/linux-amd64/helm /usr/local/bin/helm'
55           become: yes
56         - name: 'Check helm.'
57           command: 'which helm'
58         - name: 'Check kubectl.'
59           command: 'which kubectl'
60