Modifying default variables and config

Renamed variables for defaults:
- flatpak_method -> default_flatpak_method: system
- defaults.paths.prefix -> default_install_prefix: /usr/local
New variables:
- default_install_method: package
This commit is contained in:
Matthew Stobbs
2026-01-24 19:52:56 -07:00
parent fe364e2b6d
commit e021d5ebac
15 changed files with 85 additions and 53 deletions

5
tasks/helpers/addpkg.yml Normal file
View File

@@ -0,0 +1,5 @@
# vim: set filetype=yaml.ansible :
---
- name: "Add include task for {{ pkg }}"
ansible.builtin.include_tasks:
file: "pkgs/{{ pkg }}.yml"

View File

@@ -0,0 +1,26 @@
# vim: set filetype=yaml.ansible :
---
- name: Install appimage {{ pkg }}
become: "{{ ext_become }}"
block:
- name: Ensure appimage path exists
ansible.builtin.file:
path: "{{ path.appimage }}/{{ appimage_link_name }}"
mode: '0755'
state: directory
- name: Fetch appimage
become: "{{ ext_become }}"
ansible.builtin.get_url:
mode: '0755'
decompress: false
backup: true
url: "{{ appimage_url }}"
dest: "{{ path.appimage }}/{{ appimage_link_name }}/{{ appimage_file }}"
- name: Link appimage to bin
become: "{{ ext_become }}"
ansible.builtin.file:
state: link
src: "{{ path.appimage }}/{{ appimage_link_name }}/{{ appimage_file }}"
path: "{{ path.bindir }}/{{ appimage_link_name }}"

11
tasks/helpers/cargo.yml Normal file
View File

@@ -0,0 +1,11 @@
# vim: set filetype=yaml.ansible
---
- name: Install cargo {{ pkg }}
become: "{{ ext_become }}"
environment:
RUSTONIG_SYSTEM_LIBONIG: 1
community.general.cargo:
name: "{{ pkg.name | default(pkg) }}"
version: "{{ pkg.vers | default(omit) }}"
path: "{{ path.cargo | default(path.prefix) }}"
locked: "{{ pkg.locked | default(omit) }}"

View File

@@ -50,6 +50,7 @@
group: root
mode: "0755"
state: directory
- name: Copy extra files
loop: "{{ install_files | dict2items }}"
loop_control:

View File

@@ -0,0 +1,9 @@
# vim: set filetype=yaml.ansible :
---
- name: Install flatpak
become: "{{ ext_become }}"
community.general.flatpak:
method: "{{ pkg_method }}"
remote: "{{ pkg_remote }}"
name: "{{ pkg_name }}"
state: present

View File

@@ -0,0 +1,10 @@
# vim: set filetype=yaml.ansible :
---
- name: Add flatpak remote
become: "{{ ext_become }}"
community.general.flatpak_remote:
enabled: "{{ remote_enabled }}"
flatpakrepo_url: "{{ remote_url }}"
method: "{{ remote_method }}"
name: "{{ remote_name }}"
state: "{{ remote_state }}"

9
tasks/helpers/go.yml Normal file
View File

@@ -0,0 +1,9 @@
# vim: set filetype=yaml.ansible :
---
- name: Install go package {{ pkg }}
become: "{{ ext_become }}"
environment:
GOBIN: "{{ path.bin }}"
PATH: "{{ path.go }}/bin:$PATH"
ansible.builtin.command:
cmd: go install {{ pkg }}

8
tasks/helpers/npm.yml Normal file
View File

@@ -0,0 +1,8 @@
# vim: set filetype=yaml.ansible :
---
- name: Install npm {{ pkg }}
become: true
community.general.npm:
global: true
name: "{{ pkg }}"
state: present

11
tasks/helpers/pipx.yml Normal file
View File

@@ -0,0 +1,11 @@
# vim: set filetype=yaml.ansible :
---
- name: Install pipx {{ pkg }}
become: "{{ ext_become }}"
environment:
PIPX_HOME: "{{ path.pipx }}"
PIPX_BIN_DIR: "{{ path.bin }}"
community.general.pipx:
executable: "{{ pipx_exec }}"
name: "{{ pkg }}"
state: latest