Add udev, grub roles for desktops
Lovin how light they are tho
This commit is contained in:
parent
5b2591339b
commit
4f96ddf379
@ -3,6 +3,10 @@ all:
|
|||||||
vars:
|
vars:
|
||||||
ansible_user: ansible
|
ansible_user: ansible
|
||||||
children:
|
children:
|
||||||
|
desktop:
|
||||||
|
hosts:
|
||||||
|
dsk-cstm-0:
|
||||||
|
ansible_host: 172.23.100.1
|
||||||
db:
|
db:
|
||||||
hosts:
|
hosts:
|
||||||
db1.test.desu.ltd:
|
db1.test.desu.ltd:
|
||||||
|
14
roles/grub/defaults/main.yml
Normal file
14
roles/grub/defaults/main.yml
Normal 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"
|
5
roles/grub/handlers/main.yml
Normal file
5
roles/grub/handlers/main.yml
Normal 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
|
8
roles/grub/tasks/main.yml
Normal file
8
roles/grub/tasks/main.yml
Normal 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
|
12
roles/grub/templates/grub.conf
Normal file
12
roles/grub/templates/grub.conf
Normal 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 }}"
|
5
roles/udev/handlers/main.yml
Normal file
5
roles/udev/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env ansible-playbook
|
||||||
|
# vim:ft=ansible:
|
||||||
|
- name: reload udev
|
||||||
|
command: udevadm trigger
|
||||||
|
become: yes
|
9
roles/udev/tasks/main.yml
Normal file
9
roles/udev/tasks/main.yml
Normal 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
|
13
site.yml
13
site.yml
@ -8,6 +8,19 @@
|
|||||||
tags: [ common ]
|
tags: [ common ]
|
||||||
- role: ansible-pull
|
- role: ansible-pull
|
||||||
tags: [ ansible, common ]
|
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
|
# Database servers
|
||||||
- hosts: db1.test.desu.ltd
|
- hosts: db1.test.desu.ltd
|
||||||
roles:
|
roles:
|
||||||
|
Loading…
Reference in New Issue
Block a user