You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB
YAML

---
- name: install remove desktop
hosts: all
tasks:
- name: install packages
ansible.builtin.apt:
update_cache: true
clean: true
pkg:
- xfce4
- tigervnc-standalone-server
- git
- name: add user
ansible.builtin.user:
name: "{{ item }}"
shell: /bin/bash
create_home: yes
register: add_user
loop: "{{ usernames }}"
- name: test
ansible.builtin.debug:
var: "{{ item.uid }}"
loop: "{{ add_user.results }}"
- name: create dir for novnc
ansible.builtin.file:
path: /opt/novnc
state: directory
- name: extract novnc
ansible.builtin.unarchive:
remote_src: yes
src: https://github.com/novnc/noVNC/archive/refs/tags/v1.4.0.tar.gz
dest: /opt/novnc
extra_opts: --strip-components=1
- name: create novnc service
ansible.builtin.template:
src: templates/novnc.service.j2
dest: /lib/systemd/system/novnc.service
- name: start novnc service
ansible.builtin.systemd:
daemon_reload: true
enabled: true
state: started
name: novnc.service
- name: add user to vnc
ansible.builtin.lineinfile:
path: /etc/tigervnc/vncserver.users
line: ':{{ (item.uid | string)[2:] }}={{ item.name }}'
loop: "{{ add_user.results }}"
- name: disable password on vnc
ansible.builtin.lineinfile:
path: /etc/tigervnc/vncserver-config-defaults
line: '$SecurityTypes = "None"'
- name: delete bug on vnc
ansible.builtin.lineinfile:
path: /etc/tigervnc/vncserver-config-defaults
line: '#1;'
regexp: '^1;'
- name: start tigervnc
ansible.builtin.systemd:
enabled: true
state: started
name: tigervncserver@:{{ (item.uid | string)[2:] }}.service
loop: "{{ add_user.results }}"