From 3f2392332d6e268b1a97646957ed68645c8d6400 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Tue, 18 Aug 2020 00:13:47 +0200 Subject: [PATCH] Added role kiosk/boot --- group_vars/all/vars.yml | 2 ++ roles/kiosk/boot/defaults/main.yml | 7 ++++ roles/kiosk/boot/meta/main.yml | 6 ++++ roles/kiosk/boot/tasks/main.yml | 39 +++++++++++++++++++++ roles/kiosk/boot/templates/default_grub.txt | 30 ++++++++++++++++ roles/kiosk/boot/templates/plymouthd.conf | 2 ++ roles/misc/handlers/handlers/main.yml | 6 ++++ 7 files changed, 92 insertions(+) create mode 100644 roles/kiosk/boot/defaults/main.yml create mode 100644 roles/kiosk/boot/meta/main.yml create mode 100644 roles/kiosk/boot/tasks/main.yml create mode 100644 roles/kiosk/boot/templates/default_grub.txt create mode 100644 roles/kiosk/boot/templates/plymouthd.conf diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index eaa283c..018139b 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -124,6 +124,8 @@ global_nginx_installation_directory: "/etc/nginx" global_pamd: "/etc/pam.d" +global_plymouth_themes_directory: "/usr/share/plymouth/themes" + global_redis_configuration_directory: "/etc/redis" global_redis_service_name: "redis-server.service" diff --git a/roles/kiosk/boot/defaults/main.yml b/roles/kiosk/boot/defaults/main.yml new file mode 100644 index 0000000..3b182bc --- /dev/null +++ b/roles/kiosk/boot/defaults/main.yml @@ -0,0 +1,7 @@ +--- + +# system_name: "Example System" + +plymouth_theme_pack: internal # internal does prevent download +plymouth_theme: spinner +plymouth_theme_url: "https://github.com/adi1090x/files/raw/master/plymouth-themes/themes/{{ plymouth_theme_pack }}/{{ plymouth_theme }}.tar.gz" diff --git a/roles/kiosk/boot/meta/main.yml b/roles/kiosk/boot/meta/main.yml new file mode 100644 index 0000000..35db071 --- /dev/null +++ b/roles/kiosk/boot/meta/main.yml @@ -0,0 +1,6 @@ +--- + +allow_duplicates: no + +dependencies: + - role: misc/handlers diff --git a/roles/kiosk/boot/tasks/main.yml b/roles/kiosk/boot/tasks/main.yml new file mode 100644 index 0000000..1ab38d4 --- /dev/null +++ b/roles/kiosk/boot/tasks/main.yml @@ -0,0 +1,39 @@ +--- + +- name: Install required packages + apt: + state: present + name: + - plymouth # Bootup Splash + - plymouth-themes # Bootup Splash Theme + +- name: Configure GRUB + template: + src: default_grub.txt + dest: /etc/default/grub + owner: root + group: root + mode: u=rw,g=r,o=r + notify: + - update-grub + +- name: Download plymouth theme + unarchive: + src: "{{ plymouth_theme_url }}" + dest: "{{ global_plymouth_themes_directory }}" + remote_src: yes + owner: root + group: root + mode: u=rwX,g=rX,o=rX + creates: "{{ global_plymouth_themes_directory }}/{{ plymouth_theme }}" + when: plymouth_theme_pack != 'internal' + +- name: Configure Plymouth + template: + src: plymouthd.conf + dest: /etc/plymouth/plymouthd.conf + owner: root + group: root + mode: u=rw,g=r,o=r + notify: + - rebuild initrd diff --git a/roles/kiosk/boot/templates/default_grub.txt b/roles/kiosk/boot/templates/default_grub.txt new file mode 100644 index 0000000..c185d72 --- /dev/null +++ b/roles/kiosk/boot/templates/default_grub.txt @@ -0,0 +1,30 @@ +# Configured by Ansible + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=0 +GRUB_TIMEOUT_STYLE="hidden" +GRUB_DISTRIBUTOR="{{ system_name }} (`lsb_release -i -s 2> /dev/null || echo Debian`)" +GRUB_CMDLINE_LINUX_DEFAULT="quiet splash loglevel=0 rd.systemd.show_status=quiet rd.udev.log-priority=3 vt.global_cursor_default=0" +GRUB_CMDLINE_LINUX="" + +# Uncomment to enable BadRAM filtering, modify to suit your needs +# This works with Linux (no patch required) and with any kernel that obtains +# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) +#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal +# note that you can use only modes which your graphic card supports via VBE +# you can see them in real GRUB with the command `vbeinfo' +#GRUB_GFXMODE=640x480 + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +GRUB_DISABLE_RECOVERY="true" + +# Uncomment to get a beep at grub start +#GRUB_INIT_TUNE="480 440 1" diff --git a/roles/kiosk/boot/templates/plymouthd.conf b/roles/kiosk/boot/templates/plymouthd.conf new file mode 100644 index 0000000..4eca16d --- /dev/null +++ b/roles/kiosk/boot/templates/plymouthd.conf @@ -0,0 +1,2 @@ +[Daemon] +Theme={{ plymouth_theme }} diff --git a/roles/misc/handlers/handlers/main.yml b/roles/misc/handlers/handlers/main.yml index cada35e..c64bf72 100644 --- a/roles/misc/handlers/handlers/main.yml +++ b/roles/misc/handlers/handlers/main.yml @@ -1,5 +1,11 @@ --- +- name: update-grub + command: /usr/sbin/update-grub + +- name: rebuild initrd + command: /usr/sbin/update-initramfs -u + - name: reload systemd systemd: daemon_reload: yes