Add a devfs role for FreeBSD.

This commit is contained in:
Tom Alexander 2022-10-27 00:31:58 -04:00
parent 6e4fffbe9d
commit 039b79c166
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
10 changed files with 71 additions and 0 deletions

View File

@ -32,3 +32,5 @@ users:
- 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
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"'