lot's of standardizing with the refacto

This commit is contained in:
Matthew Stobbs
2025-02-11 22:14:04 -07:00
parent 6d52cc6a4d
commit 9250145116
10 changed files with 384 additions and 209 deletions

View File

@@ -1,25 +1,19 @@
# vim: set filetype=yaml.ansible :
---
- ansible.builtin.include_vars:
file: alacritty.yml
name: _alacritty
- ansible.builtin.set_fact:
pkgconfig_alacritty: "{{ _alacritty | ansible.builtin.combine(pkgconfig.alacritty) }}"
- name: linux based installation
- name: Linux based installation
when: ansible_system == 'Linux'
block:
- name: install rust and cargo
- name: Install rust and cargo
ansible.builtin.include_tasks:
file: "pkgs/rust.yml"
when: pkgconfig_rust is undefined
- name: append to pkgs
set_fact:
syspkgs: "{{ syspkgs + pkgconfig_alacritty.deps[ansible_distribution] }}"
srcpkgs: "{{ srcpkgs + [ 'alacritty' ] }}"
- name: Append to pkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + alacritty.deps }}"
srcpkgs: "{{ cargopkgs + [alacritty] }}"
- name: append alacritty to caskpkgs
- name: Append alacritty to caskpkgs
ansible.builtin.set_fact:
caskpkgs: "{{ caskpkgs + [ 'alacritty' ] }}"
caskpkgs: "{{ caskpkgs + alacritty.pkgs }}"
when: ansible_system == 'Darwin'

View File

@@ -1,77 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: Set hashicorp flag
ansible.builtin.set_fact:
hashicorp: true
- name: RedHat repository
when:
- ansible_os_family == 'RedHat'
block:
- 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={{ pkgconfig.hashicorp.Linux.Fedora.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 {{ pkgconfig.hashicorp.Linux.Fedora.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 {{ pkgconfig.hashicorp.Linux.RedHat.repo }}"
- name: Debian based repository
when:
- ansible_os_family == 'Debian'
block:
- name: Create temporary directory
ansible.builtin.tempfile:
state: directory
prefix: hashicorp.
register: d_hashicorp_tmp
- name: Get hashicorp archive gpg key
ansible.builtin.get_url:
dest: "{{ d_hashicorp_tmp.path }}/gpg"
url: https://apt.releases.hashicorp.com/gpg
mode: '0644'
- name: Install hashicorp archive gpg key
become: true
ansible.builtin.command:
creates: /usr/share/keyrings/hashicorp-archive-keyring.gpg
cmd:
- gpg
- --dearmor
- -o
- /usr/share/keyrings/hashicorp-archive-keyring.gpg
- "{{ d_hashicorp_tmp.path }}/gpg"
- name: Enable hasicorp repo for debian
ansible.builtin.apt_repository:
repo: "{{ pkgconfig.hashicorp.Linux.Debian.repo }}"
state: present
update_cache: false
- name: MacOS specific configuration
when:
- ansible_distribution == 'MacOSX'
block:
- name: Enable hashicorp homebrew tap
when: ansible_os_family == 'Darwin'
ansible.builtin.set_fact:
brewtaps: "{{ brewtaps + ['hashicorp/tap'] }}"