Skip to content

Commit

Permalink
e2e: fix broken ansible playbook (ubuntu)
Browse files Browse the repository at this point in the history
Signed-off-by: Feruzjon Muyassarov <[email protected]>
  • Loading branch information
fmuyassarov committed Jun 24, 2024
1 parent 82131f9 commit 427ffca
Showing 1 changed file with 50 additions and 6 deletions.
56 changes: 50 additions & 6 deletions test/e2e/playbook/provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,34 @@
state: present
when: ansible_facts['distribution'] == "Ubuntu"

- name: Add apt repository for Kubernetes
ansible.builtin.apt_repository:
repo: "https://pkgs.k8s.io/core:/stable:/v{{ k8s_version }}/deb/ /"
state: present
filename: /etc/apt/sources.list.d/kubernetes.list
- name: Add Kubernetes APT repository to sources.list.d
ansible.builtin.copy:
content: "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v{{ k8s_version }}/deb/ /"
dest: /etc/apt/sources.list.d/kubernetes.list
mode: '0644'
when: ansible_facts['distribution'] == "Ubuntu"

- name: Download Kubernetes APT key
ansible.builtin.get_url:
url: https://pkgs.k8s.io/core:/stable:/v{{ k8s_version }}/deb/Release.key
dest: /tmp/kubernetes-release.key
mode: '0644'
when: ansible_facts['distribution'] == "Ubuntu"

- name: Convert the Kubernetes APT key to keyring format
ansible.builtin.command:
cmd: gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg /tmp/kubernetes-release.key
when: ansible_facts['distribution'] == "Ubuntu"

- name: Clean up temporary key file
ansible.builtin.file:
path: /tmp/kubernetes-release.key
state: absent
when: ansible_facts['distribution'] == "Ubuntu"

- name: Update APT package index
ansible.builtin.apt:
update_cache: yes
when: ansible_facts['distribution'] == "Ubuntu"

- name: Add yum repository for Kubernetes
Expand All @@ -74,6 +97,28 @@
name: kubernetes
when: ansible_facts['distribution'] == "Fedora"

- name: Download the Helm install script
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
dest: /tmp/get_helm.sh
mode: '0644'

- name: Change permissions to make the script executable
ansible.builtin.file:
path: /tmp/get_helm.sh
mode: '0700'
state: file

- name: Execute the Helm install script
ansible.builtin.command:
cmd: /tmp/get_helm.sh

- name: Clean up the Helm install script
ansible.builtin.file:
path: /tmp/get_helm.sh
state: absent


- name: Install common packages
ansible.builtin.package:
name:
Expand All @@ -85,7 +130,6 @@
- kubeadm
- kubectl
- systemd-container
- helm
state: present

- name: Install apt packages
Expand Down

0 comments on commit 427ffca

Please sign in to comment.