Add VNC support

This commit is contained in:
Андрей Лимачко 2022-06-03 08:12:15 +04:00
parent c99f972b52
commit fbee2136ab
2 changed files with 33 additions and 0 deletions

View File

@ -196,3 +196,16 @@
state: mounted
with_items: "{{node.mounts}}"
when: node.mounts is defined
- name: Add VNC Service
include_tasks: vnc.yml
when: node.vnc | default(True) | bool
- name: Populate service facts
service_facts:
- name: Restart LightDM service
service:
name: lightdm
state: restarted
when: node.vnc | default(True) | bool and 'lightdm.service' in services

View File

@ -0,0 +1,20 @@
---
- name: Install xorg-extension-vnc
apt_rpm:
pkg: xorg-extension-vnc
state: present
- name: Uncomment Xorg VNC config
replace:
path: /etc/X11/xorg.conf.d/vnc.conf
regexp: '^#(.*)$'
replace: '\1'
- name: Create .vnc directory
file:
path: /root/.vnc
state: directory
mode: '0755'
- name: Set VNC password
shell: echo "123456" | vncpasswd -f > /root/.vnc/passwd