diff --git a/tasks/pkgs/aquamarine.yml b/tasks/pkgs/aquamarine.yml index 13c7f20..ef249c9 100644 --- a/tasks/pkgs/aquamarine.yml +++ b/tasks/pkgs/aquamarine.yml @@ -4,7 +4,11 @@ when: - aquamarine_configured is undefined block: - - name: Load hyprland config + - name: Set aquamarine_configured + ansible.builtin.set_fact: + aquamarine_configured: true + + - name: Load aquamarine config when: - aquamarine is undefined ansible.builtin.include_tasks: @@ -23,7 +27,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + aquamarine.build_deps }}" pkg_src: "{{ pkg_src + ['aquamarine'] }}" - - - name: Set aquamarine_configured - ansible.builtin.set_fact: - aquamarine_configured: true diff --git a/tasks/pkgs/git.yml b/tasks/pkgs/git.yml index 8217cf3..185b74f 100644 --- a/tasks/pkgs/git.yml +++ b/tasks/pkgs/git.yml @@ -4,6 +4,10 @@ when: - git_configured is undefined block: + - name: Set git_configured + ansible.builtin.set_fact: + git_configured: true + - name: Load git config ansible.builtin.include_tasks: file: config/git.yml @@ -11,7 +15,3 @@ - name: Append to pkgs ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + git.pkgs }}" - - - name: Set git_configured - ansible.builtin.set_fact: - git_configured: true diff --git a/tasks/pkgs/hyprcursor.yml b/tasks/pkgs/hyprcursor.yml index 4822e08..a5fd7bb 100644 --- a/tasks/pkgs/hyprcursor.yml +++ b/tasks/pkgs/hyprcursor.yml @@ -4,6 +4,10 @@ when: - hyprcursor_configured is undefined block: + - name: Set hyprcursor_configured + ansible.builtin.set_fact: + hyprcursor_configured: true + - name: Load hyprcursor config when: - hyprcursor is undefined @@ -14,7 +18,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprcursor.build_deps }}" pkg_src: "{{ pkg_src + ['hyprcursor'] }}" - - - name: Set hyprcursor_configured - ansible.builtin.set_fact: - hyprcursor_configured: true diff --git a/tasks/pkgs/hyprgraphics.yml b/tasks/pkgs/hyprgraphics.yml index e6dfcc8..0b21dba 100644 --- a/tasks/pkgs/hyprgraphics.yml +++ b/tasks/pkgs/hyprgraphics.yml @@ -4,6 +4,10 @@ when: - hyprgraphics_configured is undefined block: + - name: Set hyprgraphics_configured + ansible.builtin.set_fact: + hyprgraphics_configured: true + - name: Load hyprgraphics config when: - hyprgraphics is undefined @@ -14,7 +18,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprgraphics.build_deps }}" pkg_src: "{{ pkg_src + ['hyprgraphics'] }}" - - - name: Set hyprgraphics_configured - ansible.builtin.set_fact: - hyprgraphics_configured: true diff --git a/tasks/pkgs/hyprland.yml b/tasks/pkgs/hyprland.yml index e80fe8c..99cc426 100644 --- a/tasks/pkgs/hyprland.yml +++ b/tasks/pkgs/hyprland.yml @@ -4,6 +4,10 @@ when: - hyprland_configured is undefined block: + - name: Set hyprland_configured + ansible.builtin.set_fact: + hyprland_configured: true + - name: Load hyprland config when: - hyprland is undefined @@ -23,7 +27,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprland.build_deps }}" pkg_src: "{{ pkg_src + ['hyprland'] }}" - - - name: Set hyprland_configured - ansible.builtin.set_fact: - hyprland_configured: true diff --git a/tasks/pkgs/hyprland_protocols.yml b/tasks/pkgs/hyprland_protocols.yml index 0cbc407..c88b009 100644 --- a/tasks/pkgs/hyprland_protocols.yml +++ b/tasks/pkgs/hyprland_protocols.yml @@ -4,6 +4,10 @@ when: - hyprland_protcols_configured is undefined block: + - name: Set hyprland_protcols_configured + ansible.builtin.set_fact: + hyprland_protcols_configured: true + - name: Load hyprland-protocols config when: - hyprland_protocols is undefined @@ -14,7 +18,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprland_protocols.build_deps }}" pkg_src: "{{ pkg_src + ['hyprland_protocols'] }}" - - - name: Set hyprland_protcols_configured - ansible.builtin.set_fact: - hyprland_protcols_configured: true diff --git a/tasks/pkgs/hyprlang.yml b/tasks/pkgs/hyprlang.yml index b788e26..475f418 100644 --- a/tasks/pkgs/hyprlang.yml +++ b/tasks/pkgs/hyprlang.yml @@ -2,8 +2,12 @@ --- - name: Add hyprlang when: - - hyprlang_configured + - hyprlang_configured is undefined block: + - name: Set hyprlang_configured + ansible.builtin.set_fact: + hyprlang_configured: true + - name: Load hyprlang config when: - hyprlang is undefined @@ -23,7 +27,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprlang.build_deps }}" pkg_src: "{{ pkg_src + ['hyprlang'] }}" - - - name: Set hyprlang_configured - ansible.builtin.set_fact: - hyprlang_configured: true diff --git a/tasks/pkgs/hyprutils.yml b/tasks/pkgs/hyprutils.yml index f9b6e74..3b57c65 100644 --- a/tasks/pkgs/hyprutils.yml +++ b/tasks/pkgs/hyprutils.yml @@ -4,6 +4,10 @@ when: - hyprutils_configured is undefined block: + - name: Set hyprutils_configured + ansible.builtin.set_fact: + hyprutils_configured: true + - name: Load hyprutils config when: - hyprutils is undefined @@ -14,7 +18,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprutils.build_deps }}" pkg_src: "{{ pkg_src + ['hyprutils'] }}" - - - name: Set hyprutils_configured - ansible.builtin.set_fact: - hyprutils_configured: true diff --git a/tasks/pkgs/hyprwayland_scanner.yml b/tasks/pkgs/hyprwayland_scanner.yml index 07d600b..933cf67 100644 --- a/tasks/pkgs/hyprwayland_scanner.yml +++ b/tasks/pkgs/hyprwayland_scanner.yml @@ -4,6 +4,10 @@ when: - hyprwayland_scanner_configured is undefined block: + - name: Set hyprwayland_scanner_configured + ansible.builtin.set_fact: + hyprwayland_scanner_configured: true + - name: Load hyprwayland-scanner config when: - hyprwayland_scanner is undefined @@ -16,7 +20,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + hyprwayland_scanner.build_deps }}" pkg_src: "{{ pkg_src + ['hyprwayland_scanner'] }}" - - - name: Set hyprwayland_scanner_configured - ansible.builtin.set_fact: - hyprwayland_scanner_configured: true diff --git a/tasks/pkgs/uwsm.yml b/tasks/pkgs/uwsm.yml index 69c881b..6fbe56d 100644 --- a/tasks/pkgs/uwsm.yml +++ b/tasks/pkgs/uwsm.yml @@ -4,7 +4,13 @@ when: - uwsm_configured is undefined block: + - name: Set uwsm_configured + ansible.builtin.set_fact: + uwsm_configured: true + - name: Load uwsm config + when: + - uwsm is undefined ansible.builtin.include_tasks: file: config/uwsm.yml @@ -12,7 +18,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + uwsm.build_deps + uswm.deps }}" pkg_src: "{{ pkg_src + ['uwsm'] }}" - - - name: Set uwsm_configured - ansible.builtin.set_fact: - uwsm_configured: true diff --git a/tasks/pkgs/xdg_desktop_portal_hyprland.yml b/tasks/pkgs/xdg_desktop_portal_hyprland.yml index 9b206c0..dac180a 100644 --- a/tasks/pkgs/xdg_desktop_portal_hyprland.yml +++ b/tasks/pkgs/xdg_desktop_portal_hyprland.yml @@ -4,6 +4,10 @@ when: - xdg_desktop_portal_hyprland_configured is undefined block: + - name: Set xdg_desktop_portal_hyprland_configured + ansible.builtin.set_fact: + xdg_desktop_portal_hyprland_configured: true + - name: Load xdg-desktop-portal-hyprland config when: - xdg_desktop_portal_hyprland is undefined @@ -23,7 +27,3 @@ ansible.builtin.set_fact: pkg_sys: "{{ pkg_sys + xdg_desktop_portal_hyprland.build_deps }}" pkg_src: "{{ pkg_src + ['xdg_desktop_portal_hyprland'] }}" - - - name: Set xdg_desktop_portal_hyprland_configured - ansible.builtin.set_fact: - xdg_desktop_portal_hyprland_configured: true diff --git a/tasks/repos/hashicorp.yml b/tasks/repos/hashicorp.yml index 13ecd46..9962b96 100644 --- a/tasks/repos/hashicorp.yml +++ b/tasks/repos/hashicorp.yml @@ -1,57 +1,49 @@ # vim: set filetype=yaml.ansible : --- -- name: Add hashicorp +- name: Load hashicorp repo config + ansible.builtin.include_tasks: + file: config/hashicorp.yml + +- name: RedHat repository when: - - hashicorp_configured is undefined + - ansible_os_family == 'RedHat' block: - - name: Load hashicorp repo config - ansible.builtin.include_tasks: - file: config/hashicorp.yml + - name: Enable hashicorp repo + become: true + ansible.builtin.get_url: + url: "{{ hashicorp.repo }}" + dest: /etc/yum.repos.d/hashicorp.repo + mode: '0644' - - name: RedHat repository - when: - - ansible_os_family == 'RedHat' - block: - - name: Enable hashicorp repo - become: true - ansible.builtin.get_url: - url: "{{ hashicorp.repo }}" - dest: /etc/yum.repos.d/hashicorp.repo - mode: '0644' +- name: Debian based repository + when: + - ansible_os_family == 'Debian' + block: + - name: Get hashicorp archive gpg key + ansible.builtin.get_url: + dest: "{{ d_tempdir.path }}/hashicorp_gpg" + url: https://apt.releases.hashicorp.com/gpg + mode: '0644' - - name: Debian based repository - when: - - ansible_os_family == 'Debian' - block: - - name: Get hashicorp archive gpg key - ansible.builtin.get_url: - dest: "{{ d_tempdir.path }}/hashicorp_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_tempdir.path }}/hashicorp_gpg" - - 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_tempdir.path }}/hashicorp_gpg" + - name: Enable hasicorp repo for debian + ansible.builtin.apt_repository: + repo: "{{ pkgconfig.hashicorp.Linux.Debian.repo }}" + state: present + update_cache: false - - 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' - ansible.builtin.set_fact: - brewtap: "{{ brewtap + ['hashicorp/tap'] }}" - - - name: Set hashicorp_configured - ansible.builtin.set_fact: - hashicorp_configured: true +- name: MacOS specific configuration + when: + - ansible_distribution == 'MacOSX' + ansible.builtin.set_fact: + brewtap: "{{ brewtap + ['hashicorp/tap'] }}" diff --git a/tasks/repos/terra.yml b/tasks/repos/terra.yml index a5feb1f..cc36c3e 100644 --- a/tasks/repos/terra.yml +++ b/tasks/repos/terra.yml @@ -1,33 +1,25 @@ # vim: set filetype=yaml.ansible : --- -- name: Add terra +- name: Enable terra repo for fedora when: - - terra_configured is undefined + - ansible_distribution == 'Fedora' block: - - name: Enable terra repo for fedora - when: - - ansible_distribution == 'Fedora' - block: - - name: Enable terra repo for fedora >=41 - become: true - when: ansible_distribution_major_version|int >= 41 - ansible.builtin.command: - creates: /etc/yum.repos.d/terra.repo - cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.terrarepo.repo }}" + - name: Enable terra repo for fedora >=41 + become: true + when: ansible_distribution_major_version|int >= 41 + ansible.builtin.command: + creates: /etc/yum.repos.d/terra.repo + cmd: "dnf config-manager addrepo --from-repofile={{ pkgconfig.terrarepo.repo }}" - - name: Enable terra repo for fedora < 41 - become: true - when: ansible_distribution_major_version|int < 41 - ansible.builtin.command: - creates: /etc/yum.repos.d/terra.repo - cmd: "dnf config-manager --add-repo {{ pkgconfig.terrarepo.repo }}" + - name: Enable terra repo for fedora < 41 + become: true + when: ansible_distribution_major_version|int < 41 + ansible.builtin.command: + creates: /etc/yum.repos.d/terra.repo + cmd: "dnf config-manager --add-repo {{ pkgconfig.terrarepo.repo }}" - - name: Install terra release package - become: true - ansible.builtin.dnf: - name: terra-release - state: present - - - name: Set terra_configured - ansible.builtin.set_fact: - terra_configured: true + - name: Install terra release package + become: true + ansible.builtin.dnf: + name: terra-release + state: present