Add ability to set the user's shell, using a sane, per-platform default
Fix case insensitivity issue with platform included filenames
Change-Id: I434a89b2b0534c7883c35e4e5536346d41f90bf6
diff --git a/README.md b/README.md
index 429b7dd..877b8ee 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,9 @@
to the remote account's `~/.ssh/authorized_keys` file. The default value is
`true`, and the name of the file expected is `<username>.pub`.
+- `shell`: The path to the shell for this user. If not provided, a default will
+ be provided on a per-platform basis.
+
Each entry in the userlist has a few optional parameters:
- Users are added to other groups specified in the `extra_groups` list. These
diff --git a/tasks/Redhat.yml b/tasks/RedHat.yml
similarity index 100%
rename from tasks/Redhat.yml
rename to tasks/RedHat.yml
diff --git a/tasks/main.yml b/tasks/main.yml
index befc0dc..8ba9c7c 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -22,6 +22,7 @@
password: "{{ item[users_os_pw_type] }}"
home: "{{ item.homedir | default(omit) }}"
system: "{{ item.system | default(false) }}"
+ shell: "{{ item.shell | default(users_default_shell) }}"
with_items: "{{ userlist }}"
- name: Add user to sudo-capable group if they're a sudoer
diff --git a/vars/Debian.yml b/vars/Debian.yml
index 5bed69b..66b08c9 100644
--- a/vars/Debian.yml
+++ b/vars/Debian.yml
@@ -10,3 +10,5 @@
users_os_sudoers_group: "sudo"
users_os_pw_type: "sha512crypt"
+
+users_default_shell: "/bin/bash"
diff --git a/vars/OpenBSD.yml b/vars/OpenBSD.yml
index c68a5ee..09f0d78 100644
--- a/vars/OpenBSD.yml
+++ b/vars/OpenBSD.yml
@@ -10,3 +10,5 @@
users_os_sudoers_group: "wheel"
users_os_pw_type: "bcrypt"
+
+users_default_shell: "/bin/ksh"
diff --git a/vars/Redhat.yml b/vars/RedHat.yml
similarity index 90%
rename from vars/Redhat.yml
rename to vars/RedHat.yml
index e03cf0b..c446aa0 100644
--- a/vars/Redhat.yml
+++ b/vars/RedHat.yml
@@ -10,3 +10,5 @@
users_os_sudoers_group: "wheel"
users_os_pw_type: "sha512crypt"
+
+users_default_shell: "/bin/bash"