diff --git a/README.md b/README.md index 4155fa2..0ef12ee 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,13 @@ Looking for the [video recorder's guide](guide.html)? For the recording machines, get a fresh copy of Debian, and install it with the following settings: +- Keyboard: American - Username: opentech - Hostname: model-increment - Example: x220-01 - Add GNOME Desktop - Add OpenSSH Server +- Leave Print & System Utilities enabled If a GNOME Desktop and SSH daemon is already installed, a reinstall is not required but recommended. @@ -94,11 +96,12 @@ ansible -Kf 8 -kc paramiko -b -i event all -a reboot Now, plays can be run like so: ``` -./play [inventory] [playbook] -# Which executes the following command ansible-playbook -Kf 4 -i [inventory] [playbook] # Example: -./play event recorders.yml +ansible-playbook -Kf 4 -i event recorders.yml +ansible-playbook -Kf 4 -i event recorders-stop.yml +ansible-playbook -Kf 4 -i event reboot.yml +ansible-playbook -Kf 4 -i event upgrade.yml ``` ## Install Wireless Drivers diff --git a/ansible/artwork/login-logo.png b/ansible/artwork/login-logo.png new file mode 100644 index 0000000..4369096 Binary files /dev/null and b/ansible/artwork/login-logo.png differ diff --git a/ansible/artwork/wallpaper.png b/ansible/artwork/wallpaper.png new file mode 100644 index 0000000..0c61d2d Binary files /dev/null and b/ansible/artwork/wallpaper.png differ diff --git a/ansible/event b/ansible/event index 1a97206..836498d 100644 --- a/ansible/event +++ b/ansible/event @@ -1,3 +1,6 @@ [recorders] x220-01 ansible_host=fd11:f055:a514::2 ansible_user=opentech room_id= room_type= x230-01 ansible_host=fd11:f055:a514::3 ansible_user=opentech room_id=EH2-1 room_type=EH2 +x240-01 ansible_host=fd11:f055:a514::4 ansible_user=opentech room_id= room_type= +x240-02 ansible_host=fd11:f055:a514::5 ansible_user=opentech room_id= room_type= +x240-03 ansible_host=fd11:f055:a514::6 ansible_user=opentech room_id= room_type= diff --git a/ansible/play b/ansible/play deleted file mode 100755 index 87bf06a..0000000 --- a/ansible/play +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -e - -ansible-playbook -Kf 4 -i "$1" "$2" diff --git a/ansible/productivity.yml b/ansible/productivity.yml deleted file mode 100644 index 1041870..0000000 --- a/ansible/productivity.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- hosts: recorders - roles: - - productivity diff --git a/ansible/reboot.yml b/ansible/reboot.yml new file mode 100644 index 0000000..8e5dd9b --- /dev/null +++ b/ansible/reboot.yml @@ -0,0 +1,7 @@ +--- +- hosts: all + tasks: + - name: reboot machines + become: yes + reboot: + diff --git a/ansible/recorders-stop.yml b/ansible/recorders-stop.yml index fe47034..36ff0f5 100644 --- a/ansible/recorders-stop.yml +++ b/ansible/recorders-stop.yml @@ -1,6 +1,7 @@ --- - hosts: recorders roles: + - role: laptop - role: recorder - role: monitoring-client vars: diff --git a/ansible/recorders.yml b/ansible/recorders.yml index ba66367..9e6e738 100644 --- a/ansible/recorders.yml +++ b/ansible/recorders.yml @@ -1,5 +1,10 @@ --- - hosts: recorders roles: + - productivity + +- hosts: recorders + roles: + - role: laptop - role: recorder - role: monitoring-client diff --git a/ansible/roles/laptop/tasks/main.yml b/ansible/roles/laptop/tasks/main.yml new file mode 100644 index 0000000..119cd51 --- /dev/null +++ b/ansible/roles/laptop/tasks/main.yml @@ -0,0 +1,28 @@ +--- + +- name: copy gdm3 greeter logo + become: yes + copy: + src: "../../../artwork/{{ item }}.png" + dest: "/opt/{{ item }}.png" + with_items: + - login-logo + +- name: write gdm3 greeter config + become: yes + template: + src: greeter.dconf-defaults + dest: /etc/gdm3/greeter.dconf-defaults + owner: root + group: root + mode: u=rw,g=r,o=r + +- name: reconfigure gdm3 + become: yes + command: dpkg-reconfigure gdm3 + +- name: install firmware-iwlwifi + become: yes + apt: + state: present + name: firmware-iwlwifi diff --git a/ansible/roles/laptop/templates/greeter.dconf-defaults b/ansible/roles/laptop/templates/greeter.dconf-defaults new file mode 100644 index 0000000..fd9f5d1 --- /dev/null +++ b/ansible/roles/laptop/templates/greeter.dconf-defaults @@ -0,0 +1,47 @@ +# These are the options for the greeter session that can be set +# through GSettings. Any GSettings setting that is used by the +# greeter session can be set here. + +# Note that you must configure the path used by dconf to store the +# configuration, not the GSettings path. + + +# Theming options +# =============== +# - Change the GTK+ theme +[org/gnome/desktop/interface] +# gtk-theme='Adwaita' +# - Use another background +[org/gnome/desktop/background] +# picture-uri='file:///opt/login-background.png' +# picture-options='zoom' +# - Or no background at all +[org/gnome/desktop/background] +# picture-options='none' +# primary-color='#000000' + +# Login manager options +# ===================== +[org/gnome/login-screen] +logo='/opt/login-logo.png' + +# - Disable user list +# disable-user-list=true +# - Disable restart buttons +# disable-restart-buttons=true +# - Show a login welcome message +banner-message-enable=true +banner-message-text='Hostname: {{ ansible_hostname }}\nUsername: opentech Password: opentech\nUsername: mixer Password: mixer\n{% if autostart %}Mixer Autostart Enabled{% endif %}' + +# Automatic suspend +# ================= +[org/gnome/settings-daemon/plugins/power] +# - Time inactive in seconds before suspending with AC power +# 1200=20 minutes, 0=never +# sleep-inactive-ac-timeout=1200 +# - What to do after sleep-inactive-ac-timeout +# 'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing' +# sleep-inactive-ac-type='suspend' +# - As above but when on battery +# sleep-inactive-battery-timeout=1200 +# sleep-inactive-battery-type='suspend' diff --git a/ansible/roles/recorder/handlers/main.yml b/ansible/roles/recorder/handlers/main.yml deleted file mode 100644 index 84ef0f6..0000000 --- a/ansible/roles/recorder/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- name: restart systemd-logind - become: yes - service: - name: systemd-logind - state: restarted diff --git a/ansible/roles/recorder/tasks/obs.yml b/ansible/roles/recorder/tasks/obs.yml index b976103..00ffe5a 100644 --- a/ansible/roles/recorder/tasks/obs.yml +++ b/ansible/roles/recorder/tasks/obs.yml @@ -41,3 +41,27 @@ mode: u=rw,g=r,o=r become: yes become_user: mixer + +- name: ensure autostart folder exists + file: + path: "{{ mixer_user.home }}/.config/autostart" + state: directory + become: yes + become_user: mixer + +- name: automatically start OBS on login + file: + path: "{{ mixer_user.home }}/.config/autostart/obs-autostart.desktop" + src: /usr/share/applications/obs.desktop + state: link + become: yes + become_user: mixer + when: autostart + +- name: do not automatically start OBS on login + file: + path: "{{ mixer_user.home }}/.config/autostart/obs-autostart.desktop" + state: absent + become: yes + become_user: mixer + when: not autostart diff --git a/ansible/roles/recorder/tasks/user.yml b/ansible/roles/recorder/tasks/user.yml index ded8c2e..bdedbdc 100644 --- a/ansible/roles/recorder/tasks/user.yml +++ b/ansible/roles/recorder/tasks/user.yml @@ -24,6 +24,22 @@ group: root mode: u=rw,g=r,o=r +- name: create Pictures directory for wallpaper + file: + dest: "{{ mixer_user.home }}/Pictures" + state: directory + mode: u=rwx,g=rx,o=rx + become: yes + become_user: mixer + +- name: copy wallpaper + copy: + src: "../../../artwork/wallpaper.png" + dest: "{{ mixer_user.home }}/Pictures/wallpaper.png" + mode: u=rw,g=r,o=r + become: yes + become_user: mixer + - name: check sleep settings command: cmd: /usr/bin/gsettings get org.gnome.desktop.session idle-delay @@ -48,13 +64,25 @@ - /usr/bin/gsettings set org.gnome.desktop.lockdown disable-printing true - /usr/bin/gsettings set org.gnome.desktop.lockdown disable-print-setup true - /usr/bin/gsettings set org.gnome.desktop.lockdown disable-save-to-disk true - - /usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark' - - /usr/bin/gsettings set org.gnome.shell favorite-apps "['obs.desktop', 'org.gnome.Nautilus.desktop', 'firefox.desktop']" - /usr/bin/gsettings set org.gnome.desktop.session idle-delay 0 become: yes become_user: mixer #when: "'uint32 0' not in idle_delay_setting.stdout" +- name: customize GNOME + command: + cmd: "{{ item }}" + environment: + # Required only when setting gsettings + DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ mixer_user.uid }}/bus" + with_items: + - /usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark' + - /usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://{{ mixer_user.home }}/Pictures/wallpaper.png' + - /usr/bin/gsettings set org.gnome.shell favorite-apps "['obs.desktop', 'org.gnome.Nautilus.desktop', 'firefox-esr.desktop']" + become: yes + become_user: mixer + #when: "'uint32 0' not in idle_delay_setting.stdout" + # Credits: SuperQ, gerryd - name: prevent laptop from sleeping when lid is closed @@ -64,7 +92,6 @@ regexp: "^HandleLidSwitch" line: "HandleLidSwitch=ignore" state: present - notify: restart systemd-logind when: autostart - name: allow laptop to sleep when lid is closed @@ -74,5 +101,4 @@ regexp: "^HandleLidSwitch" line: "HandleLidSwitch=ignore" state: absent - notify: restart systemd-logind when: not autostart diff --git a/ansible/roles/recorder/templates/gdm.conf b/ansible/roles/recorder/templates/gdm.conf index 0199deb..cfd9020 100644 --- a/ansible/roles/recorder/templates/gdm.conf +++ b/ansible/roles/recorder/templates/gdm.conf @@ -1,5 +1,3 @@ -# MANAGED BY ANSIBLE - # GDM configuration storage # # See /usr/share/gdm/gdm.schemas for a list of available options. @@ -8,10 +6,13 @@ # Uncomment the line below to force the login screen to use Xorg #WaylandEnable=false -{% if autostart %} # Enabling automatic login +{% if autostart %} AutomaticLoginEnable = true AutomaticLogin = mixer +{% else %} +# AutomaticLoginEnable = true +# AutomaticLogin = mixer {% endif %} # Enabling timed login diff --git a/ansible/roles/recorder/templates/obs-studio/basic/scenes/event_id.json.j2 b/ansible/roles/recorder/templates/obs-studio/basic/scenes/event_id.json.j2 index 95e6712..accb357 100644 --- a/ansible/roles/recorder/templates/obs-studio/basic/scenes/event_id.json.j2 +++ b/ansible/roles/recorder/templates/obs-studio/basic/scenes/event_id.json.j2 @@ -447,7 +447,8 @@ "push-to-talk": false, "push-to-talk-delay": 0, "settings": { - "key_color_type": "green", + "key_color": "4294639610", + "key_color_type": "custom", "similarity": 1, "smoothness": 1 }, @@ -610,7 +611,8 @@ "push-to-talk": false, "push-to-talk-delay": 0, "settings": { - "key_color_type": "green", + "key_color": "4294639610", + "key_color_type": "custom", "similarity": 1, "smoothness": 1 }, @@ -920,7 +922,8 @@ "push-to-talk": false, "push-to-talk-delay": 0, "settings": { - "key_color_type": "green", + "key_color": "4294639610", + "key_color_type": "custom", "similarity": 1, "smoothness": 1 }, @@ -1116,7 +1119,8 @@ "push-to-talk": false, "push-to-talk-delay": 0, "settings": { - "key_color_type": "green", + "key_color": "4294639610", + "key_color_type": "custom", "similarity": 1, "smoothness": 1 }, diff --git a/ansible/upgrade.yml b/ansible/upgrade.yml new file mode 100644 index 0000000..7a60992 --- /dev/null +++ b/ansible/upgrade.yml @@ -0,0 +1,10 @@ +--- +- hosts: all + tasks: + - name: upgrade packages + become: yes + apt: + autoclean: yes + autoremove: yes + update_cache: yes + upgrade: yes