Skip to content

Commit 57c7be2

Browse files
author
Derek
committed
fix: Add Bitwarden and change Flatpak apps to system-wide installation
- Add Bitwarden GUI (Flatpak/Homebrew) and CLI (binary/Homebrew) - Change all Flatpak apps to method: system (Slack, Remmina, Freelens) - Remove user-level Flathub repository setup
1 parent 6648edb commit 57c7be2

5 files changed

Lines changed: 84 additions & 25 deletions

File tree

ansible/roles/dfe_developer/tasks/k8s.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,11 @@
152152

153153
# Freelens - Flatpak (GUI only)
154154

155-
- name: Install Freelens
155+
- name: Install Freelens (system-wide)
156156
community.general.flatpak:
157157
name: app.freelens.Freelens
158158
state: present
159-
method: user
160-
become: false
161-
environment:
162-
FLATPAK_TTY_PROGRESS: "0"
159+
method: system
163160
when:
164161
- ansible_distribution in ['Fedora', 'Ubuntu']
165162
- dfe_has_gnome | default(false)

ansible/roles/dfe_developer/tasks/utilities.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@
2323
method: system
2424
when: ansible_distribution in ['Fedora', 'Ubuntu']
2525

26-
# Configure Flathub for user-level installations (for apps like Freelens, Slack)
27-
- name: Add Flathub repository (user-level)
28-
community.general.flatpak_remote:
29-
name: flathub
30-
state: present
31-
flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
32-
method: user
33-
become: false
34-
when:
35-
- ansible_distribution in ['Fedora', 'Ubuntu']
36-
- dfe_has_gnome | default(false)
3726

3827
# Common development utilities
3928
- name: Install development utilities (Fedora)
@@ -176,14 +165,11 @@
176165
# Remmina - Remote Desktop Client (Linux GUI only)
177166
# Using Flatpak for latest version (PPA discontinued as of 2025)
178167
# Flatpak provides better updates and cross-distro compatibility
179-
- name: Install Remmina via Flatpak (user-specific)
168+
- name: Install Remmina via Flatpak (system-wide)
180169
community.general.flatpak:
181170
name: org.remmina.Remmina
182171
state: present
183-
method: user
184-
become: false
185-
environment:
186-
FLATPAK_TTY_PROGRESS: "0"
172+
method: system
187173
when:
188174
- ansible_distribution in ['Fedora', 'Ubuntu']
189175
- dfe_has_gnome | default(false)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
# Bitwarden password manager installation (GUI + CLI)
3+
# GUI: Flatpak for Linux, Homebrew Cask for macOS
4+
# CLI: Binary download for Linux, Homebrew for macOS
5+
6+
# ============================================================================
7+
# LINUX - GUI via Flatpak (system-wide)
8+
# ============================================================================
9+
10+
- name: Install Bitwarden GUI via Flatpak (system-wide)
11+
community.general.flatpak:
12+
name: com.bitwarden.desktop
13+
state: present
14+
method: system
15+
when:
16+
- ansible_distribution in ['Fedora', 'Ubuntu']
17+
- dfe_has_gnome
18+
19+
# ============================================================================
20+
# LINUX - CLI via binary download from GitHub releases
21+
# ============================================================================
22+
23+
- name: Install Bitwarden CLI (Linux)
24+
block:
25+
- name: Get latest Bitwarden CLI version from GitHub API
26+
ansible.builtin.uri:
27+
url: https://api.github.com/repos/bitwarden/clients/releases
28+
return_content: true
29+
register: bw_releases
30+
31+
- name: Set Bitwarden CLI version fact
32+
ansible.builtin.set_fact:
33+
bw_cli_version: "{{ bw_releases.json | selectattr('tag_name', 'match', '^cli-v') | map(attribute='tag_name') | first | regex_replace('^cli-v', '') }}"
34+
35+
- name: Download Bitwarden CLI binary
36+
ansible.builtin.get_url:
37+
url: "https://github.com/bitwarden/clients/releases/download/cli-v{{ bw_cli_version }}/bw-linux-{{ bw_cli_version }}.zip"
38+
dest: /tmp/bw-linux.zip
39+
mode: '0644'
40+
41+
- name: Extract Bitwarden CLI binary
42+
ansible.builtin.unarchive:
43+
src: /tmp/bw-linux.zip
44+
dest: /usr/local/bin
45+
remote_src: true
46+
mode: '0755'
47+
48+
- name: Remove Bitwarden CLI installation file
49+
ansible.builtin.file:
50+
path: /tmp/bw-linux.zip
51+
state: absent
52+
53+
when: ansible_distribution in ['Fedora', 'Ubuntu']
54+
55+
# ============================================================================
56+
# MACOS - GUI via Homebrew Cask, CLI via Homebrew
57+
# ============================================================================
58+
59+
- name: Install Bitwarden GUI (macOS)
60+
community.general.homebrew_cask:
61+
name: bitwarden
62+
state: present
63+
become: false
64+
environment: "{{ homebrew_cask_env }}"
65+
when: ansible_distribution == 'MacOSX'
66+
67+
- name: Install Bitwarden CLI (macOS)
68+
community.general.homebrew:
69+
name: bitwarden-cli
70+
state: present
71+
become: false
72+
environment: "{{ homebrew_env }}"
73+
when: ansible_distribution == 'MacOSX'

ansible/roles/dfe_developer_core/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
tags: ['betterbird', 'email']
4545
when: ansible_distribution in ['Fedora', 'Ubuntu']
4646

47+
- name: Install Bitwarden
48+
ansible.builtin.include_tasks:
49+
file: bitwarden.yml
50+
tags: ['bitwarden', 'security']
51+
4752
- name: Install OpenVPN 3
4853
ansible.builtin.include_tasks:
4954
file: openvpn.yml

ansible/roles/dfe_developer_core/tasks/slack.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33

44
# Linux (Fedora/Ubuntu) - via Flatpak
55

6-
- name: Install Slack via Flatpak (user-specific)
6+
- name: Install Slack via Flatpak (system-wide)
77
community.general.flatpak:
88
name: com.slack.Slack
99
state: present
10-
method: user
11-
become: false
12-
become_user: "{{ dfe_actual_user }}"
10+
method: system
1311
when:
1412
- ansible_distribution in ['Fedora', 'Ubuntu']
1513
- dfe_has_gnome

0 commit comments

Comments
 (0)