Skip to content

Commit 0488f2d

Browse files
shanemcdclaude
andcommitted
Add sysexts role for installing system extensions via systemd-sysupdate
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 93ca1c9 commit 0488f2d

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ uvx --from ansible-core ansible-playbook shanemcd.toolbox.<playbook_name>
6262
- `inception` - Meta-playbook for full system setup (runs oh_my_zsh, dotfiles, flatpaks, fonts, emacs; requires `--ask-become-pass` or `-K`)
6363
- `sunshine` - Configure Sunshine game streaming with keybindings and enable systemd user service
6464
- `nfs` - Configure NFS server for media sharing (requires `--ask-become-pass` or `-K`)
65+
- `sysexts` - Install system extensions via systemd-sysupdate (requires `--ask-become-pass` or `-K`)
6566

6667
## Adding New Playbooks and Roles
6768

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: Install system extensions
3+
hosts: localhost
4+
connection: local
5+
gather_facts: false
6+
7+
roles:
8+
- shanemcd.toolbox.sysexts
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
# Base URL for sysext configs
3+
sysexts_base_url: https://extensions.fcos.fr
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
- name: Create extensions directories
3+
ansible.builtin.file:
4+
path: "{{ item }}"
5+
state: directory
6+
owner: root
7+
group: root
8+
mode: "0755"
9+
loop:
10+
- /var/lib/extensions
11+
- /var/lib/extensions.d
12+
become: true
13+
14+
- name: Restore SELinux context on extensions directories
15+
ansible.builtin.command:
16+
cmd: restorecon -RFv /var/lib/extensions /var/lib/extensions.d
17+
become: true
18+
changed_when: false
19+
20+
- name: Create sysupdate config directories
21+
ansible.builtin.file:
22+
path: "/etc/sysupdate.{{ item.name }}.d"
23+
state: directory
24+
owner: root
25+
group: root
26+
mode: "0755"
27+
loop: "{{ sysexts }}"
28+
become: true
29+
30+
- name: Restore SELinux context on sysupdate directories
31+
ansible.builtin.command:
32+
cmd: "restorecon -RFv /etc/sysupdate.{{ item.name }}.d"
33+
loop: "{{ sysexts }}"
34+
become: true
35+
changed_when: false
36+
37+
- name: Download sysupdate configs
38+
ansible.builtin.get_url:
39+
url: "{{ sysexts_base_url }}/{{ item.repo }}/{{ item.name }}.conf"
40+
dest: "/etc/sysupdate.{{ item.name }}.d/{{ item.name }}.conf"
41+
owner: root
42+
group: root
43+
mode: "0644"
44+
loop: "{{ sysexts }}"
45+
become: true
46+
47+
- name: Update system extensions
48+
ansible.builtin.command:
49+
cmd: "/usr/lib/systemd/systemd-sysupdate update --component {{ item.name }}"
50+
loop: "{{ sysexts }}"
51+
become: true
52+
register: sysupdate_result
53+
changed_when: "'No update available' not in sysupdate_result.stderr"
54+
55+
- name: Enable and start systemd-sysext service
56+
ansible.builtin.systemd:
57+
name: systemd-sysext.service
58+
enabled: true
59+
state: started
60+
become: true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# List of system extensions to install
3+
# These are downloaded from extensions.fcos.fr via systemd-sysupdate
4+
# repo: "fedora" or "community"
5+
sysexts:
6+
- name: 1password-gui
7+
repo: community
8+
- name: docker-ce
9+
repo: community
10+
- name: emacs
11+
repo: fedora
12+
- name: gh
13+
repo: fedora
14+
- name: htop
15+
repo: fedora
16+
- name: libvirtd-desktop
17+
repo: fedora
18+
- name: tailscale
19+
repo: community
20+
21+
# Not yet available from extensions.fcos.fr (install manually):
22+
# - cursor (pending PR: https://github.com/fedora-sysexts/community/pull/25)

0 commit comments

Comments
 (0)