merge create_better_config

This commit is contained in:
Matthew Stobbs
2025-02-25 18:04:49 -07:00
238 changed files with 2788 additions and 2116 deletions

109
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,109 @@
# 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.
## Formatting rules
- Use indentation explicitness. Lists should be indented:
```yaml
# Good
my_good_list:
- my_list_item
# Bad
my_bad_list:
- my_list_item
```
- Variables should be in snake case, separating words
- Short names are fine if they are explicit. ie `vers` can be used instead of `version`
- If more then one variable starts with the same words, put it into a dict if it makes sense:
```yaml
# variables that should be a dict
cargo_locked: true
cargo_pkg: alacritty
# better to just be
cargo:
locked: true
pkg: alacritty
```
- Tasks **MUST** follow the convention in this example:
```yaml
- name: Capitalize first letter of name
when:
- each condition has it's own line
- (brackets around conditions with) or
(to show they are separate)
become: "{{ not use_local }}" # must be able to be used with use_local
become_user: # this should not be needed, but always follows become if it is
loop: "{{ my_loopable_list }}"
loop_control: # **MUST** always use at least loop_var for any loop
loop_var: my_item
ansible.builtin.set_fact: # always use the full module name
...
```
- `name`: Every task needs a name, and the first letter must be capitalized
- `when`: If a when clause exists, it follows the name
- Each clause must have it's own line, including and `or` clause, as seen above
- `become`: must follow the when clause if it exists, name otherwise
- Any other `become_` settings follow `become` in alphabetical order
- `loop`: must be defined just before the module invocation
- Every loop needs to rename the `loop_var` to something that makes sense
- `until` is consider the same as `loop` for the purposes of placement
- The last item must be the module invocation, using the fully qualified name
- For example, don't use `set_fact:`, use `ansible.builtin.set_fact:`

199
README.md
View File

@@ -1,5 +1,4 @@
Role Name # ansible_role_package
=========
Manage package installation for a number of packages Manage package installation for a number of packages
that sometimes need special handling. Some are built from that sometimes need special handling. Some are built from
@@ -11,60 +10,162 @@ special instructions to properly install and use. I decided to
simplify the management of those packages by creating a role with simplify the management of those packages by creating a role with
special handling. special handling.
Included packages: Order of precedence for package installation:
- Desktop applications: alacritty, firefox, ghostty, kitty, neovide 1. System package manager (dnf, apt, homebrew, etc.)
- Shell applications: btop, carapace, nushell, fzf, jq, neovim, pipx, ripgrep, 2. Appimage (Linux only)
stow, tmux, zoxide 3. Flatpak (Linux only)
- Infrastructure applications: ansible, consul, nomad, packer, terraform 4. Snap (Linux only), takes precedence over flatpak on Ubuntu based systems
- Development tools: cmake, git, go, nodejs, hugo, rust, tidy 5. Language package manager (`cargo install`, `go install`, `npm install`, etc.)
- Misc: editorconfig, hashicorp package repository, nerdfonts, pandoc, 6. Build and install from source
pytho3-pip, terra repository for fedora, zfs
- Cargo packages: dotenv-linter, eza, htmx-lsp, starship
- Go packages: air, buf, checkmake, glow, lazygit, revive, templ, gopls
- NPM packages: ansible-language-server, commitlint-cli,
commitlint-config-conventional, markdownlint-cli, quobix-vacuum,
tailwindcss-languageserver
- Pipx packages: cmakelang, sqlfluff
Requirements _This does not configure installed software, just installs it_
------------
## Available Packages
- air
- alacritty
- ansible-language-server
- ansible-lint
- ansible
- bashls
- bat
- bitwarden
- blender
- broot
- btop
- buf
- bufls
- carapace
- cheat
- checkmake
- choose
- clangd
- cmake
- cmakelang
- commitlint-cli
- commitlint-config-conventional
- consul
- cssls
- curlie
- dbeaver
- dockerls
- dotenv-linter
- duf
- dust
- editorconfig
- eslint
- eza
- fd
- firefox
- flatpak
- fzf
- ghostty
- git
- glow
- go
- godot
- gopls
- gping
- heroic
- htmlls
- htmx-lsp
- httpie
- hugo
- hyperfine
- intelephense
- jinja-lsp
- jq
- jsonls
- kitty
- lazygit
- libreoffice
- lua-language-server
- markdownlint-cli
- mcfly
- neovide
- neovim
- nerdfonts
- nextcloud
- nginxls
- nodejs
- nomad
- nushell
- packer
- pandoc
- pgadmin
- pipx
- podman
- pyright
- python3-pip
- quobix-vacuum
- revive
- ripgrep
- rust
- sd
- sqlfluff
- sqlls
- starship
- stow
- tailscale
- tailwindcss-languageserver
- templ
- terra_repo
- terraform
- terraformls
- thunderbird
- tidy
- tldr
- tmux
- vault
- xh
- yamlls
- zfs
- zig
- zls
- zoxide
- zsh
## Requirements
-
## Role Variables
- `use_local`: Boolean, default `true`
- When `true`, uses the following paths:
- `$HOME/.local` as the install prefix, placing binaries in `$HOME/.local/bin`
- `$HOME/.local/appimage` for saved appimages, which are then linked to `$HOME/.local/bin`
- `$HOME/.local/archive` for extracted archives linking binaries to `$HOME/.local/bin`
- `$HOME/.cache` for caching downloads
- `$HOME/.cargo` for cargo installations, placing binaries in `$HOME/.cargo/bin`
- When `false`, uses the following system wide paths:
- `/usr/local` as the install prefix, placing binaries in `/usr/local/bin`
- `/opt/appimage` for saved appimages, which are then linked to `/usr/local/bin`
- `/opt/archive` for extracted archives, linking binaries to `/usr/local/bin`
- `/opt/cache` for caching downloads
- `/opt/cargo` for rust cargo installations, placing binaries in `/opt/cargo/bin`
- `packages`: List of strings
- List of packages to install from the `Available Packages` list
- `prefer_method`: String, default `system`
- The preferred method of installation an application when multiple options exist
- Valid options are:
- `flatpak` - Flatpak, Linux only
- `langtool` - Using language tools such as `cargo`, `go`, `npm` or `pipx`
- `snap` - Snap, Linux only
- `source` - Prefer building from source. **Not recommended**
- `system` - Default, system package manager (dnf, apt, homebrew, etc.)
## Dependencies
Role Variables ## Example Playbook
--------------
- packages:
- List of packages to install
- assume_missing_is_syspkg:
- Bool. Default `true`
- Handle non-supported packages as package manager packages
- full_upgrade:
- Bool. Default `false`
- Do a full package upgrade first if `true`
- install_state:
- String. Default `present`
- Set to `latest` to update packages
- Set to `absent` to remove packages
- *currently only supports remove package manager installed packages*
- Valid choices: `present`, `latest`, `absent`
- pkgconfig:
- specific configuration for individual packages
Dependencies
------------
Example Playbook ## License
----------------
License
-------
MIT MIT
Author Information ## Author Information
------------------
- Matthew Stobbs - Matthew Stobbs <matthew@stobbs.ca>

View File

@@ -1,2 +1,51 @@
# vim: set filetype=yaml.ansible :
--- ---
# handlers file for ansible_role_package - name: Depend go
ansible.builtin.include_tasks:
file: addpkg.yml
vars:
pkg: go
- name: Depend flatpak
vars:
pkg: flatpak
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend node
vars:
pkg: nodejs
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend pipx
vars:
pkg: pipx
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend cargo
vars:
pkg: rust
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend rust
vars:
pkg: rust
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend zig
vars:
pkg: zig
ansible.builtin.include_tasks:
file: addpkg.yml
- name: Depend terra repo
ansible.builtin.include_tasks:
file: repos/terra.yml
- name: Depend hashicorp repo
ansible.builtin.include_tasks:
file: repos/hashicorp.yml

View File

@@ -1,43 +1,40 @@
--- ---
argument_specs: argument_specs:
main: main:
short_description: install software easily short_description: Install software using ansible
description: description:
- Make the installation of packages consistent on each platform. - Make the installation of packages consistent on each platform.
- Installs for RedHat, Debian or Darwin based systems. - Installs for RedHat, Debian and MacOS based systems.
author: author:
- Matthew Stobbs <matthew@stobbs.ca> - Matthew Stobbs <matthew@stobbs.ca>
options: options:
use_local:
type: bool
default: true
required: false
description:
Install packages using the current users
`$HOME/.local` directory as the install prefix.
WHen `false`, uses the system wide `/usr/local`
as the install prefix, and stores other parts
(appimages, extracted archives, cache) in the
appropriate path starting with `/opt`.
packages: packages:
type: "list" type: list
elements: "str" elements: str
required: true required: true
description: | description: |
The list of packages to install by name. The list of packages to install by name.
syspkglist: The list must contain only values that exist in
type: "list" `Available Packages` in `README.md`
elements: "str" prefer_method:
type: str
required: false required: false
description: | default: system
Additional packages to install via the system
default package manager. Is combined with the
completed list of packages to install.
Only use this if you a package isn't available to the role.
install_state:
type: "str"
choices: choices:
- "present" - flatpak
- "latest" - langtool
- "absent" - snap
required: false - source
default: present - system
description: |
Desired state of the packages to install.
full_upgrade:
type: "bool"
required: false
default: false
description: |
Do a full system upgrade before installing
additional packages. This does not handle
rebooting a machine that has been upgraded.

View File

@@ -7,20 +7,20 @@ galaxy_info:
# issue_tracker_url: http://example.com/issue/tracker # issue_tracker_url: http://example.com/issue/tracker
license: MIT license: MIT
min_ansible_version: 3.0 min_ansible_version: "3.0"
platforms: platforms:
- name: Fedora - name: Fedora
versions: versions:
- all - all
- 40+ - "40"
- name: Enterprise Linux 9 (RHEL, rocky alma) - "41"
- name: EL
versions: versions:
- 9.4 - "9"
- 9.5
- name: macOS - name: macOS
version: version:
- 14.2+ - ">=14.2"
galaxy_tags: galaxy_tags:
- linux - linux
@@ -29,5 +29,3 @@ galaxy_info:
- software - software
dependencies: [] dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -1,23 +1,11 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: "check if task for {{pkg}} exists" - name: "Load specialized configuration if it exists for {{ pkg }}"
ansible.builtin.command: "test -f {{role_path}}/tasks/pkgs/{{ pkg }}.yml" when:
register: cpkg_exists - pkgconfig[pkg] is defined
ignore_errors: true ansible.builtin.include_tasks:
failed_when: not (cpkg_exists.rc != 0 or cpkg_exists.rc != 1) file: "config/{{ pkg }}.yml"
- name: "add include task for {{pkg}}" - name: "Add include task for {{ pkg }}"
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

26
tasks/appimage.yml Normal file
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 }}/{{ pkg.link_name }}"
mode: '0755'
state: directory
- name: Fetch appimage
become: "{{ ext_become }}"
ansible.builtin.get_url:
mode: '0755'
decompress: false
backup: true
url: "{{ pkg.url }}"
dest: "{{ path.appimage }}/{{ pkg.link_name }}/{{ pkg.file }}"
- name: Link appimage to bin
become: "{{ ext_become }}"
ansible.builtin.file:
state: link
src: "{{ path.appimage }}/{{ pkg.link_name }}/{{ pkg.file }}"
path: "{{ path.bindir }}/{{ pkg.link_name }}"

29
tasks/appimage/neovim.yml Normal file
View File

@@ -0,0 +1,29 @@
# vim: set filetype=yaml.ansible :
---
- name: Install neovim appimage
become: true
block:
- name: Create install dir
ansible.builin.file:
state: directory
mode: "0755"
path: "{{ nvim.instdir }}"
owner: "{{ pkgconfig_neovim.owner }}"
group: "{{ pkgconfig_neovim.group }}"
- name: Get neovim appimage
ansible.builtin.get_url:
mode: "0755"
decompress: false
backup: true
url: "{{ pkgconfig_neovim.appimage_url_pfx }}/{{ pkgconfig_neovim.version }}/nvim.appimage"
checksum: "sha256:{{ pkgconfig_neovim.appimage_url_pfx }}/{{ pkgconfig_neovim.version }}/nvim.appimage.sha256sum"
dest: "{{ pkgconfig_neovim.install_dir }}/nvim.appimage.{{ pkgconfig_neovim.version }}"
owner: "{{ pkgconfig_neovim.owner }}"
group: "{{ pkgconfig_neovim.group }}"
- name: Link neovim appimage
ansible.builtin.file:
state: link
src: "{{ pkgconfig_neovim.install_dir }}/nvim.appimage.{{ pkgconfig_neovim.version }}"
path: "{{ pkgconfig_neovim.install_prefix }}/bin/nvim"

42
tasks/archive/go.yml Normal file
View File

@@ -0,0 +1,42 @@
# vim: set filetype=yaml.ansible :
---
- name: Check if go is already installed
ansible.builtin.stat:
path: "{{ path.go }}/VERSION"
register: stat_path_go
- name: Check version of installed go
when:
- stat_path_go.stat.exists
ansible.builtin.set_fact:
do_go_install: "{{ not (go.vers in lookup('ansible.builtin.file', path.go ~ '/VERSION')) }}"
- name: Install/update go
when:
- (do_go_install is defined and do_go_install) or
not stat_path_go.stat.exists
block:
- name: Download go archive
register: get_url_go
ansible.builtin.get_url:
dest: "{{ d_tempdir.path }}/{{ go.archive }}"
url: "{{ go.base_url }}/{{ go.archive }}"
checksum: "{{ go.sum }}"
decompress: false
mode: '0644'
- name: Extract go package for Linux
become: "{{ ext_become }}"
when:
- ansible_system == 'Linux'
ansible.builtin.unarchive:
dest: "{{ go.prefix }}"
src: "{{ d_tempdir.path }}/{{ go.archive }}"
remote_src: true
- name: Install go macOS using pkg file
become: true
when:
- ansible_distribution == 'MacOSX'
ansible.builtin.command:
cmd: "installer -pkg {{ d_tempdir.path }}/{{ go.archive }} -target {{ go.prefix }}"

36
tasks/archive/luals.yml Normal file
View File

@@ -0,0 +1,36 @@
# vim: set filetype=yaml.ansible :
---
- name: Create temp path
register: d_luals_dl_tmp
ansible.builtin.tempfile:
state: directory
prefix: luals_dl.
- name: Get latest lua-language-server
become: "{{ ext_become }}"
ansible.builtin.get_url:
dest: "{{ d_luals_dl_tmp.path }}/{{ luals_vars.archive }}"
url: "{{ luals_vars.url }}/{{ luals_vars.archive }}"
mode: "0644"
decompress: false
- name: Create install_path
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
path: "{{ path.archive }}/luals"
mode: "0755"
- name: Extract lua language server archive
become: "{{ ext_become }}"
ansible.builtin.unarchive:
dest: "{{ path.archive }}/luals"
src: "{{ d_luals_dl_tmp.path }}/{{ luals_vars.archive }}"
remote_src: true
- name: Link lua language server binary
become: "{{ ext_become }}"
ansible.builtin.file:
state: link
src: "{{ path.bin }}/lua-language-server"
path: "{{ path.archive }}/luals/bin/lua-language-server"

View File

@@ -0,0 +1,29 @@
# vim: set filetype=yaml.ansible :
---
- name: Linux installation
when: ansible_system == 'Linux'
block:
- name: Create nerdfonts directories
become: "{{ ext_become }}"
loop: "{{ nerdfonts.fonts }}"
loop_control:
loop_var: font
register: nerdfont_result
ansible.builtin.file:
path: "{{ path.prefix }}/{{ nerdfonts.path }}/{{ font }}"
state: directory
mode: '0755'
- name: Download and extract nerdfonts
when:
- nerdfont_result is changed or
nerdfonts.force_install
become: "{{ ext_become }}"
loop: "{{ nerdfonts.fonts }}"
loop_control:
loop_var: font
ansible.builtin.unarchive:
creates: "{{ path.prefix }}/{{ nerdfonts.path }}/{{ font }}/README.md"
src: "{{ nerdfonts.base_url }}/{{ font }}.tar.xz"
dest: "{{ path.prefix }}/{{ nerdfonts.path }}/{{ font }}"
remote_src: true

38
tasks/archive/zig.yml Normal file
View File

@@ -0,0 +1,38 @@
# vim: set filetype=yaml.ansible :
---
- name: Check if zig exists
ansible.builtin.stat:
path: "{{ path.archive }}/zig/{{ zig.path }}/zig"
register: r_zig_stat
- name: Update/install zig
when:
- not r_zig_stat.stat.exists
block:
- name: Download zig archive
ansible.builtin.get_url:
dest: "{{ d_tempdir.path }}/{{ zig.pkg }}"
url: "{{ zig.base_url }}/{{ zig.vers }}/{{ zig.pkg }}"
decompress: false
mode: '0644'
- name: Create zig archive dir
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.archive }}/zig"
- name: Extract zig package
become: "{{ ext_become }}"
ansible.builtin.unarchive:
dest: "{{ path.archive }}/zig"
src: "{{ d_tempdir.path }}/{{ zig.pkg }}"
remote_src: true
- name: Link zig binary
become: "{{ ext_become }}"
ansible.builtin.file:
state: link
src: "{{ path.archive }}/zig/{{ zig.path }}/zig"
path: "{{ path.bin }}/zig"

37
tasks/archive/zls.yml Normal file
View File

@@ -0,0 +1,37 @@
# vim: set filetype=yaml.ansible :
---
- name: Check if zls exists
ansible.builtin.stat:
path: "{{ path.archive }}/zls/{{ zls.path }}/zls"
register: r_zls_stat
- name: Update/install zls
block:
- name: Download zls archive
register: get_url_zls
ansible.builtin.get_url:
dest: "{{ d_tempdir.path }}/{{ zls.pkg }}"
url: "{{ zls.base_url }}/{{ zls.pkg }}"
decompress: false
mode: '0644'
- name: Create zls archive dir
become: "{{ ext_become }}"
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ path.archive }}/zls/{{ zls.path }}"
- name: Extract zls package
become: "{{ ext_become }}"
ansible.builtin.unarchive:
dest: "{{ path.archive }}/zls/{{ zls.path }}"
src: "{{ d_tempdir.path }}/{{ zls.pkg }}"
remote_src: true
- name: Link zls binary
become: "{{ ext_become }}"
ansible.builtin.file:
state: link
src: "{{ path.archive }}/zls/{{ zls.path }}/zls"
path: "{{ path.bin }}/zls"

View File

@@ -1,14 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: build and install alacritty
ansible.builtin.command:
cmd:
- cargo
- install
- --root
- "{{ pkgconfig_alacritty.install_prefix }}"
- --git
- "{{ pkgconfig_alacritty.git_repo }}"
- --tag
- "v{{ pkgconfig_alacritty.version }}"
become: true

View File

@@ -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 %}"

View File

@@ -1,33 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: build ghostty from source
block:
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: ghostty.
register: d_ghostty_tmp
- name: clone ghostty git repository
ansible.builtin.git:
depth: 1
dest: "{{ d_ghostty_tmp.path }}/ghostty"
repo: "{{ pkgconfig_ghostty.git_repo }}"
version: "{{ pkgconfig_ghostty.version }}"
- name: build ghostty
ansible.builtin.command:
chdir: "{{ d_ghostty_tmp.path }}/ghostty"
cmd: "zig build -D{{ pkgconfig_ghostty.optimize }}"
register: c_ghostty_build
- name: install ghostty
ansible.file.copy:
src: "{{ d_ghostty_tmp.path }}/ghostty/zig-out/bin/ghostty"
dest: "{{ pkgconfig_ghostty.install_prefix }}/bin/ghostty"
owner: "{{ pkgconfig_ghostty.owner }}"
group: "{{ pkgconfig_ghostty.group }}"
mode: "0755"
remote_src: true
become: "{{ pkgconfig_ghostty.become }}"
become_user: "{% if pkgconfig_ghostty.become %}{{ pkgconfig_ghostty.owner }}{% else %}~{% endif %}"

View File

@@ -1,52 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: check go version
ansible.builtin.command:
cmd: "go version"
register: r_go_version
ignore_errors: true
- name: install/update go
block:
- name: set go arch
ansible.builtin.set_fact:
arch: "{{ pkgconfig_go.archmap[ansible_architecture] }}"
- name: set go archive filename
ansible.builtin.set_fact:
go_archive: "go{{ pkgconfig_go.version }}.{{ ansible_system | lower }}-{{ arch }}.{{ pkgconfig_go.extmap[ansible_system] }}"
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: go_dl.
register: d_go_dl_tmp
- name: download go archive
become: true
ansible.builtin.get_url:
dest: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
url: "https://go.dev/dl/{{ go_archive }}"
checksum: "{{ pkgconfig_go.sums[pkgconfig_go.version][ansible_system][arch] }}"
decompress: false
- name: ensure go install dir exists
become: true
ansible.builtin.file:
path: "{{ pkgconfig_go.install_path }}"
state: directory
- name: extract go package
ansible.builtin.unarchive:
dest: "{{ pkgconfig_go.install_path }}"
src: "{{ d_go_dl_tmp.path }}/{{ go_archive }}"
remote_src: true
when: ansible_system == 'Linux'
become: true
- name: install go macOS use pkg file
ansible.builtin.command:
cmd: "installer -pkg {{ d_go_dl_tmp.path }}/{{ go_archive }} -target /"
when: ansible_system == 'Darwin'
become: true
when: pkgconfig_go.version not in r_go_version.stdout

View File

@@ -1,47 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: Set needed variables lua language server
ansible.builtin.set_fact:
luals_pkg: "lua-language-server-{{ pkgconfig_luals.version }}-{{ pkgconfig_luals.sysmap[ansible_system] }}-{{ pkgconfig_luals.archmap[ansible_architecture] }}.tar.gz"
- name: Check if lua language server is already installed
ansible.builtin.stat:
path: "{{ pkgconfig_luals.install_path }}/bin/lua-language-server"
register: r_luals_stat
- name: Install lua-language-server
when: not r_luals_stat.stat.exists
block:
- name: Create temp path
ansible.builtin.tempfile:
state: directory
prefix: luals_dl.
register: d_luals_dl_tmp
- name: Get latest lua-language-server
ansible.builtin.get_url:
dest: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
url: "{{ pkgconfig_luals.base_url }}/{{ pkgconfig_luals.version }}/{{ luals_pkg }}"
mode: "0644"
decompress: false
- name: Create install_path
ansible.builtin.file:
state: directory
path: "{{ pkgconfig_luals.install_path }}"
mode: "0755"
become: true
- name: Extract lua language server archive
ansible.builtin.unarchive:
dest: "{{ pkgconfig_luals.install_path }}"
src: "{{ d_luals_dl_tmp.path }}/{{ luals_pkg }}"
remote_src: true
become: true
- name: Link lua language server binary
ansible.builtin.file:
state: link
src: "{{ pkgconfig_luals.install_path }}/bin/lua-language-server"
path: "{{ pkgconfig_luals.install_prefix }}/bin/lua-language-server"
become: true

View File

@@ -1,55 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: build neovim from source
block:
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: nvim.
register: d_nvim_tmp
- name: clone neovim git repository
ansible.builtin.git:
depth: 1
dest: "{{ d_nvim_tmp.path }}/neovim"
repo: "{{ pkgconfig_neovim.git_repo }}"
version: "{{ pkgconfig_neovim.version }}"
- name: build and install neovim
ansible.builtin.make:
chdir: "{{ d_nvim_tmp.path }}/neovim"
params:
CMAKE_BUILD_TYPE: "{{ pkgconfig_neovim.build_type }}"
CMAKE_INSTALL_PREFIX: "{{ pkgconfig_neovim.install_prefix }}"
target: install
become: "{{ pkgconfig_neovim.dobecome }}"
become_user: "{% if pkgconfig_neovim.dobecome %}{{ pkgconfig_neovim.owner }}{% else %}~{% endif %}"
when: not pkgconfig_neovim.use_appimage
- name: install neovim appimage
block:
- ansible.builin.file:
state: directory
mode: "0755"
path: "{{ pkgconfig_neovim.install_dir }}"
owner: "{{ pkgconfig_neovim.owner }}"
group: "{{ pkgconfig_neovim.group }}"
- ansible.builtin.get_url:
mode: "0755"
decompress: false
backup: true
url: "{{ pkgconfig_neovim.appimage_url_pfx }}/{{ pkgconfig_neovim.version }}/nvim.appimage"
checksum: "sha256:{{ pkgconfig_neovim.appimage_url_pfx }}/{{ pkgconfig_neovim.version }}/nvim.appimage.sha256sum"
dest: "{{ pkgconfig_neovim.install_dir }}/nvim.appimage.{{ pkgconfig_neovim.version }}"
owner: "{{ pkgconfig_neovim.owner }}"
group: "{{ pkgconfig_neovim.group }}"
- ansible.builtin.file:
state: link
src: "{{ pkgconfig_neovim.install_dir }}/nvim.appimage.{{ pkgconfig_neovim.version }}"
path: "{{ pkgconfig_neovim.install_prefix }}/bin/nvim"
when:
- pkgconfig_neovim.use_appimage
become: "{{ pkgconfig_neovim.dobecome }}"
become_user: "{% if pkgconfig_neovim.dobecome %}{{ pkgconfig_neovim.owner }}{% else %}~{% endif %}"

View File

@@ -1,37 +0,0 @@
# vim: set filetype=yaml.ansible :
# Install nerdfonts for each platform
---
- name: linux installation
when: ansible_system == 'Linux'
block:
- name: set install path for non-system installs
ansible.builtin.set_fact:
nerdfonts_install_path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.local/share/fonts"
when: not pkgconfig_nerdfonts.system_install
- name: set install path for system wide installs
ansible.builtin.set_fact:
nerdfonts_install_path: "/usr/local/share/fonts"
when: pkgconfig_nerdfonts.system_install
- name: create nerdfonts directories
ansible.builtin.file:
path: "{{ nerdfonts_install_path }}/{{ font }}"
state: directory
become: "{{ pkgconfig_nerdfonts.system_install }}"
loop: "{{ pkgconfig_nerdfonts.install }}"
loop_control:
loop_var: font
register: nerdfont_result
- name: Download and extract nerdfonts
ansible.builtin.unarchive:
creates: "{{ nerdfonts_install_path }}/{{ font }}/README.md"
src: "{{ pkgconfig_nerdfonts.base_url }}/{{ font }}.tar.xz"
dest: "{{ nerdfonts_install_path }}/{{ font }}"
remote_src: true
when: nerdfont_result is changed
become: "{{ pkgconfig_nerdfonts.system_install }}"
loop: "{{ pkgconfig_nerdfonts.install }}"
loop_control:
loop_var: font

View File

@@ -1,19 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- ansible.builtin.include_vars:
file: nushell.yml
name: _nushell
- name: install nushell via cargo
become: true
ansible.builtin.command:
cmd:
- cargo
- install
- --root
- "{{ _nushell.install_prefix }}"
- "{{ nuitem }}"
- --locked
loop_control:
loop_var: nuitem
loop: "{{ _nushell.nu_pkgs_list }}"

View File

@@ -1,46 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: download zig archive
ansible.builtin.set_fact:
zig_path: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}"
zig_pkg: "zig-{{ pkgconfig_zig.sysmap[ansible_system] }}-{{ pkgconfig_zig.archmap[ansible_architecture] }}-{{ pkgconfig_zig.version }}.tar.xz"
- name: check if zig {{ pkgconfig_zig.version }} exists
ansible.builtin.stat:
path: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig"
register: r_zig_stat
- name: update/install zig
block:
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: zig_dl.
register: d_zig_dl_tmp
- name: download zig archive
ansible.builtin.get_url:
dest: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
url: "{{ pkgconfig_zig.base_url }}/{{ pkgconfig_zig.version }}/{{ zig_pkg }}"
decompress: false
- name: create install_path
ansible.builtin.file:
state: directory
path: "{{ pkgconfig_zig.install_path }}"
become: true
- name: extract zig package
ansible.builtin.unarchive:
dest: "{{ pkgconfig_zig.install_path }}"
src: "{{ d_zig_dl_tmp.path }}/{{ zig_pkg }}"
remote_src: true
become: true
- name: link zig binary
ansible.builtin.file:
state: link
src: "{{ pkgconfig_zig.install_path }}/{{ zig_path }}/zig"
path: "{{ pkgconfig_zig.install_prefix }}/bin/zig"
become: true
when: not r_zig_stat.stat.exists

View File

@@ -1,46 +0,0 @@
# vim: set filetype=yaml.ansible :
---
- name: download zls archive
ansible.builtin.set_fact:
zls_path: "zls-{{ pkgconfig_zls.sysmap[ansible_system] }}-{{ pkgconfig_zls.archmap[ansible_architecture] }}-{{ pkgconfig_zls.version }}"
zls_pkg: "zls-{{ pkgconfig_zls.sysmap[ansible_system] }}-{{ pkgconfig_zls.archmap[ansible_architecture] }}-{{ pkgconfig_zls.version }}.tar.xz"
- name: check if zls {{ pkgconfig_zls.version }} exists
ansible.builtin.stat:
path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}/zls"
register: r_zls_stat
- name: update/install zls
block:
- name: create temp path
ansible.builtin.tempfile:
state: directory
prefix: zls_dl.
register: d_zls_dl_tmp
- name: download zls archive
ansible.builtin.get_url:
dest: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}"
url: "{{ pkgconfig_zls.base_url }}/{{ zls_pkg }}"
decompress: false
- name: create install_path
ansible.builtin.file:
state: directory
path: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}"
become: true
- name: extract zls package
ansible.builtin.unarchive:
dest: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}"
src: "{{ d_zls_dl_tmp.path }}/{{ zls_pkg }}"
remote_src: true
become: true
- name: link zls binary
ansible.builtin.file:
state: link
src: "{{ pkgconfig_zls.install_path }}/{{ zls_path }}/zls"
path: "{{ pkgconfig_zls.install_prefix }}/bin/zls"
become: true
when: not r_zls_stat.stat.exists

9
tasks/cargo.yml Normal file
View File

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

View File

@@ -0,0 +1,10 @@
# vim: set filetype=yaml.ansible :
---
- name: Set alacritty configuration
ansible.builtin.set_fact:
alacritty:
deps: "{{ pkgconfig.alacritty[ansible_os_family].build_deps }}"
vers: "{{ pkgconfig.alacritty.version }}"
cask: "{{ pkgconfig.alacritty.cask | default(omit) }}"
locked: true
name: alacritty

View File

@@ -0,0 +1,22 @@
# vim: set filetype=yaml.ansible :
---
- name: Set bitwarden install method
ansible.builtin.set_fact:
bitwarden:
method: "{{ pkgconfig.bitwarden.method[ansible_distribution] | default('flatpak') }}"
- name: Set bitwarden config
ansible.builtin.set_fact:
bitwarden:
pkg: "{{ pkgconfig.bitwarden[bitwarden.method] }}"
method: "{{ bitwarden.method }}"
- name: Set bitwarden config for appimage install
when:
- bitwarden.method == 'appimage'
ansible.builtin.set_fact:
bitwarden:
method: appimage
file: "{{ pkgconfig.bitwarden.appimage.name }}"
link_name: "{{ pkgconfig.bitwarden.appimage.link_name }}"
url: "{{ pkgconfig.bitwarden.appimage.url }}"

8
tasks/config/broot.yml Normal file
View File

@@ -0,0 +1,8 @@
---
- name: Set broot config
ansible.builtin.set_fact:
broot:
vers: "{{ pkgconfig.broot.version }}"
name: broot
locked: true
deps: "{{ pkgconfig.broot.build_deps[ansible_os_family] }}"

View File

@@ -0,0 +1,7 @@
# vim: set filetype=yaml.ansible :
---
- name: Set carapace config
ansible.builtin.set_fact:
carapace:
pkgs: "{{ pkgconfig.carapace.pkgs[ansible_system] }}"
repo: "{{ pkgconfig.carapace.repo[ansible_os_family] }}"

7
tasks/config/choose.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- name: Set choose config
ansible.builtin.set_fact:
choose:
name: choose
vers: "{{ pkgconfig.choose.version }}"
locked: true

4
tasks/config/clangd.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set clangd config
ansible.builtin.set_fact:
clangd:
pkgs: "{{ pkgconfig.clangd.pkgs[ansible_os_family] }}"

4
tasks/config/consul.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set configuration for consul
ansible.builtin.set_fact:
consul:
pkgs: "{{ pkgconfig.consul.pkgs[ansible_system] }}"

4
tasks/config/fd.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set fd config
ansible.builtin.set_fact:
fd:
pkgs: "{{ pkgconfig.fd.pkgs[ansible_system] }}"

25
tasks/config/ghostty.yml Normal file
View File

@@ -0,0 +1,25 @@
# vim: set filetype=yaml.ansible :
---
- name: Set ghostty install method
ansible.builtin.set_fact:
ghostty:
method: "{{ pkgconfig.ghostty.methods[ansible_distribution] | default(pkgconfig.ghostty.methods.default) }}"
- name: Set ghostty config
ansible.builtin.set_fact:
ghostty:
method: "{{ ghostty.method }}"
arch: "{{ pkgconfig.ghostty.archmap[ansible_architecture] }}"
deps: "{{ pkgconfig.ghostty.build_deps[ansible_os_family] }}"
vers: "{{ pkgconfig.ghostty.version }}"
pkg: "{{ pkgconfig.ghostty[ghostty.method] }}"
- name: Set ghostty config for appimage install
when:
- ghostty.method == 'appimage'
ansible.builtin.set_fact:
ghostty:
method: "{{ ghostty.method }}"
file: "Ghostty-{{ ghostty.vers }}-{{ ghostty.arch }}.AppImage"
link_name: "{{ pkgconfig.ghostty.appimage.link_name }}"
url: "{{ pkgconfig.ghostty.appimage.base_url }}/v{{ ghostty.vers }}/Ghostty-{{ ghostty.vers }}-{{ ghostty.arch }}.AppImage"

6
tasks/config/git.yml Normal file
View File

@@ -0,0 +1,6 @@
# vim: set filetype=yaml.ansible :
---
- name: Set git config
ansible.builtin.set_fact:
git:
pkgs: "{{ pkgconfig.git.pkgs[ansible_system] }}"

23
tasks/config/go.yml Normal file
View File

@@ -0,0 +1,23 @@
# vim: set filetype=yaml.ansible :
---
- name: Set go configuration
ansible.builtin.set_fact:
go:
method: archive
arch: "{{ pkgconfig.go.archmap[ansible_architecture] }}"
ext: "{{ pkgconfig.go.extmap[ansible_system] }}"
sys: "{{ ansible_system | lower }}"
vers: "{{ pkgconfig.go.version }}"
- name: Set go composite facts
ansible.builtin.set_fact:
go:
method: archive
arch: "{{ go.arch }}"
archive: "go{{ go.vers }}.{{ go.sys }}-{{ go.arch }}.{{ pkgconfig.go.extmap[ansible_system] }}"
ext: "{{ go.ext }}"
prefix: "{% if ansible_distribution == 'MacOSX' %}/{% else %}{{ path.prefix }}{% endif %}"
sum: "{{ pkgconfig.go.sums[go.vers][ansible_system][go.arch] }}"
sys: "{{ go.sys }}"
base_url: "{{ pkgconfig.go.base_url }}"
vers: "{{ go.vers }}"

View File

@@ -0,0 +1,13 @@
- name: Set OS name for RedHat family
when:
- ansible_os_family == 'RedHat'
ansible.builtin.set_fact:
hashicorp:
repo: "{{ pkgconfig.hashicorp.Linux[rpm_dist.stdout].repo }}"
- name: Set repo for debian
when:
- ansible_os_family == 'Debian'
ansible.builtin.set_fact:
hashicorp:
repo: "{{ pkgconfig.hashicorp.Linux.Debian.repo }}"

10
tasks/config/httpie.yml Normal file
View File

@@ -0,0 +1,10 @@
- name: Set method for httpie
ansible.builtin.set_fact:
httpie:
method: "{{ pkgconfig.httpie.method[ansible_distribution] | default(pkgconfig.httpie.method.default) }}"
- name: Set config for httpie
ansible.builtin.set_fact:
httpie:
method: "{{ httpie.method }}"
pkg: "{{ pkgconfig.httpie[httpie.method] }}"

4
tasks/config/kitty.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set kitty config
ansible.builtin.set_fact:
kitty:
pkgs: "{{ pkgconfig.kitty.pkgs[ansible_system] }}"

View File

@@ -0,0 +1,8 @@
# vim: set filetype=yaml.ansible :
---
- name: Set libreoffice config
ansible.builtin.set_fact:
libreoffice:
method: "{{ pkgconfig.libreoffice.methods[ansible_distribution] | default(pkgconfig.libreoffice.methods.default) }}"
flatpak: "{{ pkgconfig.libreoffice.flatpak }}"
pkgs: "{{ pkgconfig.libreoffice.pkgs[ansible_os_family] }}"

14
tasks/config/luals.yml Normal file
View File

@@ -0,0 +1,14 @@
# vim: set filetype=yaml.ansible :
---
- name: Set luals config
ansible.builtin.set_fact:
luals:
vers: "{{ pkgconfig.luals.version }}"
sys: "{{ pkgconfig.luals.sysmap[ansible_system] }}"
arch: "{{ pkgconfig.luals.archmap[ansible_architecture] }}"
- name: Set luals variables
ansible.builtin.set_fact:
luals_vars:
archive: "lua-language-server-{{ luals.vers }}-{{ luals.sys }}-{{ luals.arch }}.tar.gz"
url: "{{ pkgconfig.luals.base_url }}/{{ luals.vers }}"

9
tasks/config/neovide.yml Normal file
View File

@@ -0,0 +1,9 @@
# vim: set filetype=yaml.ansible :
---
- name: Set neovide config
ansible.builtin.set_fact:
neovide:
name: neovide
deps: "{{ pkgconfig.neovide.build_deps[ansible_os_family] }}"
vers: "{{ pkgconfig.neovide.version }}"
locked: true

23
tasks/config/neovim.yml Normal file
View File

@@ -0,0 +1,23 @@
# vim: set filetype=yaml.ansible :
---
- name: Set neovim install method
ansible.builtin.set_fact:
neovim:
method: "{{ pkgconfig.neovim.methods[ansible_distribution] | default(pkgconfig.neovim.methods.default) }}"
- name: Set neovim config
ansible.builtin.set_fact:
neovim:
method: "{{ neovim.method }}"
vers: "v{{ pkgconfig.neovim.version }}"
pkgs: "{{ pkgconfig.neovim.pkgs[ansible_distribution] | default(pkgconfig.neovim.pkgs.default) }}"
- name: Set neovim config for appimage install
when:
- neovim.method == 'appimage'
ansible.builtin.set_fact:
neovim:
method: "{{ neovim.method }}"
file: "nvim-linux-{{ ansible_architecture }}.appimage"
link_name: nvim
url: "{{ pkgconfig.neovim.appimage.base_url }}/{{ neovim.vers }}/nvim-linux-{{ ansible_architecture }}.appimage"

View File

@@ -0,0 +1,15 @@
# vim: set filetype=yaml.ansible :
---
- name: Set facts for nerdfonts
ansible.builtin.set_fact:
nerdfonts:
fonts:
- CascadiaCode
- FiraCode
- Hasklig
- Lilex
- Monoid
- NerdFontsSymbolsOnly
path: "{{ pkgconfig.nerdfonts.path }}"
base_url: "{{ pkgconfig.nerdfonts.base_url }}"
force_install: "{{ pkgconfig.force_install_nerdfonts | default(false) }}"

View File

@@ -0,0 +1,13 @@
- name: Set nextcloud install method
ansible.builtin.set_fact:
nextcloud:
method: "{{ pkgconfig.nextcloud.method | default('flatpak') }}"
- name: Set nextcloud config
when:
- nextcloud.method == 'flatpak'
ansible.builtin.set_fact:
nextcloud:
method: "{{ nextcloud.method }}"
name: "{{ pkgconfig.nextcloud.flatpak.name }}"
remote: "{{ pkgconfig.nextcloud.flatpak.remote }}"

4
tasks/config/nodejs.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set nodejs config
ansible.builtin.set_fact:
nodejs:
pkgs: "{{ pkgconfig.nodejs.pkgs[ansible_system] }}"

4
tasks/config/nomad.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set nomad config
ansible.builtin.set_fact:
nomad:
pkgs: "{{ pkgconfig.nomad.pkgs[ansible_system] }}"

4
tasks/config/packer.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set packer config
ansible.builtin.set_fact:
packer:
pkgs: "{{ pkgconfig.packer.pkgs[ansible_system] }}"

6
tasks/config/pgadmin.yml Normal file
View File

@@ -0,0 +1,6 @@
- name: Set pgadmin config
ansible.builtin.set_fact:
pgadmin:
method: "{{ pkgconfig.pgadmin.methods[ansible_distribution] | default(pkgconfig.pgadmin.methods.default) }}"
pkgs: "{{ pkgconfig.pgadmin.pkgs[ansible_system] }}"
flatpak: "{{ pkgconfig.pgadmin.flatpak }}"

5
tasks/config/python3.yml Normal file
View File

@@ -0,0 +1,5 @@
---
- name: Set python3 config
ansible.builtin.set_fact:
python3:
pkgs: "{{ pkgconfig.python3.pkgs[ansible_system] }}"

6
tasks/config/rust.yml Normal file
View File

@@ -0,0 +1,6 @@
# vim: set filetype=yaml.ansible :
---
- name: Set rust config
ansible.builtin.set_fact:
rust:
pkgs: "{{ pkgconfig.rust.pkgs[ansible_system] }}"

View File

@@ -0,0 +1,5 @@
- name: Set tailscale config
ansible.builtin.set_fact:
tailscale:
url_base: "{{ pkgconfig.tailscale.url_base }}"
release: "{{ pkgconfig.tailscale.release[ansible_distribution_release] | default({}) }}"

View File

@@ -0,0 +1,4 @@
- name: Set terraform config
ansible.builtin.set_fact:
terraform:
pkgs: "{{ pkgconfig.terraform.pkgs[ansible_system] }}"

View File

@@ -0,0 +1,4 @@
- name: Set terraformls config
ansible.builtin.set_fact:
terraformls:
pkgs: "{{ pkgconfig.terraformls.pkgs[ansible_system] }}"

4
tasks/config/tidy.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set tidy config
ansible.builtin.set_fact:
tidy:
pkgs: "{{ pkgconfig.tidy.pkgs[ansible_system] }}"

4
tasks/config/vault.yml Normal file
View File

@@ -0,0 +1,4 @@
- name: Set vault config
ansible.builtin.set_fact:
vault:
pkgs: "{{ pkgconfig.vault.pkgs[ansible_system] }}"

7
tasks/config/xh.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- name: Set xh config
ansible.builtin.set_fact:
xh:
vers: "{{ pkgconfig.xh.version }}"
name: xh
locked: true

22
tasks/config/zfs.yml Normal file
View File

@@ -0,0 +1,22 @@
---
- name: Set distro name
when:
- ansible_os_family == 'RedHat'
ansible.builtin.set_fact:
rhname: "{%if ansible_distribution == 'Fedora' %}fedora{% else %}epel{% endif %}"
- name: Set deps for distros
ansible.builtin.set_fact:
zfs:
deps: "{% if ansible_distribution == 'Fedora' %}{{ pkgconfig.zfs.build_deps.Fedora }}{% else %}{{ pkgconfig.zfs.build_deps[ansible_os_family] }}{% endif %}"
- name: Set ZFS config
ansible.builtin.set_fact:
zfs:
repo_pkg: "{{ pkgconfig.zfs.repo_base }}/{{ rhname }}/zfs-release-{{ pkgconfig.zfs[rhname].release }}{{ rpm_dist.stdout }}.noarch.rpm"
deps: "{{ zfs.deps }}"
pkgs: "{{ pkgconfig.zfs.pkgs[ansible_os_family] }}"
skip_gpg_check: "{{ rhname == 'fedora' }}"
release: "{{ ansible_distribution_release }}"
gpg_key: "{{ pkgconfig.zfs.gpg_key }}"
gpg_fp: "{{ pkgconfig.zfs.gpg_key_fingerprint }}"

9
tasks/config/zig.yml Normal file
View File

@@ -0,0 +1,9 @@
# vim: set filetype=yaml.ansible :
---
- name: Set zig configuration
ansible.builtin.set_fact:
zig:
vers: "{{ pkgconfig.zig.version }}"
path: "zig-{{ pkgconfig.zig.sysmap[ansible_system] }}-{{ pkgconfig.zig.archmap[ansible_architecture] }}-{{ pkgconfig.zig.version }}"
pkg: "zig-{{ pkgconfig.zig.sysmap[ansible_system] }}-{{ pkgconfig.zig.archmap[ansible_architecture] }}-{{ pkgconfig.zig.version }}.tar.xz"
base_url: "{{ pkgconfig.zig.base_url }}"

9
tasks/config/zls.yml Normal file
View File

@@ -0,0 +1,9 @@
# vim: set filetype=yaml.ansible :
---
- name: Set zls config
ansible.builtin.set_fact:
zls:
path: "zls-{{ pkgconfig.zls.sysmap[ansible_system] }}-{{ pkgconfig.zls.archmap[ansible_architecture] }}-{{ pkgconfig.zls.version }}"
pkg: "zls-{{ pkgconfig.zls.sysmap[ansible_system] }}-{{ pkgconfig.zls.archmap[ansible_architecture] }}-{{ pkgconfig.zls.version }}.tar.xz"
vers: "{{ pkgconfig.zls.version }}"
base_url: "{{ pkgconfig.zls.base_url }}"

59
tasks/facts.yml Normal file
View File

@@ -0,0 +1,59 @@
# vim: set filetype=yaml.ansible :
---
- name: Set facts for installation
ansible.builtin.set_fact:
ext_become: "{{ not use_local }}"
path:
prefix: "{% if use_local %}{{ lookup('ansible.builtin.env', 'HOME') }}/.local{% else %}{{ defaults.path.prefix }}{% endif %}"
- name: Set Linux specific facts
when:
- ansible_system == 'Linux'
ansible.builtin.set_fact:
flatpak_remote: # flatpak remotes, includes flathub by default
- name: flathub
url: https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak_method: "{% if use_local %}user{% else %}system{% endif %}"
pkg_appimage: [] # appimages to install
pkg_flatpak: [] # flatpak packages to install
pkg_snap: [] # snpacraft.io packages
sys_pkg_become: true # Linux package managers require sudo access
- name: Set rpm dist if RedHat based
when:
- ansible_os_family == 'RedHat'
changed_when: false
register: rpm_dist
ansible.builtin.command:
cmd: rpm --eval "%{dist}"
- name: Set macOS specific facts
when:
- ansible_distribution == 'MacOSX'
ansible.builtin.set_fact:
brewtap: [] # homebrew taps to add
pipx_exec: "/opt/homebrew/bin/pipx"
pkg_cask: [] # homebrew casks
pkg_tap: [] # homebrew tap packages
sys_pkg_become: false # homebrew doesn't require sudo access
- name: Set paths
ansible.builtin.set_fact:
path:
prefix: "{{ path.prefix }}"
appimage: "{{ path.appimage | default(path.prefix ~ defaults.path.suffix.appimage) }}"
archive: "{{ path.archive | default(path.prefix ~ defaults.path.suffix.archive) }}"
bin: "{{ path.bin | default(path.prefix ~ defaults.path.suffix.bin) }}"
cargo: "{{ path.cargo | default(path.prefix ~ defaults.path.suffix.cargo) }}"
go: "{% if ansible_distribution == 'MacOSX' %}/usr/local/go{% else %}{{ path.go | default(path.prefix ~ defaults.path.suffix.go) }}{% endif %}"
pipx: "{{ path.pipx | default(path.prefix ~ defaults.path.suffix.pipx) }}"
- name: Set OS independant facts
ansible.builtin.set_fact:
pkg_archive: [] # packages installed via prebuilt archive
pkg_cargo: [] # rust packages from cargo
pkg_go: [] # go applications
pkg_npm: [] # npm commands
pkg_pipx: [] # pipx packages
pkg_src: [] # packages built from source
pkg_sys: [] # system package manager packages, homebrew on macOS, dnf for RedHat based, apt for Debian Based

8
tasks/go.yml Normal file
View File

@@ -0,0 +1,8 @@
---
- name: Install go package {{ pkg }}
become: "{{ ext_become }}"
environment:
GOBIN: "{{ path.bin }}"
PATH: "{{ path.go }}/bin:$PATH"
ansible.builtin.command:
cmd: go install {{ pkg }}

50
tasks/linux.yml Normal file
View File

@@ -0,0 +1,50 @@
# vim: set filetype=yaml.ansible :
---
- name: Install flatpaks on Linux Systems
when:
- pkg_flatpak|length > 0
block:
- name: Add flatpak remotes
when:
- flatpak_remote|length > 0
become: "{{ ext_become }}"
loop: "{{ flatpak_remote | unique }}"
loop_control:
loop_var: remote
community.general.flatpak_remote:
enabled: true
flatpakrepo_url: "{{ remote.url }}"
method: "{{ flatpak_method }}"
name: "{{ remote.name }}"
state: present
- name: Install flatpaks
when:
- pkg_flatpak|length > 0
become: "{{ ext_become }}"
block:
- name: Debug flatpak
loop: "{{ pkg_flatpak | unique }}"
loop_control:
loop_var: flatpak
ansible.builtin.debug:
var: flatpak
- name: Install flatpak
loop: "{{ pkg_flatpak | unique }}"
loop_control:
loop_var: flatpak
community.general.flatpak:
method: "{{ flatpak_method }}"
name: "{{ flatpak.name }}"
remote: "{{ flatpak.remote | default('flathub') }}"
state: present
- name: Install pkg_appimage
when:
- pkg_appimage|length > 0
loop: "{{ pkg_appimage }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: appimage.yml

22
tasks/macos.yml Normal file
View File

@@ -0,0 +1,22 @@
# vim: set filetype=yaml.ansible :
---
- name: Tap homebrew taps
when:
- brewtap|length > 0
community.general.homebrew_tap:
name: "{{ brewtap | unique }}"
state: present
- name: Install homebrew casks
when: pkg_cask|length > 0
community.general.homebrew_cask:
name: "{{ pkg_cask | unique }}"
state: present
# TODO: fix the need to have this workaround
- name: Workaround to install homebrew taps
when:
- pkg_tap|length > 0
changed_when: true
ansible.builtin.command:
cmd: "brew install {{ (pkg_tap | unique) | join(' ') }}"

View File

@@ -1,196 +1,116 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: generate package installation lists # create all the facts used throughout the role, but shouldn't be touched
# by the user
- name: Create temporary directory for downloads
ansible.builtin.tempfile:
state: directory
prefix: ansible_role_package.
register: d_tempdir
- name: Set installation facts
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: addpkg.yml file: facts.yml
- name: Ensure required path exist
become: "{{ ext_become }}"
loop: "{{ path | dict2items }}"
loop_control:
loop_var: p
ansible.builtin.file:
state: directory
mode: '0755'
path: "{{ p.value }}"
- name: Read default package configuration
ansible.builtin.include_vars:
dir: pkgs
extensions:
- yml
name: pkgconfig
- name: Generate package installation lists
loop: "{{ packages | unique }}" loop: "{{ packages | unique }}"
loop_control: loop_control:
loop_var: pkg loop_var: pkg
- name: redhat based OS
block:
- name: upgrade dnf packages
ansible.builtin.dnf:
name: "*"
state: latest
become: true
when: full_upgrade
- name: install dnf packages
ansible.builtin.dnf:
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
loop: "{{ flatpkg_repo }}"
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 }}"
state: latest
become: true
when:
- flatpkgs|length > 0
when: ansible_os_family == 'RedHat'
- name: debian based OS
block:
- name: upgrade apt packages
ansible.builtin.apt:
name: "*"
state: latest
become: true
when: full_upgrade
- name: install apt packages
ansible.builtin.apt:
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
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:
- name: upgrade homebrew packages
community.general.homebrew:
name: "*"
state: latest
when: full_upgrade
- name: tap homebrew taps
community.general.homebrew_tap:
name: "{{ brewtaps | unique }}"
state: present
when: brewtaps|length > 0
- name: install homebrew packages
community.general.homebrew:
name: "{{ syspkgs | unique }}"
state: "{{ install_state }}"
when: syspkgs|length > 0
- name: install homebrew casks
community.general.homebrew_cask:
name: "{{ caskpkgs | unique }}"
state: "{{ install_state }}"
when: caskpkgs|length > 0
- name: workaround to install homebrew taps
ansible.builtin.command:
cmd: "brew install {{ tappkg }}"
loop: "{{ tappkgs | unique }}"
loop_control:
loop_var: tappkg
when: ansible_os_family == 'Darwin'
- name: ensure /usr/local/bin exists
ansible.builtin.file:
state: directory
path: /usr/local/bin
owner: root
mode: '0755'
become: true
- name: install srcpkgs
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: "build/{{ srcpkg }}.yml" file: addpkg.yml
loop: "{{ srcpkgs | unique }}"
loop_control:
loop_var: srcpkg
when: srcpkgs|length > 0
- name: install cargo packages at specific version - name: Flush handlers to ensure dependencies are installed
community.general.cargo: ansible.builtin.meta: flush_handlers
name: "{{ cargopkg.name }}"
version: "{{ cargopkg.version }}"
path: "{{ cargopkg.path | default(default_config.install_prefix) }}"
locked: "{{ cargopkg.locked | default(false) }}"
become: true
when: cargoversioned|length > 0
loop: "{{ cargoversioned | unique }}"
loop_control:
loop_var: cargopkg
- name: Install cargo packages at latest version - name: Add needed MacOS packages
community.general.cargo: when:
name: "{{ cargopkg }}" - ansible_distribution == 'MacOSX'
state: latest ansible.builtin.set_fact:
locked: "{{ cargopkg.locked | default(false) }}" pkg_sys: "{{ pkg_sys + ['gnu-tar', 'virtualenv'] }}"
when: cargopkgs|length > 0
loop: "{{ cargopkgs | unique }}"
loop_control:
loop_var: cargopkg
- name: Install local go packages - name: Install sys_pkgs list using system package manager
environment: become: "{{ sys_pkg_become }}"
GOROOT: /usr/local/go ansible.builtin.package:
PATH: /usr/local/go/bin:$PATH name: "{{ pkg_sys | unique }}"
ansible.builtin.command: state: present
cmd: "go install {{ gopkg }}"
loop: "{{ gopkgs | unique }}" - name: Linux specific tasks
when:
- ansible_system == 'Linux'
ansible.builtin.include_tasks:
file: linux.yml
- name: MacOS specific tasks
when:
- ansible_distribution == 'MacOSX'
ansible.builtin.include_tasks:
file: macos.yml
- name: Install pkg_archive
when:
- pkg_archive|length > 0
loop: "{{ pkg_archive }}"
loop_control: loop_control:
loop_var: gopkg loop_var: pkg
when: gopkgs|length > 0 ansible.builtin.include_tasks:
file: "archive/{{ pkg }}.yml"
- name: Build and install source packages
when:
- pkg_src|length > 0
loop: "{{ pkg_src | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: "src/{{ pkg }}.yml"
- name: Install cargo packages
when:
- pkg_cargo|length > 0
loop: "{{ pkg_cargo | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: cargo.yml
- name: Install go packages
when:
- pkg_go|length > 0
loop: "{{ pkg_go | unique }}"
loop_control:
loop_var: pkg
ansible.builtin.include_tasks:
file: go.yml
- name: Install local npm packages - name: Install local npm packages
become: "{% if ansible_system == 'Linux' %}true{% else %}false{% endif %}" loop: "{{ pkg_npm | unique }}"
community.general.npm:
global: true
name: "{{ npmpkg }}"
state: latest
loop: "{{ npmpkgs | unique }}"
loop_control: loop_control:
loop_var: npmpkg loop_var: pkg
when: npmpkgs|length > 0 ansible.builtin.include_tasks:
file: npm.yml
- name: Install python pipx packages for user - name: Install python pipx packages for user
community.general.pipx: when:
executable: "{% if ansible_os_family == 'Darwin' %}/opt/homebrew/bin/pipx{% else %}/usr/bin/pipx{% endif %}" - pkg_pipx|length > 0
name: "{{ pipxpkg }}" loop: "{{ pkg_pipx | unique }}"
state: latest
loop: "{{ pipxpkgs | unique }}"
loop_control: loop_control:
loop_var: pipxpkg loop_var: pkg
when: pipxpkgs|length > 0 ansible.builtin.include_tasks:
file: pipx.yml

8
tasks/npm.yml Normal file
View File

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

11
tasks/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

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_go
file: pkgs/go.yml notify:
when: pkgconfig_go is undefined - Depend go
changed_when: true
- name: add to gopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + ['github.com/air-verse/air@latest'] }}" pkg_go: "{{ pkg_go + ['github.com/air-verse/air@latest'] }}"

View File

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

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + ['@ansible/ansible-language-server'] }}" pkg_npm: "{{ pkg_npm + ['@ansible/ansible-language-server'] }}"

View File

@@ -1,5 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to pkgs - name: Append to pkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'ansible-lint' ] }}" pkg_sys: "{{ pkg_sys + ['ansible-lint'] }}"

View File

@@ -1,5 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to pkgs - name: Append to pkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'ansible' ] }}" pkg_sys: "{{ pkg_sys + ['ansible'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + [ 'bash-language-server' ] }}" pkg_npm: "{{ pkg_npm + ['bash-language-server'] }}"

View File

@@ -1,5 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to syspkgs - name: Append to pkg_sys
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'bat' ] }}" pkg_sys: "{{ pkg_sys + ['bat'] }}"

View File

@@ -1,31 +1,22 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_vars: - name: Append to pkg_flatpak
file: bitwarden.yml
name: _bitwarden
- ansible.builtin.set_fact:
pkgconfig_bitwarden: "{{ _bitwarden | ansible.builtin.combine(pkgconfig.bitwarden) }}"
- name: append to flatpkgs
block:
- ansible.builtin.include_tasks:
file: pkgs/flatpak.yml
when: flatpak is undefined
- ansible.builtin.set_fact:
flatpkgs: "{{ flatpkgs + [ 'com.bitwarden.desktop' ] }}"
when: when:
- ansible_os_family != 'Darwin' - bitwarden.method == 'flatpak'
- pkgconfig_bitwarden.use_flatpak notify:
- Depend flatpak
- name: append to srcpkgs changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ srcpkgs + [ 'bitwarden' ] }}" pkg_flatpak: "{{ pkg_flatpak + [bitwarden.pkg] }}"
- name: Append to pkg_appimage
when: when:
- ansible_os_family != 'Darwin' - bitwarden.method == 'appimage'
- not pkgconfig_bitwarden.use_flatpak
- name: append to caskpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
caskpkgs: "{{ caskpkgs + [ 'bitwarden' ] }}" pkg_appimage: "{{ pkg_appimage + [bitwarden.pkg] }}"
when: ansible_os_family == 'Darwin'
- name: Append to pkg_cask
when:
- bitwarden.method == 'brew'
ansible.builtin.set_fact:
pkg_cask: "{{ pkg_cask + [bitwarden] }}"

View File

@@ -1,11 +1,13 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to pkgs - name: Append to pkg_sys
when:
- ansible_system == 'Linux'
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'blender' ] }}" pkg_sys: "{{ pkg_sys + ['blender'] }}"
when: ansible_os_family != 'Darwin'
- name: append to caskpkgs - name: Append to pkg_cask
when:
- ansible_system == 'Darwin'
ansible.builtin.set_fact: ansible.builtin.set_fact:
caskpkgs: "{{ caskpkgs + [ 'blender' ] }}" pkg_cask: "{{ pkg_cask + ['blender'] }}"
when: ansible_os_family == 'Darwin'

View File

@@ -1,21 +1,17 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: linux specific install - name: Append to pkg_sys and pkg_cargo
block:
- ansible.builtin.include_tasks:
file: "pkgs/rust.yml"
when: pkgconfig_rust is undefined
- name: append to syspkgs and cargopkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + pkgconfig.broot.deps[ansible_os_family] }}"
cargopkgs: "{{ cargopkgs + [ 'broot' ] }}"
when: when:
- ansible_os_family != 'Darwin' - ansible_system == 'Linux'
notify:
- name: append to syspkgs - Depend cargo
changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'broot' ] }}" pkg_sys: "{{ pkg_sys + broot.deps }}"
pkg_cargo: "{{ pkg_cargo + [broot] }}"
- name: Append to pkg_sys
when: when:
- ansible_os_family == 'Darwin' - ansible_system == 'Darwin'
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['broot'] }}"

View File

@@ -1,5 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to pkgs - name: Append to pkg_ssys
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'btop' ] }}" pkg_sys: "{{ pkg_sys + ['btop'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_go
file: pkgs/go.yml notify:
when: pkgconfig_go is undefined - Depend go
changed_when: true
- name: add to gopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + ['github.com/bufbuild/buf/cmd/buf@latest'] }}" pkg_go: "{{ pkg_go + ['github.com/bufbuild/buf/cmd/buf@latest'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_go
file: pkgs/go.yml notify:
when: pkgconfig_go is undefined - Depend go
changed_when: true
- name: add to gopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + [ 'github.com/bufbuild/buf-language-server/cmd/bufls@latest' ] }}" pkg_go: "{{ pkg_go + ['github.com/bufbuild/buf-language-server/cmd/bufls@latest'] }}"

View File

@@ -1,31 +1,27 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_vars: - name: Enable carapace yum repository
file: carapace.yml when:
name: _carapace - ansible_os_family == 'RedHat'
- ansible.builtin.set_fact: become: true
pkgconfig_carapace: "{{ _carapace | ansible.builtin.combine(pkgconfig.carapace) }}"
- name: enable carapace yum repository
ansible.builtin.yum_repository: ansible.builtin.yum_repository:
name: carapace-yum name: "{{ carapace.repo.name }}"
description: carapace-yum description: "{{ carapace.repo.description }}"
baseurl: https://yum.fury.io/rsteube/ baseurl: "{{ carapace.repo.baseurl }}"
enabled: true enabled: true
gpgcheck: false gpgcheck: false
state: present state: present
when: ansible_os_family == 'RedHat'
become: true
- name: enable carapace apt repository - name: Enable carapace apt repository
when:
- ansible_os_family == 'Debian'
become: true become: true
ansible.builtin.apt_repository: ansible.builtin.apt_repository:
repo: "deb [trusted=yes] https://apt.fury.io/rsteube/ /" repo: "{{ carapace.repo.repo }}"
filename: "{{ carapace.repo.name }}"
state: present state: present
update_cache: false update_cache: false
filename: carapace
when: ansible_os_family == 'Debian'
- name: add carapace to syspkgs - name: Add carapace to pkg_sys
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + pkgconfig_carapace.pkgs[ansible_system] }}" pkg_sys: "{{ pkg_sys + carapace.pkgs }}"

View File

@@ -1,10 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Append to pkg_go
file: "pkgs/go.yml" notify:
when: - Depend go
- pkgconfig_go is undefined changed_when: true
- name: append to gopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + [ 'github.com/cheat/cheat/cmd/cheat@latest' ] }}" pkg_go: "{{ pkg_go + ['github.com/cheat/cheat/cmd/cheat@latest'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_go
file: pkgs/go.yml notify:
when: pkgconfig_go is undefined - Depend go
changed_when: true
- name: add to gopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + ['github.com/mrtazz/checkmake/cmd/checkmake@latest'] }}" pkg_go: "{{ pkg_go + ['github.com/mrtazz/checkmake/cmd/checkmake@latest'] }}"

View File

@@ -1,19 +1,16 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: linux specific - name: Append to cargopkgs
block:
- ansible.builtin.include_tasks:
file: "pkgs/rust.yml"
when: when:
- pkgconfig_rust is undefined - ansible_system == 'Linux'
- name: append to cargopkgs notify:
- Depend cargo
changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
cargopkgs: "{{ cargopkgs + [ 'choose' ] }}" pkg_cargo: "{{ pkg_cargo + [choose] }}"
when:
- ansible_os_family != 'Darwin'
- name: append to syspkgs - name: Append to pkg_sys
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'choose-rust' ] }}"
when: when:
- ansible_os_family == 'Darwin' - ansible_system == 'Darwin'
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['choose-rust'] }}"

View File

@@ -1,7 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.set_fact: - name: Append clangd to pkg_sys
clangd: true ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + clangd.pkgs }}"
- ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + pkgconfig.clangd.pkgs[ansible_os_family] }}"

View File

@@ -1,5 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to pkgs - name: Append to pkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'cmake' ] }}" pkg_sys: "{{ pkg_sys + ['cmake'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_pipx
file: pkgs/pipx.yml notify:
when: pipx is undefined - Depend pipx
changed_when: true
- name: add to pipxpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
pipxpkgs: "{{ pipxpkgs + ['cmakelang'] }}" pkg_pipx: "{{ pkg_pipx + ['cmakelang'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + ['@commitlint/cli'] }}" pkg_npm: "{{ pkg_npm + ['@commitlint/cli'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + ['@commitlint/config-conventional'] }}" pkg_npm: "{{ pkg_npm + ['@commitlint/config-conventional'] }}"

View File

@@ -1,16 +1,19 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
# load hashicorp configuration
--- ---
- name: ensure hashicorp repo is active - name: Append to pkg_sys
ansible.builtin.include_tasks: when:
file: "pkgs/hashicorp_repo.yml" - ansible_system == 'Linux'
when: hashicorp is undefined notify:
- Depend hashicorp repo
- name: append to syspkgs changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ pkgconfig.consul[ansible_system] ] }}" pkg_sys: "{{ pkg_sys + consul.pkgs }}"
when: ansible_system == 'Linux'
- ansible.builtin.set_fact: - name: Append to pkg_tap
tappkgs: "{{ tappkgs + [ pkgconfig.consul[ansible_system] ] }}" when:
when: ansible_system == 'Darwin' - ansible_system == 'Darwin'
notify:
- Depend hashicorp repo
changed_when: true
ansible.builtin.set_fact:
pkg_tap: "{{ pkg_tap + consul.pkgs }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + ['vscode-langservers-extracted'] }}" pkg_npm: "{{ pkg_npm + ['vscode-langservers-extracted'] }}"

View File

@@ -1,5 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to gopkgs - name: Append to pkg_go
notify:
- Depend go
changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + [ 'github.com/rs/curlie@latest' ] }}" pkg_go: "{{ pkg_go + ['github.com/rs/curlie@latest'] }}"

View File

@@ -1,15 +1,16 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Append to pkg_flatpak
file: pkgs/flatpak.yml when:
when: flatpkak is undefined - ansible_system == 'Linux'
notify:
- name: append to flatpkgs - Depend flatpak
changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
flatpkgs: "{{ flatpkgs + [ 'io.dbeaver.DBeaverCommunity' ] }}" pkg_flatpak: "{{ pkg_flatpak + ['io.dbeaver.DBeaverCommunity'] }}"
when: ansible_os_family != 'Darwin'
- name: append to caskpkgs - name: Append to pkg_cask
when:
- ansible_system == 'Darwin'
ansible.builtin.set_fact: ansible.builtin.set_fact:
caskpkgs: "{{ caskpkgs + [ 'dbeaver-community' ] }}" pkg_cask: "{{ pkg_cask + ['dbeaver-community'] }}"
when: ansible_os_family == 'Darwin'

3
tasks/pkgs/direnv.yml Normal file
View File

@@ -0,0 +1,3 @@
- name: Append to pkg_sys
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + ['direnv'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + ['dockerfile-language-server-nodejs'] }}" pkg_npm: "{{ pkg_npm + ['dockerfile-language-server-nodejs'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_cargo
file: "pkgs/rust.yml" notify:
when: pkgconfig_rust is undefined - Depend cargo
changed_when: true
- name: add to cargopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
cargopkgs: "{{ cargopkgs + [ 'dotenv-linter' ] }}" pkg_cargo: "{{ pkg_cargo + ['dotenv-linter'] }}"

View File

@@ -1,10 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Append to pkg_go
file: "pkgs/go.yml" notify:
when: - Depend go
- pkgconfig_go is undefined changed_when: true
- name: append to gopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
gopkgs: "{{ gopkgs + [ 'github.com/muesli/duf@latest' ] }}" pkg_go: "{{ pkg_go + ['github.com/muesli/duf@latest'] }}"

View File

@@ -1,19 +1,16 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to syspkgs - name: Linux specific install
when:
- ansible_system == 'Linux'
notify:
- Depend cargo
changed_when: true
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'dust' ] }}" pkg_cargo: "{{ pkg_cargo + ['du-dust'] }}"
- name: Append to pkg_sys
when: when:
- ansible_os_family == 'Darwin' - ansible_os_family == 'Darwin'
- name: linux specific install
block:
- ansible.builtin.include_tasks:
file: "pkgs/rust.yml"
when: pkgconfig_rust is undefined
- name: add to cargopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
cargopkgs: "{{ cargopkgs + [ 'du-dust' ] }}" pkg_sys: "{{ pkg_sys + ['dust'] }}"
when:
- ansible_os_family != 'Darwin'

View File

@@ -1,5 +1,5 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- name: append to pkgs - name: Append to pkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'editorconfig' ] }}" pkg_sys: "{{ pkg_sys + ['editorconfig'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_npm
file: pkgs/nodejs.yml notify:
when: nodejs is undefined - Depend node
changed_when: true
- name: add to npmpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
npmpkgs: "{{ npmpkgs + ['vscode-langservers-extracted'] }}" pkg_npm: "{{ pkg_npm + ['vscode-langservers-extracted'] }}"

View File

@@ -1,9 +1,8 @@
# vim: set filetype=yaml.ansible : # vim: set filetype=yaml.ansible :
--- ---
- ansible.builtin.include_tasks: - name: Add to pkg_cargo
file: "pkgs/rust.yml" notify:
when: pkgconfig_rust is undefined - Depend cargo
changed_when: true
- name: add to cargopkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
cargopkgs: "{{ cargopkgs + [ 'eza' ] }}" pkg_cargo: "{{ pkg_cargo + ['eza'] }}"

Some files were not shown because too many files have changed in this diff Show More