Merge branch 'devfs'

This commit is contained in:
Tom Alexander 2022-10-27 01:35:34 -04:00
commit eb2ebb6cd6
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
14 changed files with 95 additions and 8 deletions

View File

@ -26,9 +26,12 @@ users:
groups:
- name: wheel
- name: video
- name: u2f
authorized_keys:
- yubikey
- main_fido
- backup_fido
- homeassistant
gitconfig: "gitconfig_home"
# devfs_rules: "odo_devfs.rules"
# devfs_system_ruleset: "localrules"

View File

@ -21,3 +21,4 @@
- sway
- emacs
- firefox
- devfs

View File

@ -0,0 +1,3 @@
[localrules=10]
add path 'input/*' mode 0660 group video
add path 'usb/*' mode 0660 group usb

View File

@ -0,0 +1,14 @@
- 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 }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

@ -0,0 +1,14 @@
- name: Install /etc/devfs.rules
copy:
src: "files/{{ devfs_rules }}"
dest: /etc/devfs.rules
mode: 0644
owner: root
group: wheel
- name: Set devfs_system_ruleset
when: devfs_system_ruleset is defined
community.general.sysrc:
name: "devfs_system_ruleset"
value: "{{ devfs_system_ruleset }}"
path: /etc/rc.conf.d/devfs

View File

@ -0,0 +1,6 @@
# - name: Install packages
# pacman:
# name:
# - foo
# state: present
# update_cache: true

View File

@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
when: devfs_rules is defined

View 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"'

View File

@ -1,6 +0,0 @@
enable-ssh-support
write-env-file
use-standard-socket
default-cache-ttl 600
max-cache-ttl 7200
display :0

View File

@ -1,2 +1,3 @@
dependencies:
- users
- devfs # For access to usb devices like yubikeys

View File

@ -19,11 +19,20 @@
loop:
- src: gpg.conf
dest: .gnupg/gpg.conf
- src: gpg-agent.conf
dest: .gnupg/gpg-agent.conf
- src: scdaemon.conf
dest: .gnupg/scdaemon.conf
- name: Copy templates
template:
src: "templates/{{ item.src }}.j2"
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
mode: 0600
owner: "{{ account_name.stdout }}"
group: "{{ group_name.stdout }}"
loop:
- src: gpg-agent.conf
dest: .gnupg/gpg-agent.conf
- name: Check trusted gpg keys
command: gpg --list-public-keys --keyid-format LONG
register: gpgkeys

View File

@ -0,0 +1,11 @@
enable-ssh-support
write-env-file
use-standard-socket
default-cache-ttl 600
max-cache-ttl 7200
display :0
{% if os_flavor == "linux" %}
pinentry-program /usr/bin/pinentry-qt5
{% elif os_flavor == "freebsd" %}
pinentry-program /usr/local/bin/pinentry-qt5
{% endif %}