Merge branch 'launch'
This commit is contained in:
commit
deb977de09
@ -50,6 +50,8 @@
|
|||||||
- docker
|
- docker
|
||||||
- vscode
|
- vscode
|
||||||
- javascript
|
- javascript
|
||||||
|
- launch_keyboard
|
||||||
|
- lvfs
|
||||||
|
|
||||||
- hosts: nat_dhcp:homeserver_nat_dhcp:mrmanager_nat_dhcp
|
- hosts: nat_dhcp:homeserver_nat_dhcp:mrmanager_nat_dhcp
|
||||||
vars:
|
vars:
|
||||||
|
15
ansible/roles/launch_keyboard/tasks/common.yaml
Normal file
15
ansible/roles/launch_keyboard/tasks/common.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
- import_tasks: tasks/freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
||||||
|
|
||||||
|
- include_tasks:
|
||||||
|
file: tasks/peruser.yaml
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ initialize_user }}"
|
||||||
|
when: users is defined
|
||||||
|
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: initialize_user
|
5
ansible/roles/launch_keyboard/tasks/freebsd.yaml
Normal file
5
ansible/roles/launch_keyboard/tasks/freebsd.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# - name: Install packages
|
||||||
|
# package:
|
||||||
|
# name:
|
||||||
|
# - foo
|
||||||
|
# state: present
|
24
ansible/roles/launch_keyboard/tasks/linux.yaml
Normal file
24
ansible/roles/launch_keyboard/tasks/linux.yaml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
- name: Build aur packages
|
||||||
|
register: buildaur
|
||||||
|
become_user: "{{ build_user.name }}"
|
||||||
|
command: "aurutils-sync --no-view {{ item }}"
|
||||||
|
args:
|
||||||
|
creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
|
||||||
|
loop:
|
||||||
|
- system76-keyboard-configurator
|
||||||
|
|
||||||
|
- name: Update cache
|
||||||
|
when: buildaur.changed
|
||||||
|
pacman:
|
||||||
|
name: []
|
||||||
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- dfu-programmer # For flashing keyboard https://support.system76.com/articles/launch_2-firmware-update/
|
||||||
|
- avrdude # For flashing keyboard https://support.system76.com/articles/launch_2-firmware-update/
|
||||||
|
- lxqt-policykit # Need a polkit agent to launch the keyboard configurator
|
||||||
|
- system76-keyboard-configurator
|
||||||
|
state: present
|
2
ansible/roles/launch_keyboard/tasks/main.yaml
Normal file
2
ansible/roles/launch_keyboard/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
when: install_graphics
|
29
ansible/roles/launch_keyboard/tasks/peruser.yaml
Normal file
29
ansible/roles/launch_keyboard/tasks/peruser.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
- include_role:
|
||||||
|
name: per_user
|
||||||
|
|
||||||
|
# - name: Create directories
|
||||||
|
# file:
|
||||||
|
# name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||||
|
# state: directory
|
||||||
|
# mode: 0700
|
||||||
|
# owner: "{{ account_name.stdout }}"
|
||||||
|
# group: "{{ group_name.stdout }}"
|
||||||
|
# loop:
|
||||||
|
# - ".config/foo"
|
||||||
|
|
||||||
|
# - name: Copy files
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||||
|
# mode: 0600
|
||||||
|
# owner: "{{ account_name.stdout }}"
|
||||||
|
# group: "{{ group_name.stdout }}"
|
||||||
|
# loop:
|
||||||
|
# - src: foo.conf
|
||||||
|
# dest: .config/foo/foo.conf
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
5
ansible/roles/lvfs/tasks/common.yaml
Normal file
5
ansible/roles/lvfs/tasks/common.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
- import_tasks: tasks/freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
5
ansible/roles/lvfs/tasks/freebsd.yaml
Normal file
5
ansible/roles/lvfs/tasks/freebsd.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# - name: Install packages
|
||||||
|
# package:
|
||||||
|
# name:
|
||||||
|
# - foo
|
||||||
|
# state: present
|
14
ansible/roles/lvfs/tasks/linux.yaml
Normal file
14
ansible/roles/lvfs/tasks/linux.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- fwupd
|
||||||
|
- gnome-firmware
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Enable services
|
||||||
|
systemd:
|
||||||
|
enabled: yes
|
||||||
|
name: "{{ item }}"
|
||||||
|
daemon_reload: yes
|
||||||
|
loop:
|
||||||
|
- fwupd.service
|
2
ansible/roles/lvfs/tasks/main.yaml
Normal file
2
ansible/roles/lvfs/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
# when: foo is defined
|
@ -1,2 +1,9 @@
|
|||||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1832", TEST=="power/autosuspend" ATTR{power/autosuspend}="-1"
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="1038", ATTR{idProduct}=="1832", TEST=="power/autosuspend" ATTR{power/autosuspend}="-1"
|
||||||
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="308f", ATTR{idProduct}=="0011", TEST=="power/autosuspend" ATTR{power/autosuspend}="-1"
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="308f", ATTR{idProduct}=="0011", TEST=="power/autosuspend" ATTR{power/autosuspend}="-1"
|
||||||
|
|
||||||
|
# Launch keyboard
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="3384", ATTR{idProduct}=="0006", TEST=="power/autosuspend" ATTR{power/autosuspend}="-1"
|
||||||
|
|
||||||
|
# DFU Programmer on launch keyboard
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ff9", TEST=="power/autosuspend" ATTR{power/autosuspend}="-1"
|
||||||
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="2ff9", TAG+="uaccess"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user