change layout for better management
- instead of just `syspkgs` and `srcpkgs` add more lists - `appimages`, `flatpkgs` and others as they come up
This commit is contained in:
52
CONTRIBUTING.md
Normal file
52
CONTRIBUTING.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
## Package definition
|
||||||
|
|
||||||
|
Package defintions are just `yaml` tasks in the directory
|
||||||
|
`tasks/pkgs`, which handle how a package is installed.
|
||||||
|
|
||||||
|
Most can be installed using the `syspkgs` list, and are simply
|
||||||
|
appending the package name to said list based on the system.
|
||||||
|
|
||||||
|
If a package can be installed via an entry to `syspkgs` for some,
|
||||||
|
but not all platforms, handling is done to either inform the user
|
||||||
|
that the package is not available, or to append the package name
|
||||||
|
to another installation method such as:
|
||||||
|
|
||||||
|
- `appimages` to install the appimage of a package
|
||||||
|
- `cargopkgs` to install via the rust cargo package manager
|
||||||
|
- `cargoversioned` to install version lockec cargo packages
|
||||||
|
- `caskpkgs` to install a homebrew cask
|
||||||
|
- `flatpkgs` to install flatpaks
|
||||||
|
- `gopkgs` to install using the `go install` command
|
||||||
|
- `npmpkgs` to install packages from npm
|
||||||
|
- `pipxpkgs` to install packages from Python pip
|
||||||
|
- `srcpkgs` to build packages from source
|
||||||
|
- `tappkgs` to install packages from home brew taps
|
||||||
|
|
||||||
|
Alternative sources of packages can be defined with entries to:
|
||||||
|
|
||||||
|
- `fpremotes` to add a flatpak remote
|
||||||
|
- `brewtaps` to add a homebrew tap
|
||||||
|
|
||||||
|
### Adding system level repositories
|
||||||
|
|
||||||
|
Many packages exist in their own external repository for the
|
||||||
|
given system, such as `/etc/yum.repos.d` for RedHat based linux
|
||||||
|
distros, `/etc/apt/sources.list.d` for Debian based distros and
|
||||||
|
others. Since you an add the package to `syspkgs` by enabling a
|
||||||
|
repo, the coresponding task in `tasks/pkgs` should take the
|
||||||
|
steps needed to enable the repository.
|
||||||
|
|
||||||
|
### Packages with multiple instllation methods
|
||||||
|
|
||||||
|
Many packages can be installed in different ways, like the
|
||||||
|
`bitwarden` package. `bitwarden` can be installed as a `syspkg`
|
||||||
|
on some machines, a `caskpkg` on macOS, an `appimage`, a `flatpak`
|
||||||
|
or even a `snap`.
|
||||||
|
|
||||||
|
For such packages, a default is chosen to install, in the following order
|
||||||
|
of precedence: `syspkgs`, `flatpkgs`, `snappkgs`, `appimages`.
|
||||||
|
|
||||||
|
In that order, `syspkgs` and `caskpkgs` have equal weight, as it applies
|
||||||
|
to macOS.
|
||||||
@@ -1,23 +1,11 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- name: "check if task for {{pkg}} exists"
|
- name: "Check if task exists for {{ pkg }}"
|
||||||
ansible.builtin.command: "test -f {{role_path}}/tasks/pkgs/{{ pkg }}.yml"
|
ansible.builtin.stat:
|
||||||
|
path: "{{ role_path }}/tasks/pkgs/{{ pkg }}.yml"
|
||||||
register: cpkg_exists
|
register: cpkg_exists
|
||||||
ignore_errors: true
|
|
||||||
failed_when: not (cpkg_exists.rc != 0 or cpkg_exists.rc != 1)
|
|
||||||
|
|
||||||
- name: "add include task for {{pkg}}"
|
- name: "Add include task for {{ pkg }}"
|
||||||
|
when: cpkg_exists.exists
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: "pkgs/{{ pkg }}.yml"
|
file: "pkgs/{{ pkg }}.yml"
|
||||||
when: cpkg_exists.rc == 0
|
|
||||||
tags:
|
|
||||||
- packages
|
|
||||||
|
|
||||||
- name: "add {{pkg}} to syspkgs if task doesn't exist: {{assume_missing_is_syspkg}}"
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
syspkgs: "{{ syspkgs + [pkg] }}"
|
|
||||||
when:
|
|
||||||
- cpkg_exists.rc != 0
|
|
||||||
- assume_missing_is_syspkg
|
|
||||||
tags:
|
|
||||||
- packages
|
|
||||||
|
|||||||
31
tasks/appimage/bitwarden.yml
Normal file
31
tasks/appimage/bitwarden.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# vim: set filetype=yaml.ansible :
|
||||||
|
---
|
||||||
|
- name: Install bitwarden appimage
|
||||||
|
become: "{{ bw_become }}"
|
||||||
|
become_user: "{% if bw_become %}{{ bw_owner }}{% else %}~{% endif %}"
|
||||||
|
when:
|
||||||
|
- bw_instmtd == 'appimage'
|
||||||
|
block:
|
||||||
|
- name: Ensure install path exists
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
path: "{{ bw_instdir }}"
|
||||||
|
owner: "{{ bw_owner }}"
|
||||||
|
group: "{{ bw_group }}"
|
||||||
|
|
||||||
|
- name: Fetch bitwarden appimage
|
||||||
|
ansible.builtin.get_url:
|
||||||
|
mode: '0755'
|
||||||
|
decompress: false
|
||||||
|
backup: true
|
||||||
|
url: bw_appimg.url
|
||||||
|
dest: "{{ bw_instdir }}/{{ bw_appimg.name }}"
|
||||||
|
owner: "{{ bw_owner }}"
|
||||||
|
group: "{{ bw_group }}"
|
||||||
|
|
||||||
|
- name: Link bitwarden appimage
|
||||||
|
ansible.builtin.file:
|
||||||
|
state: link
|
||||||
|
src: "{{ bw_instdir }}/{{ bw_appimg.name }}"
|
||||||
|
path: "{{ bw_instpfx }}/bin/bitwarden"
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- name: build and install alacritty
|
- name: Build and install alacritty
|
||||||
|
become: true
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
creates: "{{ pkgconfig_alacritty.install_prefix }}/bin/alacritty"
|
||||||
cmd:
|
cmd:
|
||||||
- cargo
|
- cargo
|
||||||
- install
|
- install
|
||||||
@@ -11,4 +13,3 @@
|
|||||||
- "{{ pkgconfig_alacritty.git_repo }}"
|
- "{{ pkgconfig_alacritty.git_repo }}"
|
||||||
- --tag
|
- --tag
|
||||||
- "v{{ pkgconfig_alacritty.version }}"
|
- "v{{ pkgconfig_alacritty.version }}"
|
||||||
become: true
|
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
|
||||||
---
|
|
||||||
- name: Install bitwarden appimage
|
|
||||||
blocK:
|
|
||||||
- ansible.builtin.file:
|
|
||||||
state: directory
|
|
||||||
mode: '0755'
|
|
||||||
path: "{{ pkgconfig_bitwarden.install_dir }}"
|
|
||||||
owner: "{{ pkgconfig_bitwarden.owner }}"
|
|
||||||
group: "{{ pkgconfig_bitwarden.group }}"
|
|
||||||
|
|
||||||
- ansible.builtin.get_url:
|
|
||||||
mode: '0755'
|
|
||||||
decompress: false
|
|
||||||
backup: true
|
|
||||||
url: "https://vault.bitwarden.com/download/?app=desktop&platform=linux&variant=appimage"
|
|
||||||
dset: "{{ pkgconfig_bitwarden.install_dir }}/bitwarden.appimage"
|
|
||||||
owner: "{{ pkgconfig_bitwarden.owner }}"
|
|
||||||
group: "{{ pkgconfig_bitwarden.group }}"
|
|
||||||
|
|
||||||
- ansible.builtin.file:
|
|
||||||
state: link
|
|
||||||
src: "{{ pkgconfig_bitwarden.install_dir }}/bitwarden.appimage"
|
|
||||||
path: "{{ pkgconfig_bitwarden.install_prefix }}/bin/bitwarden"
|
|
||||||
when:
|
|
||||||
- pkgconfig_bitwarden.use_appimage
|
|
||||||
beocome: "{{ pkgconfig_bitwarden.dobecome }}"
|
|
||||||
become_user: "{% if pkgconfig_bitwarden.dobecome %}{{ pkgconfig_bitwarden.owner }}{% else %}~{% endif %}"
|
|
||||||
@@ -1,27 +1,27 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- name: build ghostty from source
|
- name: Build ghostty from source
|
||||||
block:
|
block:
|
||||||
- name: create temp path
|
- name: Create temp path
|
||||||
ansible.builtin.tempfile:
|
ansible.builtin.tempfile:
|
||||||
state: directory
|
state: directory
|
||||||
prefix: ghostty.
|
prefix: ghostty.
|
||||||
register: d_ghostty_tmp
|
register: d_ghostty_tmp
|
||||||
|
|
||||||
- name: clone ghostty git repository
|
- name: Clone ghostty git repository
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
depth: 1
|
depth: 1
|
||||||
dest: "{{ d_ghostty_tmp.path }}/ghostty"
|
dest: "{{ d_ghostty_tmp.path }}/ghostty"
|
||||||
repo: "{{ pkgconfig_ghostty.git_repo }}"
|
repo: "{{ pkgconfig_ghostty.git_repo }}"
|
||||||
version: "{{ pkgconfig_ghostty.version }}"
|
version: "{{ pkgconfig_ghostty.version }}"
|
||||||
|
|
||||||
- name: build ghostty
|
- name: Build ghostty
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
chdir: "{{ d_ghostty_tmp.path }}/ghostty"
|
chdir: "{{ d_ghostty_tmp.path }}/ghostty"
|
||||||
cmd: "zig build -D{{ pkgconfig_ghostty.optimize }}"
|
cmd: "zig build -D{{ pkgconfig_ghostty.optimize }}"
|
||||||
register: c_ghostty_build
|
register: c_ghostty_build
|
||||||
|
|
||||||
- name: install ghostty
|
- name: Install ghostty
|
||||||
ansible.file.copy:
|
ansible.file.copy:
|
||||||
src: "{{ d_ghostty_tmp.path }}/ghostty/zig-out/bin/ghostty"
|
src: "{{ d_ghostty_tmp.path }}/ghostty/zig-out/bin/ghostty"
|
||||||
dest: "{{ pkgconfig_ghostty.install_prefix }}/bin/ghostty"
|
dest: "{{ pkgconfig_ghostty.install_prefix }}/bin/ghostty"
|
||||||
|
|||||||
@@ -2,11 +2,20 @@
|
|||||||
---
|
---
|
||||||
- name: Set needed variables lua language server
|
- name: Set needed variables lua language server
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
luals_pkg: "lua-language-server-{{ pkgconfig_luals.version }}-{{ pkgconfig_luals.sysmap[ansible_system] }}-{{ pkgconfig_luals.archmap[ansible_architecture] }}.tar.gz"
|
luals_sys: pkgconfig_luals.sysmap[ansible_system]
|
||||||
|
luals_arch: pkgconfig_luals.archmap[ansible_architecture]
|
||||||
|
luals_ver: pkgconfig_luals.version
|
||||||
|
luals_instpath: pkgconfig_luals.install_path
|
||||||
|
luals_instpfx: pkgconfig_luals.install_prefix
|
||||||
|
luals_burl: pkgconfig_luals.base_url
|
||||||
|
|
||||||
|
- name: Set luals archive name
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
luals_pkg: "lua-language-server-{{ luals_ver }}-{{ lualsl_sys }}-{{ luals_arch }}.tar.gz"
|
||||||
|
|
||||||
- name: Check if lua language server is already installed
|
- name: Check if lua language server is already installed
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ pkgconfig_luals.install_path }}/bin/lua-language-server"
|
path: "{{ luals_instpath }}/bin/lua-language-server"
|
||||||
register: r_luals_stat
|
register: r_luals_stat
|
||||||
|
|
||||||
- name: Install lua-language-server
|
- name: Install lua-language-server
|
||||||
@@ -21,20 +30,20 @@
|
|||||||
- name: Get latest lua-language-server
|
- name: Get latest lua-language-server
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
dest: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
|
dest: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
|
||||||
url: "{{ pkgconfig_luals.base_url }}/{{ pkgconfig_luals.version }}/{{ luals_pkg }}"
|
url: "{{ luals_burl }}/{{ luals_ver }}/{{ luals_pkg }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
decompress: false
|
decompress: false
|
||||||
|
|
||||||
- name: Create install_path
|
- name: Create install_path
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: directory
|
state: directory
|
||||||
path: "{{ pkgconfig_luals.install_path }}"
|
path: "{{ luals_instpath }}"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Extract lua language server archive
|
- name: Extract lua language server archive
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
dest: "{{ pkgconfig_luals.install_path }}"
|
dest: "{{ luals_instpath }}"
|
||||||
src: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
|
src: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
|
||||||
remote_src: true
|
remote_src: true
|
||||||
become: true
|
become: true
|
||||||
@@ -42,6 +51,6 @@
|
|||||||
- name: Link lua language server binary
|
- name: Link lua language server binary
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: link
|
state: link
|
||||||
src: "{{ pkgconfig_luals.install_path }}/bin/lua-language-server"
|
src: "{{ luals_instpath }}/bin/lua-language-server"
|
||||||
path: "{{ pkgconfig_luals.install_prefix }}/bin/lua-language-server"
|
path: "{{ luals_instpfx }}/bin/lua-language-server"
|
||||||
become: true
|
become: true
|
||||||
|
|||||||
179
tasks/main.yml
179
tasks/main.yml
@@ -1,64 +1,45 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- name: generate package installation lists
|
- name: Determine OS and set facts for it
|
||||||
|
block:
|
||||||
|
- name: Set macOS facts
|
||||||
|
when: ansible_os_family == 'Darwin'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
syspkg_become: false
|
||||||
|
|
||||||
|
- name: Set Linux facts
|
||||||
|
when: ansible_system == 'Linux'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
syspkg_become: true
|
||||||
|
|
||||||
|
- name: Generate package installation lists
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: addpkg.yml
|
file: addpkg.yml
|
||||||
loop: "{{ packages | unique }}"
|
loop: "{{ packages | unique }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: pkg
|
loop_var: pkg
|
||||||
|
|
||||||
- name: redhat based OS
|
- name: Install syspkgs list
|
||||||
block:
|
become: "{{ syspkg_become }}"
|
||||||
- name: upgrade dnf packages
|
ansible.builtin.package:
|
||||||
ansible.builtin.dnf:
|
|
||||||
name: "*"
|
|
||||||
state: latest
|
|
||||||
become: true
|
|
||||||
when: full_upgrade
|
|
||||||
|
|
||||||
- name: install dnf packages
|
|
||||||
ansible.builtin.dnf:
|
|
||||||
name: "{{ syspkgs | unique }}"
|
name: "{{ syspkgs | unique }}"
|
||||||
state: "{{ install_state }}"
|
|
||||||
become: true
|
|
||||||
when:
|
|
||||||
- syspkgs|length > 0
|
|
||||||
|
|
||||||
- name: add flatpak repos
|
|
||||||
community.general.flatpak_remote:
|
|
||||||
enabled: true
|
|
||||||
flatpakrepo_url: "{{ repo.url }}"
|
|
||||||
method: system
|
|
||||||
name: "{{ repo.name }}"
|
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ flatpkg_repo }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: repo
|
|
||||||
become: true
|
|
||||||
when:
|
|
||||||
- flatpkg_repo|length > 0
|
|
||||||
- flatpkgs|length > 0
|
|
||||||
|
|
||||||
- name: install flatpaks
|
- name: Redhat based OS
|
||||||
community.general.flatpak:
|
|
||||||
method: "system"
|
|
||||||
name: "{{ flatpkgs }}"
|
|
||||||
state: latest
|
|
||||||
become: true
|
|
||||||
when:
|
|
||||||
- flatpkgs|length > 0
|
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- name: debian based OS
|
|
||||||
block:
|
block:
|
||||||
- name: upgrade apt packages
|
- name: Install dnf packages
|
||||||
ansible.builtin.apt:
|
|
||||||
name: "*"
|
|
||||||
state: latest
|
|
||||||
become: true
|
become: true
|
||||||
when: full_upgrade
|
when:
|
||||||
|
- syspkgs|length > 0
|
||||||
|
ansible.builtin.dnf:
|
||||||
|
name: "{{ syspkgs | unique }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: install apt packages
|
- name: Debian based OS
|
||||||
|
when: ansible_os_family == 'Debian'
|
||||||
|
block:
|
||||||
|
- name: Install apt packages
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ syspkgs | unique }}"
|
name: "{{ syspkgs | unique }}"
|
||||||
state: "{{ install_state }}"
|
state: "{{ install_state }}"
|
||||||
@@ -66,66 +47,75 @@
|
|||||||
when:
|
when:
|
||||||
- syspkgs|length > 0
|
- syspkgs|length > 0
|
||||||
|
|
||||||
- name: add flatpak repos
|
- name: Darwin/macOS based OS
|
||||||
community.general.flatpak_remote:
|
when: ansible_os_family == 'Darwin'
|
||||||
enabled: true
|
|
||||||
flatpakrepo_url: "{{ repo.url }}"
|
|
||||||
method: system
|
|
||||||
name: "{{ repo.name }}"
|
|
||||||
state: present
|
|
||||||
loop: "{{ flatpkg_repo | unique }}"
|
|
||||||
loop_control:
|
|
||||||
loop_var: repo
|
|
||||||
become: true
|
|
||||||
when:
|
|
||||||
- flatpkg_repo|length > 0
|
|
||||||
- flatpkgs|length > 0
|
|
||||||
|
|
||||||
- name: install flatpaks
|
|
||||||
community.general.flatpak:
|
|
||||||
method: "system"
|
|
||||||
name: "{{ flatpkgs | unique }}"
|
|
||||||
state: latest
|
|
||||||
become: true
|
|
||||||
when:
|
|
||||||
- flatpkgs|length > 0
|
|
||||||
when: ansible_os_family == 'Debian'
|
|
||||||
|
|
||||||
- name: darwin/macOS based OS
|
|
||||||
block:
|
block:
|
||||||
- name: upgrade homebrew packages
|
- name: Upgrade homebrew packages
|
||||||
community.general.homebrew:
|
community.general.homebrew:
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: latest
|
||||||
when: full_upgrade
|
when: full_upgrade
|
||||||
|
|
||||||
- name: tap homebrew taps
|
- name: Tap homebrew taps
|
||||||
community.general.homebrew_tap:
|
community.general.homebrew_tap:
|
||||||
name: "{{ brewtaps | unique }}"
|
name: "{{ brewtaps | unique }}"
|
||||||
state: present
|
state: present
|
||||||
when: brewtaps|length > 0
|
when: brewtaps|length > 0
|
||||||
|
|
||||||
- name: install homebrew packages
|
- name: Install homebrew packages
|
||||||
community.general.homebrew:
|
community.general.homebrew:
|
||||||
name: "{{ syspkgs | unique }}"
|
name: "{{ syspkgs | unique }}"
|
||||||
state: "{{ install_state }}"
|
state: "{{ install_state }}"
|
||||||
when: syspkgs|length > 0
|
when: syspkgs|length > 0
|
||||||
|
|
||||||
- name: install homebrew casks
|
- name: Install homebrew casks
|
||||||
community.general.homebrew_cask:
|
community.general.homebrew_cask:
|
||||||
name: "{{ caskpkgs | unique }}"
|
name: "{{ caskpkgs | unique }}"
|
||||||
state: "{{ install_state }}"
|
state: "{{ install_state }}"
|
||||||
when: caskpkgs|length > 0
|
when: caskpkgs|length > 0
|
||||||
|
|
||||||
- name: workaround to install homebrew taps
|
- name: Workaround to install homebrew taps
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "brew install {{ tappkg }}"
|
cmd: "brew install {{ tappkg }}"
|
||||||
loop: "{{ tappkgs | unique }}"
|
loop: "{{ tappkgs | unique }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: tappkg
|
loop_var: tappkg
|
||||||
when: ansible_os_family == 'Darwin'
|
# TODO: fix the need to have this workaround
|
||||||
|
|
||||||
- name: ensure /usr/local/bin exists
|
- name: Install flatpaks on Linux Systems
|
||||||
|
when:
|
||||||
|
- ansible_system == 'Linux'
|
||||||
|
- flatpkgs|length > 0
|
||||||
|
block:
|
||||||
|
- name: Add flatpak repos
|
||||||
|
become: true
|
||||||
|
loop: "{{ fpremotes | unique }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: remote
|
||||||
|
when:
|
||||||
|
- fpremotes|length > 0
|
||||||
|
- flatpkgs|length > 0
|
||||||
|
community.general.flatpak_remote:
|
||||||
|
enabled: true
|
||||||
|
method: system
|
||||||
|
state: present
|
||||||
|
flatpakrepo_url: "{{ remote.url }}"
|
||||||
|
name: "{{ remote.name }}"
|
||||||
|
|
||||||
|
- name: Install flatpaks
|
||||||
|
become: true
|
||||||
|
loop: "{{ flatpkgs | unique }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: flatpkg
|
||||||
|
when:
|
||||||
|
- flatpkgs|length > 0
|
||||||
|
community.general.flatpak:
|
||||||
|
state: latest
|
||||||
|
method: system
|
||||||
|
name: "{{ flatpkg.name }}"
|
||||||
|
remote: "{{ flatpkg.remote | default('flathub') }}"
|
||||||
|
|
||||||
|
- name: Ensure /usr/local/bin exists
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
state: directory
|
state: directory
|
||||||
path: /usr/local/bin
|
path: /usr/local/bin
|
||||||
@@ -133,7 +123,7 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: install srcpkgs
|
- name: Install srcpkgs
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: "build/{{ srcpkg }}.yml"
|
file: "build/{{ srcpkg }}.yml"
|
||||||
loop: "{{ srcpkgs | unique }}"
|
loop: "{{ srcpkgs | unique }}"
|
||||||
@@ -141,11 +131,11 @@
|
|||||||
loop_var: srcpkg
|
loop_var: srcpkg
|
||||||
when: srcpkgs|length > 0
|
when: srcpkgs|length > 0
|
||||||
|
|
||||||
- name: install cargo packages at specific version
|
- name: Install cargo packages at specific version
|
||||||
community.general.cargo:
|
community.general.cargo:
|
||||||
name: "{{ cargopkg.name }}"
|
name: "{{ cargopkg.name }}"
|
||||||
version: "{{ cargopkg.version }}"
|
version: "{{ cargopkg.version }}"
|
||||||
path: "{{ cargopkg.path | default(default_config.install_prefix) }}"
|
path: "{{ cargopkg.path | default(default_install_prefix) }}"
|
||||||
locked: "{{ cargopkg.locked | default(false) }}"
|
locked: "{{ cargopkg.locked | default(false) }}"
|
||||||
become: true
|
become: true
|
||||||
when: cargoversioned|length > 0
|
when: cargoversioned|length > 0
|
||||||
@@ -164,32 +154,33 @@
|
|||||||
loop_var: cargopkg
|
loop_var: cargopkg
|
||||||
|
|
||||||
- name: Install local go packages
|
- name: Install local go packages
|
||||||
|
loop: "{{ gopkgs | unique }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: gopkg
|
||||||
|
when: gopkgs|length > 0
|
||||||
environment:
|
environment:
|
||||||
GOROOT: /usr/local/go
|
GOROOT: /usr/local/go
|
||||||
PATH: /usr/local/go/bin:$PATH
|
PATH: /usr/local/go/bin:$PATH
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "go install {{ gopkg }}"
|
cmd: "go install {{ gopkg }}"
|
||||||
loop: "{{ gopkgs | unique }}"
|
#TODO: figure out how to check if the gopkg is already installed
|
||||||
loop_control:
|
|
||||||
loop_var: gopkg
|
|
||||||
when: gopkgs|length > 0
|
|
||||||
|
|
||||||
- name: Install local npm packages
|
- name: Install local npm packages
|
||||||
community.general.npm:
|
|
||||||
global: true
|
|
||||||
name: "{{ npmpkg }}"
|
|
||||||
state: latest
|
|
||||||
loop: "{{ npmpkgs | unique }}"
|
loop: "{{ npmpkgs | unique }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: npmpkg
|
loop_var: npmpkg
|
||||||
when: npmpkgs|length > 0
|
when: npmpkgs|length > 0
|
||||||
|
community.general.npm:
|
||||||
|
global: true
|
||||||
|
name: "{{ npmpkg }}"
|
||||||
|
state: latest
|
||||||
|
|
||||||
- name: Install python pipx packages for user
|
- name: Install python pipx packages for user
|
||||||
community.general.pipx:
|
|
||||||
executable: "{% if ansible_os_family == 'Darwin' %}/opt/homebrew/bin/pipx{% else %}/usr/bin/pipx{% endif %}"
|
|
||||||
name: "{{ pipxpkg }}"
|
|
||||||
state: latest
|
|
||||||
loop: "{{ pipxpkgs | unique }}"
|
loop: "{{ pipxpkgs | unique }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: pipxpkg
|
loop_var: pipxpkg
|
||||||
when: pipxpkgs|length > 0
|
when: pipxpkgs|length > 0
|
||||||
|
community.general.pipx:
|
||||||
|
executable: "{% if ansible_os_family == 'Darwin' %}/opt/homebrew/bin/pipx{% else %}/usr/bin/pipx{% endif %}"
|
||||||
|
name: "{{ pipxpkg }}"
|
||||||
|
state: latest
|
||||||
|
|||||||
@@ -1,31 +1,48 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- ansible.builtin.include_vars:
|
- name: Read bitwarden configuration
|
||||||
|
ansible.builtin.include_vars:
|
||||||
file: bitwarden.yml
|
file: bitwarden.yml
|
||||||
name: _bitwarden
|
name: _bitwarden
|
||||||
- ansible.builtin.set_fact:
|
|
||||||
|
- name: Set bitwarden configuration
|
||||||
|
ansible.builtin.set_fact:
|
||||||
pkgconfig_bitwarden: "{{ _bitwarden | ansible.builtin.combine(pkgconfig.bitwarden) }}"
|
pkgconfig_bitwarden: "{{ _bitwarden | ansible.builtin.combine(pkgconfig.bitwarden) }}"
|
||||||
|
|
||||||
- name: append to flatpkgs
|
- name: Set bitwarden facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
bw:
|
||||||
|
appimg: pkgconfig_bitwarden.appimage
|
||||||
|
become: pkgconfig_bitwarden.dobecome
|
||||||
|
flatpak: pkgconfig_bitwarden.flatpak
|
||||||
|
group: pkgconfig_bitwarden.group
|
||||||
|
instdir: pkgconfig_bitwarden.install_dir
|
||||||
|
instmtd: pkgconfig_bitwarden.install_method
|
||||||
|
instpfx: pkgconfig_bitwarden.install_prefix
|
||||||
|
owner: pkgconfig_bitwarden.owner
|
||||||
|
|
||||||
|
- name: Append to flatpkgs
|
||||||
|
when:
|
||||||
|
- ansible_os_family != 'Darwin'
|
||||||
|
- bw.instmtd == 'flatpak'
|
||||||
block:
|
block:
|
||||||
- ansible.builtin.include_tasks:
|
- name: Ensure flatpak runtime activated
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
file: pkgs/flatpak.yml
|
file: pkgs/flatpak.yml
|
||||||
when: flatpak is undefined
|
when: flatpak is undefined
|
||||||
|
|
||||||
- ansible.builtin.set_fact:
|
- name: Append to flatpkgs
|
||||||
flatpkgs: "{{ flatpkgs + [ 'com.bitwarden.desktop' ] }}"
|
ansible.builtin.set_fact:
|
||||||
|
flatpkgs: "{{ flatpkgs + [bw.flatpak] }}"
|
||||||
|
|
||||||
|
- name: Append to srcpkgs
|
||||||
when:
|
when:
|
||||||
- ansible_os_family != 'Darwin'
|
- ansible_os_family != 'Darwin'
|
||||||
- pkgconfig_bitwarden.use_flatpak
|
- bw.instmtd == 'appimage'
|
||||||
|
|
||||||
- name: append to srcpkgs
|
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
syspkgs: "{{ srcpkgs + [ 'bitwarden' ] }}"
|
syspkgs: "{{ appimages + ['bitwarden'] }}"
|
||||||
when:
|
|
||||||
- ansible_os_family != 'Darwin'
|
|
||||||
- not pkgconfig_bitwarden.use_flatpak
|
|
||||||
|
|
||||||
- name: append to caskpkgs
|
- name: Append to caskpkgs
|
||||||
ansible.builtin.set_fact:
|
|
||||||
caskpkgs: "{{ caskpkgs + [ 'bitwarden' ] }}"
|
|
||||||
when: ansible_os_family == 'Darwin'
|
when: ansible_os_family == 'Darwin'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
caskpkgs: "{{ caskpkgs + ['bitwarden'] }}"
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
- ansible.builtin.include_vars:
|
- name: Linux specific configuration
|
||||||
|
when:
|
||||||
|
- ansible_os_family != 'Darwin'
|
||||||
|
block:
|
||||||
|
- name: Load lua-language-server config
|
||||||
|
ansible.builtin.include_vars:
|
||||||
file: lua-language-server.yml
|
file: lua-language-server.yml
|
||||||
name: _luals
|
name: _luals
|
||||||
- ansible.builtin.set_fact:
|
- name: Combine loaded config with defaults
|
||||||
|
ansible.builtin.set_fact:
|
||||||
pkgconfig_luals: "{{ _luals | ansible.builtin.combine(pkgconfig.luals) }}"
|
pkgconfig_luals: "{{ _luals | ansible.builtin.combine(pkgconfig.luals) }}"
|
||||||
|
|
||||||
- name: append to pkgs
|
- name: Append to pkgs
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
srcpkgs: "{{ srcpkgs + [ 'lua-language-server' ] }}"
|
srcpkgs: "{{ srcpkgs + ['lua-language-server'] }}"
|
||||||
|
|
||||||
|
- name: Append to syspkgs
|
||||||
|
when:
|
||||||
|
- ansible_os_family == 'Darwin'
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
syspkgs: "{{ syspkgs + ['lua-language-server'] }}"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: 0.15.0
|
version: 0.15.0
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
install_dir: /opt/bitwarden
|
install_dir: /opt/appimage/bitwarden
|
||||||
use_flatpak: true
|
install_method: flatpak
|
||||||
use_appimage: false
|
|
||||||
dobecome: true
|
dobecome: true
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: 1.23.6
|
version: 1.23.6
|
||||||
install_path: "{{ default_config.install_prefix }}"
|
install_path: "{{ default_install_prefix }}"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: 3.13.5
|
version: 3.13.5
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
install_path: /opt/lua-language-server
|
install_path: /opt/lua-language-server
|
||||||
|
|||||||
@@ -1,39 +1,33 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
# variables used in ansible_role_package
|
# variables used in ansible_role_package
|
||||||
---
|
---
|
||||||
assume_missing_is_syspkg: true
|
default_install_prefix: /usr/local
|
||||||
full_upgrade: false
|
packages: [] # list of packages to install
|
||||||
install_state: present
|
|
||||||
default_config:
|
|
||||||
install_prefix: /usr/local
|
|
||||||
become: true
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
|
|
||||||
# install lists
|
# Package install lists
|
||||||
brewtaps: []
|
appimages: [] # appimages to install
|
||||||
cargopkgs: []
|
cargopkgs: [] # rust packages from cargo
|
||||||
cargoversioned: []
|
cargoversioned: [] # versioned rust packages from cargo
|
||||||
caskpkgs: []
|
caskpkgs: [] # homebrew casks
|
||||||
flatpkgs: []
|
flatpkgs: [] # flatpaks
|
||||||
flatpkg_repo:
|
gopkgs: [] # go applications
|
||||||
|
npmpkgs: [] # npm commands
|
||||||
|
pipxpkgs: [] # pipx packages
|
||||||
|
srcpkgs: [] # packages built from source
|
||||||
|
syspkgs: [] # system package manager packages
|
||||||
|
tappkgs: [] # homebrew tap packages
|
||||||
|
|
||||||
|
# Package source lists
|
||||||
|
brewtaps: [] # homebrew taps
|
||||||
|
fpremotes: # flatpak remotes
|
||||||
- name: flathub
|
- name: flathub
|
||||||
url: https://dl.flathub.org/repo/flathub.flatpakrepo
|
url: https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
gopkgs: []
|
|
||||||
npmpkgs: []
|
|
||||||
packages: []
|
|
||||||
pipxpkgs: []
|
|
||||||
srcpkgs: []
|
|
||||||
syspkgs: []
|
|
||||||
tappkgs: []
|
|
||||||
|
|
||||||
# pkgconfig, loaded from .yml files in vars
|
# Static package configuration
|
||||||
# and combined. Configuration can be changed
|
# this shouldn't be changed by the user
|
||||||
# when running the role by specifying
|
|
||||||
# pkgconfig.<pkgname> as a dict
|
|
||||||
pkgconfig:
|
pkgconfig:
|
||||||
alacritty:
|
alacritty:
|
||||||
deps:
|
build_deps:
|
||||||
RedHat:
|
RedHat:
|
||||||
- cmake
|
- cmake
|
||||||
- freetype-devel
|
- freetype-devel
|
||||||
@@ -50,10 +44,15 @@ pkgconfig:
|
|||||||
- libxkbcommon-dev
|
- libxkbcommon-dev
|
||||||
- python3
|
- python3
|
||||||
git_repo: https://github.com/alacritty/alacritty.git
|
git_repo: https://github.com/alacritty/alacritty.git
|
||||||
|
bitwarden:
|
||||||
bitwarden: {}
|
flatpak:
|
||||||
|
name: com.bitwarden.desktop
|
||||||
|
remote: flathub
|
||||||
|
appimage:
|
||||||
|
name: bitwarden.appimage
|
||||||
|
url: https://vault.bitwarden.com/download/?app=desktop&platform=linux&variant=appimage
|
||||||
broot:
|
broot:
|
||||||
deps:
|
build_deps:
|
||||||
Debian:
|
Debian:
|
||||||
- build-essential
|
- build-essential
|
||||||
- libxcb1-dev
|
- libxcb1-dev
|
||||||
@@ -89,7 +88,7 @@ pkgconfig:
|
|||||||
- fd-find
|
- fd-find
|
||||||
flatpak: {}
|
flatpak: {}
|
||||||
ghostty:
|
ghostty:
|
||||||
deps:
|
build_deps:
|
||||||
Debian:
|
Debian:
|
||||||
- libgtk-4-dev
|
- libgtk-4-dev
|
||||||
- libadwaita-1-dev
|
- libadwaita-1-dev
|
||||||
@@ -166,7 +165,7 @@ pkgconfig:
|
|||||||
x86_64: x64
|
x86_64: x64
|
||||||
neovide:
|
neovide:
|
||||||
git_repo: https://github.com/neovide/neovide.git
|
git_repo: https://github.com/neovide/neovide.git
|
||||||
deps:
|
build_deps:
|
||||||
RedHat:
|
RedHat:
|
||||||
- fontconfig-devel
|
- fontconfig-devel
|
||||||
- freetype-devel
|
- freetype-devel
|
||||||
@@ -338,7 +337,7 @@ pkgconfig:
|
|||||||
Linux: nomad
|
Linux: nomad
|
||||||
Darwin: hashicorp/tap/nomad
|
Darwin: hashicorp/tap/nomad
|
||||||
nushell:
|
nushell:
|
||||||
deps:
|
build_deps:
|
||||||
Darwin:
|
Darwin:
|
||||||
- openssl
|
- openssl
|
||||||
- cmake
|
- cmake
|
||||||
@@ -437,7 +436,7 @@ pkgconfig:
|
|||||||
Debian:
|
Debian:
|
||||||
- zfs-dkms
|
- zfs-dkms
|
||||||
- zfsutils-linux
|
- zfsutils-linux
|
||||||
deps:
|
build_deps:
|
||||||
RedHat:
|
RedHat:
|
||||||
- kernel-devel
|
- kernel-devel
|
||||||
- epel-release
|
- epel-release
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: 0.14.0
|
version: 0.14.0
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: v0.10.3
|
version: v0.10.3
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
install_dir: /opt/nvim
|
install_dir: /opt/nvim
|
||||||
use_appimage: true
|
use_appimage: true
|
||||||
use_syspkg: true
|
use_syspkg: true
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: 0.13.0
|
version: 0.13.0
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
install_path: /opt/zig
|
install_path: /opt/zig
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# vim: set filetype=yaml.ansible :
|
# vim: set filetype=yaml.ansible :
|
||||||
---
|
---
|
||||||
version: 0.13.0
|
version: 0.13.0
|
||||||
install_prefix: "{{ default_config.install_prefix }}"
|
install_prefix: "{{ default_install_prefix }}"
|
||||||
install_path: /opt/zls
|
install_path: /opt/zls
|
||||||
|
|||||||
Reference in New Issue
Block a user