Files
ansible_role_package/tasks/RedHat/hashicorp_repo.yml
2025-01-18 09:24:11 -07:00

28 lines
993 B
YAML

# 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