Skip to content

Commit 6aced61

Browse files
authored
Merge pull request #1632 from phuhung273/fix-amazon-2
fix(amazon-2): epel, install kubernetes steps
2 parents 6f7047c + d40aaee commit 6aced61

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

images/capi/ansible/roles/kubernetes/tasks/redhat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
allow_downgrade: true
2727
state: present
2828
lock_timeout: 60
29+
disable_excludes: "kubernetes"
30+
disable_plugin: "priorities"
2931
vars:
3032
packages:
3133
- kubelet-{{ kubernetes_rpm_version }}

images/capi/ansible/roles/setup/tasks/redhat.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,30 @@
2626
- name: Perform dnf clean
2727
ansible.builtin.command: /usr/bin/yum -y clean all
2828

29+
- name: Enable the EPEL repository
30+
ansible.builtin.command: amazon-linux-extras enable epel
31+
args:
32+
creates: /etc/yum.repos.d/epel.repo
33+
when: packer_builder_type.startswith('amazon')
34+
35+
- name: Install EPEL package
36+
ansible.builtin.yum:
37+
name: epel-release
38+
state: present
39+
when: packer_builder_type.startswith('amazon')
40+
2941
- name: Import epel gpg key
3042
ansible.builtin.rpm_key:
3143
state: present
3244
key: "{{ epel_rpm_gpg_key }}"
33-
when: epel_rpm_gpg_key != ""
45+
when: epel_rpm_gpg_key != "" and not packer_builder_type.startswith('amazon')
3446

3547
- name: Add epel repo
3648
ansible.builtin.yum:
3749
name: "{{ redhat_epel_rpm }}"
3850
state: present
3951
lock_timeout: 60
40-
when: redhat_epel_rpm != ""
52+
when: redhat_epel_rpm != "" and not packer_builder_type.startswith('amazon')
4153

4254
- ansible.builtin.import_tasks: rpm_repos.yml
4355

0 commit comments

Comments
 (0)