aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/noheat/cluster-rke/ansible/roles/setup_helm/tasks/main.yml
blob: c742fff7a34d5f9cc73a6b2e4331020904cb5874 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
- name: Download helm
  get_url:
    url: "https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz"
    dest: "/tmp"
    mode: '0400'

- name: Unarchive helm
  unarchive:
    src: "/tmp/helm-v{{ helm_version }}-linux-amd64.tar.gz"
    dest: "/tmp/"
    mode: '0500'

- name: Copy helm binary to $PATH
  become: yes
  copy:
    src: "/tmp/linux-amd64/helm"
    dest: "/usr/local/bin/"
    mode: '0555'

- name: Install Helm Push plugin
  kubernetes.core.helm_plugin:
    plugin_path: "https://github.com/chartmuseum/helm-push.git"
    state: present

- name: Install Helm OOM Deploy plugin
  kubernetes.core.helm_plugin:
    plugin_path: "{{ oom_dir }}/kubernetes/helm/plugins/deploy"
    state: present

- name: Install Helm OOM Undeploy plugin
  kubernetes.core.helm_plugin:
    plugin_path: "{{ oom_dir }}/kubernetes/helm/plugins/undeploy"
    state: present

- name: Download chartmuseum install script
  get_url:
    url: "https://raw.githubusercontent.com/helm/chartmuseum/v{{ chartmuseum_version }}/scripts/get-chartmuseum"
    dest: "/tmp/"
    mode: '0500'

- name: Install chartmuseum
  become: yes
  command:
    cmd: "./get-chartmuseum -v v{{ chartmuseum_version }}"
    chdir: "/tmp/"

- name: Create chartmuseum local storage
  file:
    name: "{{ chartmuseum_dir }}"
    state: directory
    mode: '0755'

- name: Install chartmuseum service file
  become: yes
  template:
    src: "chartmuseum.service.j2"
    dest: "/etc/systemd/system/chartmuseum.service"
    mode: '0444'
  notify: Reload systemd

- name: Start and enable chartmuseum
  become: yes
  service:
    name: "chartmuseum"
    state: started
    enabled: yes

- name: Add local Helm repository
  kubernetes.core.helm_repository:
    name: "local"
    repo_url: "http://127.0.0.1:{{ chartmuseum_port }}"
    state: present