ansible.role.xrdp/tasks/main.yml
2019-01-27 00:30:35 +08:00

36 lines
917 B
YAML

- name: Install EPEL repo
yum:
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
state: installed
- name: Install Server with GUI group package, may take a while...
yum:
name: '@^Server with GUI'
state: latest
- name: Install vncserver
yum:
name:
- tigervnc-server
- xrdp
state: latest
- name: selinux stuff for xrdp
shell: "chcon --type=bin_t /usr/sbin/xrdp; chcon --type=bin_t /usr/sbin/xrdp-sesman"
- name: Enable and start xrdp service
service:
name: xrdp
state: started
enabled: yes
- name: Create user xrdpuser
user:
name: xrdpuser
shell: /bin/bash
password: "{{ lookup('password', '/dev/shm/xrdpuser chars=ascii_letters,digits,hexdigits length=15') }}"
- name: Display password of xrdpuser
debug:
var: "{{ lookup('password', '/dev/shm/xrdpuser chars=ascii_letters,digits,hexdigits length=15') }}"