ansible.role.xrdp/tasks/main.yml

38 lines
1010 B
YAML
Raw Normal View History

2019-01-27 00:24:13 +08:00
- 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:
2019-01-27 00:37:14 +08:00
update_cache: yes
2019-01-27 00:24:13 +08:00
name: '@^Server with GUI'
2019-01-27 00:37:14 +08:00
state: present
2019-01-27 00:24:13 +08:00
- 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"
when: ansible_selinux.status == "enabled"
2019-01-27 00:24:13 +08:00
- name: Enable and start xrdp service
service:
name: xrdp
state: started
enabled: yes
2019-01-27 00:30:35 +08:00
- name: Create user xrdpuser
user:
name: xrdpuser
shell: /bin/bash
2019-01-27 00:52:41 +08:00
password: "{{ lookup('password', '/dev/shm/xrdpuser chars=ascii_letters,digits,hexdigits length=15') | password_hash('sha512') }}"
2019-01-27 00:30:35 +08:00
- name: Display password of xrdpuser
debug:
2019-01-27 00:52:41 +08:00
msg: "{{ lookup('password', '/dev/shm/xrdpuser chars=ascii_letters,digits,hexdigits length=15') }}"