Add udev, grub roles for desktops

Lovin how light they are tho
This commit is contained in:
Salt 2020-11-03 05:30:19 -06:00
parent 5b2591339b
commit 4f96ddf379
8 changed files with 70 additions and 0 deletions

View File

@ -3,6 +3,10 @@ all:
vars:
ansible_user: ansible
children:
desktop:
hosts:
dsk-cstm-0:
ansible_host: 172.23.100.1
db:
hosts:
db1.test.desu.ltd:

View File

@ -0,0 +1,14 @@
# vim:ft=ansible:
# Defaults are for a super-simple pared-down instant GRUB
grub_default: 0
grub_hidden_timeout: 0
grub_hidden_timeout_quiet: "true"
grub_timeout: 0
grub_timeout_style: hidden
grub_recordfail_timeout: 0
grub_distributor: "`lsb_release -i -s 2> /dev/null`"
grub_cmdline_linux_default: "quiet splash"
grub_cmdline_linux: ""
# Workaroundies
grub_disable_os_prober: "true"

View File

@ -0,0 +1,5 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: grub mkconfig
command: "grub-mkconfig -o /boot/grub/grub.cfg"
become: yes

View File

@ -0,0 +1,8 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: configure grub
block:
- name: template out grub config
template: src=grub.conf dest=/etc/default/grub
notify: grub mkconfig

View File

@ -0,0 +1,12 @@
# vim:ft=bash
GRUB_DEFAULT="{{ grub_default }}"
GRUB_HIDDEN_TIMEOUT="{{ grub_hidden_timeout }}"
GRUB_HIDDEN_TIMEOUT_QUIET="{{ grub_hidden_timeout_quiet }}"
GRUB_TIMEOUT="{{ grub_timeout }}"
GRUB_TIMEOUT_STYLE="{{ grub_timeout_style }}"
GRUB_RECORDFAIL_TIMEOUT="{{ grub_recordfail_timeout }}"
GRUB_DISTRIBUTOR="{{ grub_distributor }}"
GRUB_CMDLINE_LINUX_DEFAULT="{{ grub_cmdline_linux_default }}"
GRUB_CMDLINE_LINUX="{{ grub_cmdline_linux }}"
# Work around probing for other OSs resetting timeout
GRUB_DISABLE_OS_PROBER="{{ grub_disable_os_prober }}"

View File

@ -0,0 +1,5 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: reload udev
command: udevadm trigger
become: yes

View File

@ -0,0 +1,9 @@
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: configure udev rules
block:
- name: add custom udev rules
lineinfile: path=/etc/udev/rules.d/50-ansible.rules line={{ item }} create=yes
loop: "{{ udev_rules }}"
notify: reload udev

View File

@ -8,6 +8,19 @@
tags: [ common ]
- role: ansible-pull
tags: [ ansible, common ]
# Home desktops
- hosts: desktop
roles:
- role: grub
become: yes
tags: [ desktop, grub ]
- role: udev
vars:
udev_rules:
# Switch RCM stuff
- SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0664", GROUP="plugdev"
become: yes
tags: [ desktop, udev ]
# Database servers
- hosts: db1.test.desu.ltd
roles: