.
This commit is contained in:
parent
4d22f60e10
commit
f36d29003f
@ -7,7 +7,7 @@ network:
|
||||
|
||||
interface:
|
||||
internal: eth0
|
||||
external: eth0.1000
|
||||
external: eth1
|
||||
|
||||
vlan:
|
||||
-
|
||||
|
2
salt/pillars/remote-desktop.sls
Normal file
2
salt/pillars/remote-desktop.sls
Normal file
@ -0,0 +1,2 @@
|
||||
remote-desktop:
|
||||
password: linux0
|
@ -5,6 +5,7 @@ base:
|
||||
- mysql
|
||||
- rmt
|
||||
- docker
|
||||
- remote-desktop
|
||||
{% if salt['pillar.file_exists']('local.sls') %}
|
||||
- local
|
||||
{% endif %}
|
||||
|
@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=x0vncserver -passwordfile /home/{{ pillar['user'] }}/.vnc/passwd
|
||||
Hidden=false
|
||||
X-GNOME-Autostart-enabled=true
|
||||
Name=x0vncserver
|
||||
Comment=x0vncserver
|
24
salt/states/remote-desktop/init.sls
Normal file
24
salt/states/remote-desktop/init.sls
Normal file
@ -0,0 +1,24 @@
|
||||
Install xorg-x11-Xvnc:
|
||||
pkg.installed:
|
||||
- name: xorg-x11-Xvnc
|
||||
|
||||
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 "[[ -f /home/{{ pillar['username'] }}/.vnc/passwd ]]"
|
||||
|
||||
Check that passwd file has correct settings:
|
||||
file.managed:
|
||||
- name: /home/{{ pillar['username'] }}/.vnc/passwd
|
||||
- user: {{ pillar['username'] }}
|
||||
- group: users
|
||||
- mode: "0600"
|
||||
|
||||
Create x0vncserver desktop file:
|
||||
file.managed:
|
||||
- name: /home/{{ pillar['username'] }}/.config/autostart/x0vncserver.desktop
|
||||
- source: salt://remote-desktop/files/x0vncserver.desktop.template
|
||||
- user: {{ pillar['username'] }}
|
||||
- group: users
|
||||
- mode: "0600"
|
@ -10,3 +10,4 @@ base:
|
||||
- rmt
|
||||
- podman
|
||||
- docker.registry
|
||||
- remote-desktop
|
||||
|
Loading…
Reference in New Issue
Block a user