separate configuration, requirements and variables
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
---
|
||||
- ansible.builtin.include_vars:
|
||||
file: hashicorp_repo.yml
|
||||
name: _hashicorp
|
||||
- ansible.builtin.set_fact:
|
||||
pkgconfig_hashicorp: "{{ _hashicorp | ansible.builtin.combine(pkgconfig.hashicorp) }}"
|
||||
hashicorp: true
|
||||
|
||||
- name: RedHat repository
|
||||
when: ansible_os_family == 'RedHat'
|
||||
@@ -15,7 +12,7 @@
|
||||
- ansible_distribution_major_version|int >= 41
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig_hashicorp.Linux.Fedora.repo }}"
|
||||
cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.hashicorp.Linux.Fedora.repo }}"
|
||||
|
||||
- name: enable hashicorp repo for fedora <41
|
||||
become: true
|
||||
@@ -24,7 +21,7 @@
|
||||
- ansible_distribution_major_version|int < 41
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: "dnf config-manager --add-repo {{ pkgconfig_hashicorp.Linux.Fedora.repo }}"
|
||||
cmd: "dnf config-manager --add-repo {{ pkgconfig.hashicorp.Linux.Fedora.repo }}"
|
||||
|
||||
- name: enable hashicorp repo for RHEL like distribution
|
||||
become: true
|
||||
@@ -32,7 +29,7 @@
|
||||
- ansible_distribution != 'Fedora'
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: "dnf config-manager --add-repo {{ pkgconfig_hashicorp.Linux.RedHat.repo }}"
|
||||
cmd: "dnf config-manager --add-repo {{ pkgconfig.hashicorp.Linux.RedHat.repo }}"
|
||||
|
||||
- name: Debian based repository
|
||||
when: ansible_os_family == 'Debian'
|
||||
@@ -59,7 +56,7 @@
|
||||
|
||||
- name: enable hasicorp repo for debian
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "{{ pkgconfig_hashicorp.Linux.Debian.repo }}"
|
||||
repo: "{{ pkgconfig.hashicorp.Linux.Debian.repo }}"
|
||||
state: present
|
||||
update_cache: false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user