basic installs working

need to run tests on all the builds alone, should use a container system
This commit is contained in:
2026-03-27 22:04:05 -06:00
parent 7f00bb70dc
commit 3a39c083a8
15 changed files with 154 additions and 25 deletions

View File

@@ -1,10 +1,10 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: Install appimages - name: Install appimages {{ appimage.name }}
become: "{{ install_become }}" become: "{{ install_become }}"
become_user: "{{ install_become_user }}" become_user: "{{ install_become_user }}"
block: block:
- name: Ensure appimage path exists - name: Ensure appimage path exists {{ appimage.name }}
ansible.builtin.file: ansible.builtin.file:
path: "{{ path_appimage }}/{{ appimage.name }}" path: "{{ path_appimage }}/{{ appimage.name }}"
mode: "{{ appimage.mode | default('0755') }}" mode: "{{ appimage.mode | default('0755') }}"
@@ -12,7 +12,7 @@
group: "{{ appimage.group | default(ansible_user_gid) }}" group: "{{ appimage.group | default(ansible_user_gid) }}"
state: directory state: directory
- name: Fetch appimage - name: Fetch appimage {{ appimage.name }}
ansible.builtin.get_url: ansible.builtin.get_url:
mode: "{{ appimage.mode | default('0755') }}" mode: "{{ appimage.mode | default('0755') }}"
owner: "{{ appimage.owner | default(ansible_user_id) }}" owner: "{{ appimage.owner | default(ansible_user_id) }}"
@@ -22,7 +22,7 @@
decompress: false decompress: false
backup: false backup: false
- name: Link appimage to bin - name: Link appimage to bin {{ appimage.name }}
vars: vars:
links: links:
- from: "{{ path_appimage }}/{{ appimage.name }}/{{ appimage.filename }}" - from: "{{ path_appimage }}/{{ appimage.name }}/{{ appimage.filename }}"

View File

@@ -13,7 +13,7 @@
- archive.name is defined - archive.name is defined
- archive.url is defined - archive.url is defined
block: block:
- name: Extract archive to given path - name: Extract archive to given path {{ archive.name }}
block: block:
- name: Ensure directory exists - name: Ensure directory exists
become: "{{ install_become }}" become: "{{ install_become }}"
@@ -25,7 +25,7 @@
owner: "{{ archive.owner | default(ansible_facts['user_id']) }}" owner: "{{ archive.owner | default(ansible_facts['user_id']) }}"
group: "{{ archive.group | default(ansible_facts['user_gid']) }}" group: "{{ archive.group | default(ansible_facts['user_gid']) }}"
- name: Download archive to cache - name: Download archive to cache {{ archive.name }}
ansible.builtin.get_url: ansible.builtin.get_url:
dest: "{{ d_cache.path }}/{{ archive.name }}" dest: "{{ d_cache.path }}/{{ archive.name }}"
url: "{{ archive.url }}" url: "{{ archive.url }}"
@@ -33,7 +33,7 @@
decompress: false decompress: false
mode: '0644' mode: '0644'
- name: Extract archive - name: Extract archive {{ archive.name }}
become: "{{ install_become }}" become: "{{ install_become }}"
become_user: "{{ install_become_user }}" become_user: "{{ install_become_user }}"
ansible.builtin.unarchive: ansible.builtin.unarchive:
@@ -43,7 +43,7 @@
include: "{{ archive.include | default(omit) }}" include: "{{ archive.include | default(omit) }}"
exclude: "{{ archive.exclude | default(omit) }}" exclude: "{{ archive.exclude | default(omit) }}"
- name: Symlink archive files - name: Symlink archive files {{ archive.name }}
when: when:
- archive.links is defined - archive.links is defined
- archive.links | length > 0 - archive.links | length > 0

View File

@@ -1,4 +1,11 @@
# vim: set filetype=yaml.ansible # vim: set filetype=yaml.ansible
#
## Helper: cargo.yml
## Description: Install packages using the cargo command
## Variables: top level 'dict'
## name: package name on cargo
## version: cargo version, omitted if empty
## locked: _bool_, optional. Default false
--- ---
- name: Dump install vars - name: Dump install vars
ansible.builtin.debug: ansible.builtin.debug:

View File

@@ -1,4 +1,15 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
#
## Helper: cargo_buil.yml
## Description: download source, build and install using cargo
## Variables: top level 'dict'
## source_dir: git source directory
## repo: git repository url
## depth: _int_ optional, Default 1. Git depth to clone
## force_git: _bool_ optional, default true. Force clone, overwriting existing dir
## recursive: _bool_ optional, default true. Do a recursive clone
## version: _string_ optional, default 'latest'. Version to checkout and build
## build_flags: _list[str]_ optional. If set, will append these to the build command
--- ---
- name: Cargo source install helper - name: Cargo source install helper
block: block:

View File

@@ -15,6 +15,7 @@
- name: Run configure target - name: Run configure target
when: when:
- pkg.target.configure is defined - pkg.target.configure is defined
register: make_configure
community.general.make: community.general.make:
chdir: "{{ pkg.path }}" chdir: "{{ pkg.path }}"
target: "{{ pkg.target.configure.name }}" target: "{{ pkg.target.configure.name }}"
@@ -23,6 +24,7 @@
- name: Run build target - name: Run build target
when: when:
- pkg.target.build is defined - pkg.target.build is defined
register: make_build
community.general.make: community.general.make:
chdir: "{{ pkg.path }}" chdir: "{{ pkg.path }}"
target: "{{ pkg.target.build.name }}" target: "{{ pkg.target.build.name }}"
@@ -41,14 +43,18 @@
loop: "{{ pkg.targets.preinstall }}" loop: "{{ pkg.targets.preinstall }}"
loop_control: loop_control:
loop_var: target loop_var: target
register: make_preinstall
community.general.make: community.general.make:
chdir: "{{ pkg.path }}" chdir: "{{ pkg.path }}"
target: "{{ target.name }}" target: "{{ target.name }}"
params: "{{ target.params | default(omit) }}" params: "{{ target.params | default(omit) }}"
- name: Run install target - name: Run install target
become: "{{ install_become }}"
become_user: "{{ install_become_user }}"
when: when:
- pkg.targets.install is defined - pkg.targets.install is defined
register: make_install
community.general.make: community.general.make:
chdir: "{{ pkg.path }}" chdir: "{{ pkg.path }}"
target: "{{ pkg.targets.install.name }}" target: "{{ pkg.targets.install.name }}"
@@ -60,6 +66,7 @@
loop: "{{ pkg.targets.postinstall }}" loop: "{{ pkg.targets.postinstall }}"
loop_control: loop_control:
loop_var: target loop_var: target
register: make_postinstall
community.general.make: community.general.make:
chdir: "{{ pkg.path }}" chdir: "{{ pkg.path }}"
target: "{{ target.name }}" target: "{{ target.name }}"

View File

@@ -24,7 +24,7 @@
- name: Download and extract source archive - name: Download and extract source archive
when: when:
- pkg.archive is defined - pkg.archive is defined
ansible.bulitin.include_tasks: helpers/archive.yml ansible.builtin.include_tasks: helpers/archive.yml
- name: Ensure facts are set - name: Ensure facts are set
ansible.builtin.set_fact: ansible.builtin.set_fact:

View File

@@ -47,8 +47,8 @@
- name: Configure pkg dependencies - name: Configure pkg dependencies
loop: "{{ air.pkg_deps }}" loop: "{{ air.pkg_deps }}"
loop_control: loop_control:
loop_var: pkg loop_var: dep
ansible.builtin.include_tasks: "pkgs/{{ pkg }}.yml" ansible.builtin.include_tasks: "pkgs/{{ dep }}.yml"
- name: Add air to install list - name: Add air to install list
ansible.builtin.set_fact: ansible.builtin.set_fact:

View File

@@ -18,6 +18,8 @@
Alpine: ansible Alpine: ansible
Archlinux: ansible Archlinux: ansible
pip: ansible pip: ansible
pkg_deps:
- pipx
# }}} # }}}
- name: Configure ansible - name: Configure ansible
when: when:
@@ -45,6 +47,12 @@
when: when:
- ansible_imethod == 'source' - ansible_imethod == 'source'
block: block:
- name: Add ansible package deps
loop: "{{ ansible.pkg_deps }}"
loop_control:
loop_var: dep
ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
- name: Configure ansible source install - name: Configure ansible source install
ansible.builtin.set_fact: ansible.builtin.set_fact:
ansible_src_install: ansible_src_install:

View File

@@ -21,6 +21,8 @@
FreeBSD: py311-ansible-lint FreeBSD: py311-ansible-lint
pip: pip:
name: ansible_lint name: ansible_lint
pkg_deps:
- pipx
# }}} # }}}
- name: Configure ansible_lint - name: Configure ansible_lint
when: when:
@@ -59,6 +61,12 @@
when: when:
- ansible_lint_imethod == 'system' - ansible_lint_imethod == 'system'
block: block:
- name: Add ansible lint package deps
loop: "{{ ansible_lint.pkg_deps }}"
loop_control:
loop_var: dep
ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
- name: Queue ansible_lint system install - name: Queue ansible_lint system install
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + [ansible_lint_pkgname[os_family]] }}" pkg_sys: "{{ pkg_sys + [ansible_lint_pkgname[os_family]] }}"

View File

@@ -10,8 +10,13 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
cmakelang: cmakelang:
methods: methods:
- source
- system - system
pkgname: cmakelang pkgname:
RedHat: cmakelang
pip: cmakelang
pkg_deps:
- pipx
# }}} # }}}
- name: Add cmakelang - name: Add cmakelang
when: when:
@@ -35,6 +40,29 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
cmakelang_install: "{{ cmakelang_imethod }}={{ cmakelang.pkgname }}" cmakelang_install: "{{ cmakelang_imethod }}={{ cmakelang.pkgname }}"
- name: Configure cmakelang source install
when:
- cmakelang_imethod == 'source'
block:
- name: Add cmakelang package deps
loop: "{{ cmakelang.pkg_deps }}"
loop_control:
loop_var: dep
ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
- name: Confgure cmakelang pipx install
ansible.builtin.set_fact:
cmakelang_pipx_install:
name: "{{ cmakelang.pkgname['pip'] }}"
- name: Queue cmakelang pipx install
ansible.builtin.set_fact:
pkg_pipx: "{{ pkg_pipx + [cmakelang_pipx_install] }}"
- name: Finalise cmakelang source install
ansible.builtin.set_fact:
cmakelang_install: "{{ cmakelang_imethod }}={{ cmakelang_pipx_install }}"
- name: Finalise cmakelang configuration - name: Finalise cmakelang configuration
ansible.builtin.set_fact: ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'cmakelang': cmakelang_install } ) }}" __configured: "{{ __configured | combine( { 'cmakelang': cmakelang_install } ) }}"

View File

@@ -10,12 +10,17 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
direnv: direnv:
methods: methods:
- source
- system - system
pkgname: pkgname:
RedHat: direnv RedHat: direnv
Alpine: direnv Alpine: direnv
Debian: direnv Debian: direnv
Darwin: direnv Darwin: direnv
install_url: github.com/direnv/direnv
pkg_deps:
- go
version: "{{ direnv_version | default('latest') }}"
# }}} # }}}
- name: Configure direnv - name: Configure direnv
when: when:
@@ -39,6 +44,20 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
direnv_install: "{{ direnv_imethod }}={{ direnv.pkgname[os_family] }}" direnv_install: "{{ direnv_imethod }}={{ direnv.pkgname[os_family] }}"
- name: Set direnv build facts
when:
- direnv_imethod == 'source'
block:
- name: Set direnv source install facts
ansible.builtin.set_fact:
direnv_go_install:
url: "{{ direnv.install_url }}@{{ direnv.version }}"
bind: "{{ path_bin }}/direnv"
- name: Finalise direnv source install
ansible.builtin.set_fact:
direnv_install: "{{ direnv_imethod }}={{ direnv_go_install }}"
- name: Finalize direnv configuration - name: Finalize direnv configuration
ansible.builtin.set_fact: ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'direnv': direnv_install } ) }}" __configured: "{{ __configured | combine( { 'direnv': direnv_install } ) }}"

View File

@@ -116,7 +116,7 @@
loop: "{{ ghostty.pkg_deps }}" loop: "{{ ghostty.pkg_deps }}"
loop_control: loop_control:
loop_var: dep loop_var: dep
ansible.bulitin.include_tasks: pkgs/{{ dep }}.yml ansible.builtin.include_tasks: pkgs/{{ dep }}.yml
- name: Add ghostty system dependencies - name: Add ghostty system dependencies
ansible.builtin.set_fact: ansible.builtin.set_fact:

View File

@@ -12,9 +12,8 @@
methods: methods:
- system - system
pkgname: pkgname:
RedHat: [nodejs] RedHat:
Debian: [nodejs] - nodejs
Alpine: [nodejs]
FreeBSD: FreeBSD:
- node - node
- npm - npm
@@ -32,12 +31,9 @@
when: when:
- nodejs_imethod == "system" - nodejs_imethod == "system"
block: block:
- name: Set nodejs package name
ansible.builtin.set_fact:
nodejs_pkgname: "{{ nodejs.pkgname[os_family] }}"
- name: Append nodejs to pkg_sys - name: Append nodejs to pkg_sys
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + [nodejs_pkgname] }}" pkg_sys: "{{ pkg_sys + nodejs.pkgname[os_family] }}"
- name: Finalize nodejs configuration - name: Finalize nodejs configuration
ansible.builtin.set_fact: ansible.builtin.set_fact:

View File

@@ -1,5 +1,33 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: Append pipx to pkg_sys - name: Set pipx default facts
ansible.builtin.set_fact: ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['pipx'] }}" pipx:
methods:
- system
- name: Configure pipx
when:
- "'pipx' not in __configured"
block:
- name: Set pipx install method
when:
- pipx_imethod is undefined
ansible.builtin.set_fact:
pipx_imethod: "{{ imethod if imethod in pipx.methods else pipx.methods[0] }}"
- name: Configure pipx system install
when:
- pipx_imethod == 'system'
block:
- name: Queue pipx system install
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['pipx'] }}"
- name: Finalise pipx system install
ansible.builtin.set_fact:
pipx_install: "{{ pipx_imethod }}=pipx"
- name: Finalise pipx configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'pipx': pipx_install } ) }}"

View File

@@ -4,7 +4,12 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
zoxide: zoxide:
methods: methods:
- source
- system - system
cargo:
name: zoxide
pkg_deps:
- cargo
# }}} # }}}
- name: Configure zoxide - name: Configure zoxide
when: when:
@@ -16,9 +21,21 @@
ansible.builtin.set_fact: ansible.builtin.set_fact:
zoxide_imethod: "{{ imethod if imethod in zoxide.methods else zoxide.methods[0] }}" zoxide_imethod: "{{ imethod if imethod in zoxide.methods else zoxide.methods[0] }}"
- name: Append zoxide to pkg_sys - name: Configure zoxide system install
ansible.builtin.set_fact: when:
pkg_sys: "{{ pkg_sys + ['zoxide'] }}" - zoxide_imethod == 'system'
block:
- name: Append zoxide to pkg_sys
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['zoxide'] }}"
- name: Configure zoxide cargo install
when:
- zoxide_imethod == 'source'
block:
- name: Set zoxide cargo facts
ansible.builtin.set_fact:
zoxide_cargo_install: "{{ zoxide.cargo }}"
- name: Set zoxide_configured - name: Set zoxide_configured
ansible.builtin.set_fact: ansible.builtin.set_fact: