aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jumbotron/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/jumbotron/tasks')
-rw-r--r--roles/jumbotron/tasks/autologin.yml32
-rw-r--r--roles/jumbotron/tasks/console.yml35
-rw-r--r--roles/jumbotron/tasks/irssi.yml35
-rw-r--r--roles/jumbotron/tasks/jumbotron.yml37
-rw-r--r--roles/jumbotron/tasks/main.yml42
5 files changed, 181 insertions, 0 deletions
diff --git a/roles/jumbotron/tasks/autologin.yml b/roles/jumbotron/tasks/autologin.yml
new file mode 100644
index 0000000..f9052ba
--- /dev/null
+++ b/roles/jumbotron/tasks/autologin.yml
@@ -0,0 +1,32 @@
+---
+- name: Make sure getty@tty1.service.d exists
+ file:
+ path: '/etc/systemd/system/getty@tty1.service.d'
+ state: directory
+ owner: root
+ group: root
+ mode: 0755
+
+- name: Register existing getty@tty1 config
+ find:
+ paths: '/etc/systemd/system/getty@tty1.service.d/'
+ register: getty_tty1_existing
+
+- name: Autologin jumbotron on tty1
+ copy:
+ dest: '/etc/systemd/system/getty@tty1.service.d/'
+ src: '{{ item }}'
+ owner: root
+ group: root
+ mode: 0644
+ with_fileglob: 'getty@tty1.service.d/*'
+ register: getty_tty1_created
+
+- name: Delete unneeded tty1 configuration
+ file:
+ path: '{{ item }}'
+ state: absent
+ with_items: "{{ getty_tty1_existing.files|map(attribute='path')|list }}"
+ when: "item not in getty_tty1_created.results|map(attribute='dest')"
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/jumbotron/tasks/console.yml b/roles/jumbotron/tasks/console.yml
new file mode 100644
index 0000000..55ede76
--- /dev/null
+++ b/roles/jumbotron/tasks/console.yml
@@ -0,0 +1,35 @@
+---
+- name: Configure VGA output
+ lineinfile:
+ path: '/boot/config.txt'
+ regexp: "^{{ item.rsplit('=', 1)[0] }}="
+ line: '{{ item }}'
+ with_items:
+ - 'dtoverlay=vga666'
+ - 'enable_dpi_lcd=1'
+ - 'display_default_lcd=1'
+ - 'dpi_group=2'
+ - 'dpi_mode=35'
+ - 'dtparam=spi=off'
+ - 'dtparam=i2c_arm=off'
+
+- name: Configure console font
+ lineinfile:
+ path: '/etc/default/console-setup'
+ regexp: "^{{ item.split('=', 1)[0] }}="
+ line: '{{ item }}'
+ with_items:
+ - 'CHARMAP="UTF-8"'
+ - 'CODESET="Lat15"'
+ - 'FONTFACE="Terminus"'
+ - 'FONTSIZE="32x16"'
+
+- name: Configure console keyboard
+ lineinfile:
+ path: '/etc/default/keyboard'
+ regexp: "^{{ item.split('=', 1)[0] }}="
+ line: '{{ item }}'
+ with_items:
+ - 'XKBLAYOUT="dk"'
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/jumbotron/tasks/irssi.yml b/roles/jumbotron/tasks/irssi.yml
new file mode 100644
index 0000000..d3dd003
--- /dev/null
+++ b/roles/jumbotron/tasks/irssi.yml
@@ -0,0 +1,35 @@
+---
+- name: Install irssi
+ apt:
+ name: irssi
+ state: present
+ tags:
+ - packages
+
+- name: Make sure ~jumbotron/.irssi exists
+ file:
+ path: '~jumbotron/{{ item }}'
+ state: directory
+ owner: jumbotron
+ group: users
+ mode: 0755
+ with_items:
+ - .irssi
+ - .irssi/scripts
+ - .irssi/scripts/autorun
+
+- name: Configure irssi
+ copy:
+ dest: '~jumbotron/.irssi/config'
+ src: 'irssi.config'
+ owner: jumbotron
+ group: users
+ mode: 0644
+
+- name: Add bot-script
+ file:
+ path: '~jumbotron/.irssi/scripts/autorun/jumbowatch.pl'
+ src: '../../../jumbotron/jumbowatch.pl'
+ state: link
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/jumbotron/tasks/jumbotron.yml b/roles/jumbotron/tasks/jumbotron.yml
new file mode 100644
index 0000000..0b6f1a7
--- /dev/null
+++ b/roles/jumbotron/tasks/jumbotron.yml
@@ -0,0 +1,37 @@
+---
+- name: Create jumbotron user
+ user:
+ comment: 'John Jumbotron'
+ name: jumbotron
+ shell: '/bin/bash'
+ uid: 3000
+ group: users
+
+- name: Create jumbotron dotfiles
+ copy:
+ dest: '~jumbotron/.{{ item.name }}'
+ src: '{{ item.name }}'
+ owner: jumbotron
+ group: users
+ mode: '{{ item.mode }}'
+ with_items:
+ - { name: bash_profile, mode: 0o644 }
+ - { name: autologin, mode: 0o755 }
+
+- name: Check out jumbotron repo
+ git:
+ dest: '~jumbotron/jumbotron'
+ repo: 'https://github.com/labitat/jumbotron.git'
+ accept_hostkey: yes
+ clone: yes
+ update: yes
+ remote: origin
+
+- name: Make sure jumbotron owns git repo
+ file:
+ dest: '~jumbotron/jumbotron'
+ owner: jumbotron
+ group: users
+ recurse: yes
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/jumbotron/tasks/main.yml b/roles/jumbotron/tasks/main.yml
new file mode 100644
index 0000000..e7c45a8
--- /dev/null
+++ b/roles/jumbotron/tasks/main.yml
@@ -0,0 +1,42 @@
+---
+- name: Install network configuration
+ copy:
+ dest: '/etc/systemd/network/10-eth0.network'
+ src: eth0.network
+ owner: root
+ group: root
+ mode: 0644
+ tags:
+ - networkd-config
+
+- name: Disable unused services
+ systemd:
+ name: '{{ item }}'
+ enabled: no
+ with_items:
+ - hciuart.service
+ - remote-fs.target
+ - rsync.service
+ - bluetooth.service
+ tags:
+ - systemd
+
+- name: Remove broken service links
+ file:
+ path: '{{ item }}'
+ state: absent
+ with_items:
+ - /etc/systemd/system/bluetooth.target.wants
+ tags:
+ - systemd
+
+- import_tasks: console.yml
+ tags: console
+- import_tasks: jumbotron.yml
+ tags: jumbotron
+- import_tasks: autologin.yml
+ tags: autologin
+- import_tasks: irssi.yml
+ tags: irssi
+
+# vim: set ts=2 sw=2 et: