1
0
Fork 0

setup playbook to install xone driver

This commit is contained in:
Massaki Archambault 2024-03-02 22:01:44 -05:00
parent 571f82bad3
commit b3c1e7a08f
4 changed files with 60 additions and 0 deletions

5
ansible.cfg Normal file
View File

@ -0,0 +1,5 @@
[defaults]
ask_pass = true
[privilege_escalation]
become_ask_pass = true

2
hosts Normal file
View File

@ -0,0 +1,2 @@
[steamdeck]
steamdeck.local ansible_user=deck ansible_become_method=sudo

View File

@ -0,0 +1,50 @@
- name: Disable read-only filesystem
become: true
command: steamos-readonly disable
- name: Check if pacman keyring exists
stat:
path: /etc/pacman.d/gnupg/secring.gpg
register: keyring_dir
- name: Initialize pacman keyring
become: true
shell: pacman-key --init && pacman-key --populate
when: not keyring_dir.stat.exists
# start setup sudoer
- name: Allow passwordless sudo for the duration of the playbook
become: true
lineinfile:
path: /etc/sudoers.d/zzz-passwordless-wheel
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
create: yes
mode: 0644
validate: '/usr/sbin/visudo -cf %s'
# end setup sudoer
# start install xone
- name: Install required packages for building kernel module
become: true
pacman:
update_cache: true
name:
- base-devel
- https://steamdeck-packages.steamos.cloud/archlinux-mirror/jupiter-main/os/x86_64/linux-{{ ansible_kernel | regex_search('neptune-[0-9]+$') }}-headers-{{ ansible_kernel | regex_search('^[0-9]+\.[0-9]+\.[0-9]+') }}.{{ ansible_kernel | regex_search('valve[0-9]+-[0-9]+') }}-x86_64.pkg.tar.zst # linux-headers
- name: Install xone-dkms-git xbox one accessories driver
aur:
name: xone-dkms-git
# end install xone
# start cleanup sudoer
- name: Disable passwordless sudo
become: true
file:
path: /etc/sudoers.d/zzz-passwordless-wheel
state: absent
# end cleanup sudoer
- name: Enable read-only filesystem
become: true
command: steamos-readonly enable

3
site.yaml Normal file
View File

@ -0,0 +1,3 @@
- hosts: steamdeck
roles:
- steamdeck