aboutsummaryrefslogtreecommitdiffstats
path: root/roles/raspbian/tasks
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 /roles/raspbian/tasks
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
Diffstat (limited to 'roles/raspbian/tasks')
-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
3 files changed, 31 insertions, 0 deletions
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: