aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@labitat.dk>2018-10-03 15:33:14 +0200
committerEmil Renner Berthing <esmil@labitat.dk>2018-10-03 21:08:13 +0200
commit2013899ce249fd316d7b3df9a4d79b8936bf0b1c (patch)
tree892fc890bc69a1bccd5a56b8f35615dbafa9a0d4
parentd73f54e7e56f689fa3dc69e5a54f078c9680c337 (diff)
downloadlabitat-ansible-2013899ce249fd316d7b3df9a4d79b8936bf0b1c.tar.gz
labitat-ansible-2013899ce249fd316d7b3df9a4d79b8936bf0b1c.tar.xz
labitat-ansible-2013899ce249fd316d7b3df9a4d79b8936bf0b1c.zip
raspbian: add basic Raspbian role
..which just extends the Debian role with a bit of cleanup and config to save on sd-card writes
-rw-r--r--roles/raspbian/defaults/main.yml104
-rw-r--r--roles/raspbian/meta/main.yml5
-rw-r--r--roles/raspbian/tasks/main.yml10
-rw-r--r--roles/raspbian/tasks/networkd.yml8
-rw-r--r--roles/raspbian/tasks/remove_pi.yml13
5 files changed, 140 insertions, 0 deletions
diff --git a/roles/raspbian/defaults/main.yml b/roles/raspbian/defaults/main.yml
new file mode 100644
index 0000000..4e63458
--- /dev/null
+++ b/roles/raspbian/defaults/main.yml
@@ -0,0 +1,104 @@
+---
+journald_conf:
+ # don't write journal to sd-card,
+ 'Journal.Storage': 'volatile'
+ # just keep the last 16M in memory
+ 'Journal.RuntimeMaxUse': '16M'
+ 'Journal.ForwardToSyslog': 'no'
+
+apt_repos:
+ raspbian:
+ # doesn't support https, psh
+ uri: 'http://raspbian.raspberrypi.org/raspbian'
+ suite: '{{ ansible_distribution_release }}'
+
+apt_packages:
+ # remove all this crap
+ 'vim-tiny': absent
+ 'mountall': absent
+ 'libmnl-dev': absent
+ 'cifs-utils': absent
+ 'samba-common': absent
+ 'nfs-common': absent
+ 'blends-tasks': absent
+ 'info': absent
+ 'geoip-database': absent
+ 'iso-codes': absent
+ 'dmidecode': absent
+ 'debconf-i18n': absent
+ 'rename': absent
+ 'libpng-tools': absent
+ 'v4l-utils': absent
+ 'hardlink': absent
+ 'libpam-chksshpwd': absent
+ 'libsysfs2': absent
+ 'ed': absent
+ 'ncdu': absent
+ 'libpng-dev': absent
+ 'fakeroot': absent
+ 'libusb-0.1-4': absent
+ 'libpng16-16': absent
+ 'libfakeroot': absent
+ 'libboost-iostreams1.60.0': absent
+ 'libboost-iostreams1.58.0': absent
+ 'tcpd': absent
+ 'libmtp-runtime': absent
+ 'libglib2.0-data': absent
+ 'libfreetype6-dev': absent
+ 'dphys-swapfile': absent
+ 'luajit': absent
+ 'libsasl2-modules': absent
+ 'libestr0': absent
+ 'libfastjson4': absent
+ 'net-tools': absent
+ 'gdb': absent
+ 'xdg-user-dirs': absent
+ 'raspberrypi-net-mods': absent
+ 'liblogging-stdlog0': absent
+ 'liblognorm5': absent
+ 'libudev0': absent
+ 'libnih-dbus1': absent
+ 'libnih1': absent
+ 'plymouth': absent
+ 'libplymouth4': absent
+ 'apt-listchanges': absent
+ 'xml-core': absent
+ 'rsyslog': absent
+ 'libident': absent
+ 'libsigc++-1.2-5c2': absent
+ 'paxctl': absent
+ 'paxctld': absent
+ 'libfile-fcntllock-perl': absent
+ 'libalgorithm-merge-perl': absent
+ 'libalgorithm-diff-xs-perl': absent
+ 'libtext-iconv-perl': absent
+ 'libtext-wrapi18n-perl': absent
+ 'libtext-charwidth-perl': absent
+ 'xauth': absent
+ 'shared-mime-info': absent
+ 'libdrm2': absent
+ 'isc-dhcp-common': absent
+ 'libdns-export162': absent
+ 'libisc-export160': absent
+ 'policykit-1': absent
+ 'build-essential': absent
+ 'libc6-dbg': absent
+ 'libc6-dev': absent
+ 'pkg-config': absent
+ 'libraspberrypi-dev': absent
+ 'gcc': absent
+ 'cpp': absent
+ 'gcc-6': absent
+ 'gcc-5-base': absent
+ 'gcc-4.9-base': absent
+ 'gcc-4.8-base': absent
+ 'gcc-4.7-base': absent
+ 'gcc-4.6-base': absent
+ 'isc-dhcp-client': absent
+ 'dpkg-dev': absent
+ 'libdpkg-perl': absent
+ 'apt-utils': absent
+ 'avahi-daemon': absent
+ 'dhcpcd5': absent
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/raspbian/meta/main.yml b/roles/raspbian/meta/main.yml
new file mode 100644
index 0000000..3705882
--- /dev/null
+++ b/roles/raspbian/meta/main.yml
@@ -0,0 +1,5 @@
+---
+dependencies:
+- role: debian
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/raspbian/tasks/main.yml b/roles/raspbian/tasks/main.yml
new file mode 100644
index 0000000..3200277
--- /dev/null
+++ b/roles/raspbian/tasks/main.yml
@@ -0,0 +1,10 @@
+---
+- import_tasks: networkd.yml
+ tags: networkd
+- import_tasks: remove_pi.yml
+ when: >
+ (ansible_user is not defined or ansible_user != 'pi') and
+ (ansible_ssh_user is not defined or ansible_ssh_user != 'pi')
+ tags: remove_pi
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/raspbian/tasks/networkd.yml b/roles/raspbian/tasks/networkd.yml
new file mode 100644
index 0000000..bfff12d
--- /dev/null
+++ b/roles/raspbian/tasks/networkd.yml
@@ -0,0 +1,8 @@
+---
+- name: Clean up old dhcpcd configuration
+ file:
+ path: '/etc/systemd/system/dhcpcd.service.d'
+ state: absent
+ when: use_networkd
+
+# vim: set ts=2 sw=2 et:
diff --git a/roles/raspbian/tasks/remove_pi.yml b/roles/raspbian/tasks/remove_pi.yml
new file mode 100644
index 0000000..e67393e
--- /dev/null
+++ b/roles/raspbian/tasks/remove_pi.yml
@@ -0,0 +1,13 @@
+---
+- name: Remove pi user
+ user:
+ name: pi
+ state: absent
+ remove: true
+
+- name: Remove pi sudoers rule
+ file:
+ path: '/etc/sudoers.d/010_pi-nopasswd'
+ state: absent
+
+# vim: set ts=2 sw=2 et: