mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-07-02 07:48:32 +02:00
lala
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
- block:
|
||||
|
||||
- name: include vault
|
||||
ansible.builtin.include_vars:
|
||||
file: jaydee.yml
|
||||
- name: Install vnc packages
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
@ -7,40 +9,45 @@
|
||||
- tigervnc-common
|
||||
update_cache: yes
|
||||
|
||||
- name: Creating config
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
|
||||
dest: "/etc/systemd/system/vncserver@.service"
|
||||
content: |
|
||||
[Unit]
|
||||
Description=VNC Server
|
||||
After=syslog.target network.target
|
||||
[Service]
|
||||
Type=forking
|
||||
WorkingDirectory=/home/jd
|
||||
User=jd
|
||||
Group=jd
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/tigervncserver -kill %i > /dev/null 2>&1 || :'
|
||||
ExecStart = /usr/bin/tigervncserver -xstartup /usr/bin/mate-session -SecurityTypes VncAuth,TLSVnc -geometry 1600x900 -localhost no %i
|
||||
ExecStop = /usr/bin/tigervncserver -kill %i
|
||||
Environment="HOME=/home/jd"
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
owner: root
|
||||
mode: '0744'
|
||||
- name: Create a directory if it does not exist
|
||||
ansible.builtin.file:
|
||||
path: /home/jd/.vnc/
|
||||
path: /home/jd/.vnc
|
||||
state: directory
|
||||
mode: '0755'
|
||||
mode: '0700'
|
||||
owner: jd
|
||||
group: jd
|
||||
- name: Creating a file with content
|
||||
copy:
|
||||
dest: "/home/jd/.vnc/config"
|
||||
content: |
|
||||
session=mate
|
||||
geometry=1200x721
|
||||
localhost
|
||||
alwaysshared
|
||||
mode: '0755'
|
||||
owner: jd
|
||||
group: jd
|
||||
- name: Reconfigure vnc
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/tigervnc/vncserver-config-defaults
|
||||
regexp: "^$localhost =.* "
|
||||
line: '$localhost = "no";'
|
||||
|
||||
- name: Reconfigure vnc1
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/tigervnc/vncserver.users
|
||||
#regexp: "^:1=.*"
|
||||
line: ':1=jd'
|
||||
|
||||
- name: Reconfigure zabbix agent Server
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/tigervnc/vncserver.users"
|
||||
regexp: "^:1=jd"
|
||||
line: ":1=jd"
|
||||
become: "{{ false if inventory_hostname == 'nas.home.lan' else true }}"
|
||||
|
||||
- name: Set vnc password
|
||||
ansible.builtin.shell:
|
||||
cmd: echo "{{ vnc_password }}" | vncpasswd -f > /home/jd/.vnc/vncpasswd
|
||||
- name: Set vnc password
|
||||
ansible.builtin.shell:
|
||||
cmd: echo "{{ vnc_password }}" | vncpasswd -f > /home/jd/.vnc/passwd
|
||||
- name: Restart service vncserver, in all cases
|
||||
ansible.builtin.service:
|
||||
name: vncserver@:1
|
||||
state: restarted
|
||||
daemon-reload: true
|
||||
enabled: true
|
||||
become: true
|
Reference in New Issue
Block a user