noheat: improvements for infra setup and Helm push plugin
[integration.git] / deployment / noheat / cluster-rke / ansible / roles / setup_helm / tasks / main.yml
1 - name: Download helm
2   get_url:
3     url: "https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz"
4     dest: "/tmp"
5
6 - name: Unarchive helm
7   unarchive:
8     src: "/tmp/helm-v{{ helm_version }}-linux-amd64.tar.gz"
9     dest: "/tmp/"
10     remote_src: yes
11
12 - name: Copy helm binary to $PATH
13   become: yes
14   copy:
15     src: "/tmp/linux-amd64/helm"
16     dest: "/usr/local/bin/"
17     remote_src: yes
18     mode: '0555'
19
20 - name: Install Helm Push plugin
21   command: helm plugin install --version 0.9.0 https://github.com/chartmuseum/helm-push.git
22
23 - name: Install Helm OOM Deploy plugin
24   kubernetes.core.helm_plugin:
25     plugin_path: "{{ oom_dir }}/kubernetes/helm/plugins/deploy"
26     state: present
27
28 - name: Install Helm OOM Undeploy plugin
29   kubernetes.core.helm_plugin:
30     plugin_path: "{{ oom_dir }}/kubernetes/helm/plugins/undeploy"
31     state: present
32
33 - name: Download chartmuseum install script
34   get_url:
35     url: "https://raw.githubusercontent.com/helm/chartmuseum/v{{ chartmuseum_version }}/scripts/get-chartmuseum"
36     dest: "/tmp/"
37     mode: '700'
38
39 - name: Install chartmuseum
40   become: yes
41   command:
42     cmd: "./get-chartmuseum -v v{{ chartmuseum_version }}"
43     chdir: "/tmp/"
44
45 - name: Create chartmuseum local storage
46   file:
47     name: "{{ chartmuseum_dir }}"
48     state: directory
49     mode: '0755'
50
51 - name: Install chartmuseum service file
52   become: yes
53   template:
54     src: "chartmuseum.service.j2"
55     dest: "/etc/systemd/system/chartmuseum.service"
56     mode: '0444'
57   notify: Reload systemd
58
59 - name: Start and enable chartmuseum
60   become: yes
61   service:
62     name: "chartmuseum"
63     state: started
64     enabled: yes
65
66 - name: Add local Helm repository
67   kubernetes.core.helm_repository:
68     name: "local"
69     repo_url: "http://127.0.0.1:{{ chartmuseum_port }}"
70     state: present