diff --git a/salt/states/remote-desktop/files/custom.conf b/salt/states/remote-desktop/files/custom.conf new file mode 100644 index 0000000..c30da11 --- /dev/null +++ b/salt/states/remote-desktop/files/custom.conf @@ -0,0 +1,20 @@ +# GDM configuration storage +# +# Note: settings from /etc/sysconfig/displaymanager have a higher priority +# + +[daemon] +InitialSetupEnable=False +# Uncomment the line below to force the login screen to use Xorg +WaylandEnable=false + +[security] + +[xdmcp] + +[chooser] + +[debug] +# Uncomment the line below to turn on debugging +#Enable=true + diff --git a/salt/states/remote-desktop/files/x0vncserver.desktop.template b/salt/states/remote-desktop/files/x0vncserver.desktop.template index 2a4bc4d..e8a391c 100644 --- a/salt/states/remote-desktop/files/x0vncserver.desktop.template +++ b/salt/states/remote-desktop/files/x0vncserver.desktop.template @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Exec=x0vncserver -passwordfile /home/{{ pillar['user'] }}/.vnc/passwd +Exec=x0vncserver -passwordfile /home/{{ pillar['username'] }}/.vnc/passwd Hidden=false X-GNOME-Autostart-enabled=true Name=x0vncserver diff --git a/salt/states/remote-desktop/init.sls b/salt/states/remote-desktop/init.sls index 2e9ed4a..e700eb6 100644 --- a/salt/states/remote-desktop/init.sls +++ b/salt/states/remote-desktop/init.sls @@ -2,6 +2,15 @@ Install xorg-x11-Xvnc: pkg.installed: - name: xorg-x11-Xvnc +Disable wayland login: + file.managed: + - name: /etc/gdm/custom.conf + - source: salt://remote-desktop/files/custom.conf + - user: root + - group: root + - mode: "0644" + + Set vnc password if no passwd file: cmd.run: - name: bash -c "echo {{ pillar['remote-desktop']['password'] }} | vncpasswd -f > /home/{{ pillar['username'] }}/.vnc/passwd" @@ -19,6 +28,7 @@ Create x0vncserver desktop file: file.managed: - name: /home/{{ pillar['username'] }}/.config/autostart/x0vncserver.desktop - source: salt://remote-desktop/files/x0vncserver.desktop.template + - template: jinja - user: {{ pillar['username'] }} - group: users - mode: "0600"