tlu/salt/states/remote-desktop/init.sls

38 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2021-10-11 19:44:15 +00:00
Install xorg-x11-Xvnc:
pkg.installed:
- name: xorg-x11-Xvnc
2021-10-12 06:29:31 +00:00
Disable wayland login:
file.managed:
- name: /etc/gdm/custom.conf
- source: salt://remote-desktop/files/custom.conf
- user: root
- group: root
- mode: "0644"
2021-10-11 19:44:15 +00:00
Check that passwd file has correct settings:
file.managed:
- name: /home/{{ pillar['username'] }}/.vnc/passwd
2021-10-17 18:03:37 +00:00
- source: salt://remote-desktop/files/passwd
2021-10-17 12:06:30 +00:00
- replace: False
2021-10-11 19:44:15 +00:00
- user: {{ pillar['username'] }}
- group: users
- mode: "0600"
2021-10-17 18:03:37 +00:00
- makedirs: True
- dir_mode: "0700"
Set vnc password if no passwd file:
cmd.run:
- name: bash -c "echo {{ pillar['remote-desktop']['password'] }} | vncpasswd -f > /home/{{ pillar['username'] }}/.vnc/passwd"
- runas: {{ pillar['username'] }}
- unless: bash -c "[[ -s /home/{{ pillar['username'] }}/.vnc/passwd ]]"
2021-10-11 19:44:15 +00:00
Create x0vncserver desktop file:
file.managed:
- name: /home/{{ pillar['username'] }}/.config/autostart/x0vncserver.desktop
- source: salt://remote-desktop/files/x0vncserver.desktop.template
2021-10-12 06:29:31 +00:00
- template: jinja
2021-10-11 19:44:15 +00:00
- user: {{ pillar['username'] }}
- group: users
- mode: "0600"