complete more pkgs

- bitwarden is configured to install the cask on macos and the appimage
  on linux
- dbeaver is configured using the flatpak installation
- added handling of flatpaks
This commit is contained in:
Matthew Stobbs
2025-02-07 13:34:50 -07:00
parent 67a9b39abc
commit b2a8e41f3d
7 changed files with 114 additions and 5 deletions

27
tasks/build/bitwarden.yml Normal file
View File

@@ -0,0 +1,27 @@
---
- 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

@@ -22,6 +22,30 @@
become: true become: true
when: when:
- syspkgs|length > 0 - 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' when: ansible_os_family == 'RedHat'
- name: debian based OS - name: debian based OS
@@ -40,6 +64,30 @@
become: true become: true
when: when:
- syspkgs|length > 0 - 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 == 'Debian' when: ansible_os_family == 'Debian'
- name: darwin/macOS based OS - name: darwin/macOS based OS

View File

@@ -1,7 +1,13 @@
--- ---
- name: append to pkgs - ansible.builtin.include_vars:
file: bitwarden.yml
name: _bitwarden
- ansible.builtin.set_fact:
pkgconfig_bitwarden: "{{ _bitwarden | ansible.builtin.combine(pkgconfig.bitwarden) }}"
- name: append to srcpkgs
ansible.builtin.set_fact: ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'bitwarden' ] }}" syspkgs: "{{ srcpkgs + [ 'bitwarden' ] }}"
when: ansible_os_family != 'Darwin' when: ansible_os_family != 'Darwin'
- name: append to caskpkgs - name: append to caskpkgs

View File

@@ -1,5 +1,15 @@
# TODO: implement # TODO: implement
--- ---
- name: append to syspkgs - ansible.builtin.include_tasks:
debug: file: pkgs/flatpak.yml
msg: "NOT IMPLEMENTED YET" when: pkgconfig_flatpkak is undefined
- name: append to flatpkgs
ansible.builtin.set_fact:
flatpkgs: "{{ flatpkgs + [ 'dbeaver' ] }}"
when: ansible_os_family != 'Darwin'
- name: append to caskpkgs
ansible.builtin.set_fact:
caskpkgs: "{{ caskpkgs + [ 'dbeaver-community' ] }}"
when: ansible_os_family == 'Darwin'

6
tasks/pkgs/flatpak.yml Normal file
View File

@@ -0,0 +1,6 @@
---
- name: append to syspkgs
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [ 'flatpak' ] }}"
pkgconfig_flatpak: {defined: true}
when: ansible_os_family != 'Darwin'

7
vars/bitwarden.yml Normal file
View File

@@ -0,0 +1,7 @@
---
install_prefix: "{{ default_config.install_prefix }}"
install_dir: /opt/bitwarden
use_appimage: true
dobecome: true
owner: root
group: root

View File

@@ -14,6 +14,10 @@ brewtaps: []
cargopkgs: [] cargopkgs: []
cargoversioned: [] cargoversioned: []
caskpkgs: [] caskpkgs: []
flatpkgs: []
flatpkg_repo:
- name: flathub
url: https://dl.flathub.org/repo/flathub.flatpakrepo
gopkgs: [] gopkgs: []
npmpkgs: [] npmpkgs: []
packages: [] packages: []
@@ -28,6 +32,7 @@ tappkgs: []
# pkgconfig.<pkgname> as a dict # pkgconfig.<pkgname> as a dict
pkgconfig: pkgconfig:
alacritty: {} alacritty: {}
bitwarden: {}
carapace: {} carapace: {}
clangd: {} clangd: {}
consul: {} consul: {}