make the packages role more generic
This commit is contained in:
27
tasks/RedHat/hashicorp_repo.yml
Normal file
27
tasks/RedHat/hashicorp_repo.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
# install hashicorp vault for RedHat
|
||||
---
|
||||
- name: enable hashicorp repo for fedora >=41
|
||||
become: true
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_distribution_major_version|int >= 41
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: dnf config-manager addrepo --from-repofile=https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
|
||||
|
||||
- name: enable hashicorp repo for fedora <41
|
||||
become: true
|
||||
when:
|
||||
- ansible_distribution == 'Fedora'
|
||||
- ansible_distribution_major_version|int < 41
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
|
||||
|
||||
- name: enable hashicorp repo for RHEL like distribution
|
||||
become: true
|
||||
when:
|
||||
- ansible_distribution != 'Fedora'
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
|
||||
Reference in New Issue
Block a user