Skip to content

Commit 0318255

Browse files
authored
Merge pull request #335 from meysam81/issue-333-fix
feat: allow users to select their shell
2 parents b0837ef + dce8e48 commit 0318255

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

ansible/roles/dev-desktop/defaults/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,11 @@ vars_user_quota_gb: 150
88

99
# Prototype user whose file system quota will be copied to new user accounts
1010
vars_user_quota_prototype_user: "quota-prototype"
11+
12+
vars_user_config:
13+
# - username: rylev
14+
# shell: /bin/sh
15+
# - username: meysam
16+
# shell: /usr/bin/zsh
17+
# - username: jdno
18+
# shell: /usr/bin/fish

ansible/roles/dev-desktop/tasks/dependencies.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
# Necessary for building rr
5858
- capnproto
5959
- libcapnp-dev
60+
- zsh
6061
state: present
6162

6263
- name: Uninstall valgrind from apt

ansible/roles/dev-desktop/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- include_tasks: podman.yml
55
- include_tasks: quota.yml
66
- include_tasks: user_configuration.yml
7+
- include_tasks: usermod.yml
8+
with_items: "{{ vars_user_config }}"
9+
when: vars_user_config is not none and vars_user_config | length > 0
710
- include_tasks: team_login.yml
811
- include_tasks: github.yml
912
- include_tasks: motd.yml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
- name: Check user {{ item.username }} exists
3+
ansible.builtin.getent:
4+
database: passwd
5+
key: "{{ item.username }}"
6+
register: user_exists
7+
ignore_errors: true
8+
9+
- name: Set the user shell to {{ item.shell }}
10+
ansible.builtin.user:
11+
name: "{{ item.username }}"
12+
shell: "{{ item.shell }}"
13+
when: user_exists is succeeded

0 commit comments

Comments
 (0)