Add a devfs role for FreeBSD.
This commit is contained in:
parent
6e4fffbe9d
commit
039b79c166
@ -32,3 +32,5 @@ users:
|
||||
- backup_fido
|
||||
- homeassistant
|
||||
gitconfig: "gitconfig_home"
|
||||
devfs_rules: "odo_devfs.rules"
|
||||
devfs_system_ruleset: "localrules"
|
||||
|
@ -21,3 +21,4 @@
|
||||
- sway
|
||||
- emacs
|
||||
- firefox
|
||||
- devfs
|
||||
|
3
ansible/roles/devfs/files/odo_devfs.rules
Normal file
3
ansible/roles/devfs/files/odo_devfs.rules
Normal file
@ -0,0 +1,3 @@
|
||||
[localrules=10]
|
||||
add path 'input/*' mode 0660 group video
|
||||
add path 'usb/*' mode 0660 group usb
|
14
ansible/roles/devfs/tasks/common.yaml
Normal file
14
ansible/roles/devfs/tasks/common.yaml
Normal 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
|
14
ansible/roles/devfs/tasks/freebsd.yaml
Normal file
14
ansible/roles/devfs/tasks/freebsd.yaml
Normal 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
|
6
ansible/roles/devfs/tasks/linux.yaml
Normal file
6
ansible/roles/devfs/tasks/linux.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
# - name: Install packages
|
||||
# pacman:
|
||||
# name:
|
||||
# - foo
|
||||
# state: present
|
||||
# update_cache: true
|
2
ansible/roles/devfs/tasks/main.yaml
Normal file
2
ansible/roles/devfs/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
- import_tasks: tasks/common.yaml
|
||||
when: devfs_rules is defined
|
29
ansible/roles/devfs/tasks/peruser.yaml
Normal file
29
ansible/roles/devfs/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"'
|
0
ansible/roles/devfs/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/devfs/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/devfs/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/devfs/tasks/peruser_linux.yaml
Normal file
Loading…
Reference in New Issue
Block a user