Skip to content

Commit

Permalink
Add VNC user creation (#23)
Browse files Browse the repository at this point in the history
Add linux user account creation

Co-authored-by: kadet77rus <[email protected]>
  • Loading branch information
kadet77rus and kadet77rus authored Jan 14, 2023
1 parent c9680db commit 12b36d9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,6 @@ vnc_reboot_once: false
### version2: tigervnc 1.11.0 and later. Runs vnc as a systemd service.
### You can override/set the variable with vnc_paradigm_override to "version1" or "version2". However, it should be automatically determined so you don't need to change this.
# vnc_paradigm_override: version1

### Optionally create groups and users. By default 'false'
vnc_create_users: false
17 changes: 17 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,23 @@
- ansible_distribution_major_version == "16"
changed_when: false

- name: Create VNC group and user
when: vnc_create_users
block:
- name: Create VNC group
ansible.builtin.group:
name: "{{ item.usergroup }}"
state: present
loop: "{{ vnc_users }}"

- name: Create VNC users
ansible.builtin.user:
name: "{{ item.username }}"
group: "{{ item.usergroup }}"
shell: /bin/bash
skeleton: /etc/skel
loop: "{{ vnc_users }}"

- name: Create .vnc dirs
ansible.builtin.file:
path: "/home/{{ item.username }}/.vnc"
Expand Down
1 change: 1 addition & 0 deletions templates/xstartup.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ exec /etc/X11/xinit/xinitrc
{% elif vnc_desktop == "mate" and ansible_os_family == "Debian" %}
# need to define
{% elif vnc_desktop == "xfce4" %}
xfce4-panel &
startxfce4
{% else %}
{# gnome on debian as the default #}
Expand Down

0 comments on commit 12b36d9

Please sign in to comment.