disable stock users (pi, pine64, etc)

Fri, 23 Jun 2017 16:37:07 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 23 Jun 2017 16:37:07 -0400
changeset 72
33181d87b149
parent 71
509db8d79ab5
child 73
8b0c09efbb5b

disable stock users (pi, pine64, etc)

roles/user/defaults/main.yml file | annotate | diff | comparison | revisions
roles/user/tasks/disable-stock.yml file | annotate | diff | comparison | revisions
roles/user/tasks/main.yml file | annotate | diff | comparison | revisions
new file mode 100644
--- /dev/null
+++ b/roles/user/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+disable_stock_users: false
+
new file mode 100644
--- /dev/null
+++ b/roles/user/tasks/disable-stock.yml
@@ -0,0 +1,8 @@
+---
+
+- name: Disable stock users
+  shell: usermod -e 1 {{item}}
+  ignore_errors: true
+  with_items:
+    - pi
+    - pine64
--- a/roles/user/tasks/main.yml
+++ b/roles/user/tasks/main.yml
@@ -68,3 +68,6 @@
   changed_when: homedir_setup.stdout | match("Updating|Cloning")
   failed_when: homedir_setup.rc != 0
   tags: user, dotfiles
+
+- include: disable-stock.yml
+  when: disable_stock_users

mercurial