Fix: Add caret to escape Jenkins vars
[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     golang_checksum: sha256:512103d7ad296467814a6e3f635631bd35574cab3369a97a323c9a585ccaa569
13
14   tasks:
15     - name: "Install GoLang {{golang_version}}"
16       block:
17         - name: "Fetch golang {{golang_version}} to /tmp/go{{golang_version}}.linux-amd64.tar.gz"
18           get_url:
19             url: "https://storage.googleapis.com/golang/go{{golang_version}}.linux-amd64.tar.gz"
20             dest: "/tmp/go{{golang_version}}.linux-amd64.tar.gz"
21             checksum: "{{golang_checksum}}"
22         - name: "Install golang {{golang_version}} to /usr/local"
23           unarchive:
24             src: "/tmp/go{{golang_version}}.linux-amd64.tar.gz"
25             dest: /usr/local
26             remote_src: true
27           become: true
28         - name: Create symbolic link to go bin
29           file:
30             src: "/usr/local/go/bin/go"
31             dest: "/usr/bin/go"
32             state: link
33           become: true
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"