aboutsummaryrefslogtreecommitdiffstats
path: root/roles/raspbian/tasks
diff options
context:
space:
mode:
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: