clean up, refactor, documentation
- reducing amount of splitting in configs - documenting configuration
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
- ansible.builtin.include_vars:
|
||||
file: hashicorp_repo.yml
|
||||
name: _hashicorp
|
||||
- ansible.builtin.set_fact:
|
||||
pkgconfig.hashicorp: "{{ _hashicorp | ansible.builtin.combine(pkgonfig.hashicorp) }}"
|
||||
|
||||
- name: RedHat repository
|
||||
when: ansible_os_family == 'RedHat'
|
||||
@@ -13,7 +15,7 @@
|
||||
- ansible_distribution_major_version|int >= 41
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: "dnf config-manager addrepo --from-repofile={{ _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
|
||||
@@ -22,7 +24,7 @@
|
||||
- ansible_distribution_major_version|int < 41
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: "dnf config-manager --add-repo {{ _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
|
||||
@@ -30,7 +32,7 @@
|
||||
- ansible_distribution != 'Fedora'
|
||||
ansible.builtin.command:
|
||||
creates: /etc/yum.repos.d/hashicorp.repo
|
||||
cmd: "dnf config-manager --add-repo {{ _hashicorp.Linux.RedHat.repo }}"
|
||||
cmd: "dnf config-manager --add-repo {{ pkgconfig.hashicorp.Linux.RedHat.repo }}"
|
||||
|
||||
- name: Debian based repository
|
||||
when: ansible_os_family == 'Debian'
|
||||
@@ -57,7 +59,7 @@
|
||||
|
||||
- name: enable hasicorp repo for debian
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "{{ _hashicorp.Linux.Debian.repo }}"
|
||||
repo: "{{ pkgconfig.hashicorp.Linux.Debian.repo }}"
|
||||
state: present
|
||||
update_cache: false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user