forked from saratov/infra
Add VNC support
This commit is contained in:
parent
c99f972b52
commit
fbee2136ab
@ -196,3 +196,16 @@
|
|||||||
state: mounted
|
state: mounted
|
||||||
with_items: "{{node.mounts}}"
|
with_items: "{{node.mounts}}"
|
||||||
when: node.mounts is defined
|
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
|
||||||
|
20
roles/common/tasks/vnc.yml
Normal file
20
roles/common/tasks/vnc.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user