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