clean up, refactor, documentation

- reducing amount of splitting in configs
- documenting configuration
This commit is contained in:
Matthew Stobbs
2025-01-24 23:23:24 -07:00
parent f8585192d5
commit 2f3690aded
34 changed files with 425 additions and 307 deletions

View File

@@ -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