summaryrefslogtreecommitdiff
path: root/roles/apt-repo/kubernetes/tasks/main.yml
blob: 9198cb109eafc7b03dd0c8e2d651f32d38a63fbf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
- name: add repository key
  copy:
    src: repo.gpg
    dest: /etc/apt/keyrings/kubernetes.gpg
  register: apt_repo_kubernetes_key

- name: add repository entry
  copy:
    content: |
      deb [signed-by=/etc/apt/keyrings/kubernetes.gpg] {{ kubernetes_apt_repo_baseurl }}/v{{ ([0, 1] | map('extract', kubernetes_version.split('.'))) | join('.') }}/deb/ /
    dest: /etc/apt/sources.list.d/kubernetes.list
  register: apt_repo_kubernetes_sources

- name: update apt cache
  when: apt_repo_kubernetes_key is changed or
        apt_repo_kubernetes_sources is changed
  command: apt-get update