-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxrdp.yaml
61 lines (49 loc) · 1.94 KB
/
xrdp.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
- hosts: localhost
tasks:
- name: Install dependencies (CentOS/RHEL)
yum: name={{ item }} state=present disable_gpg_check=yes
with_items:
- xrdp
- xterm
- mate-desktop
- gnome-session
- mate-session-manager
- gnome-icon-theme
- mate-icon-theme
- nautilus
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
- name: Install dependencies (Ubuntu/Debian)
apt: name={{ item }} state=present update_cache=yes
with_items:
- xrdp
- xterm
- gnome-icon-theme
- mate-icon-theme
- mate-desktop
- mate-session-manager
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Enable xrdp at boot
service: name=xrdp enabled=yes
- name: Setup startwm.sh on Ubuntu
copy: src=startwm-ubuntu.sh dest=/etc/xrdp/startwm.sh owner=root group=root mode=755 backup=yes
notify: restart xrdp
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Setup startwm.sh on RHEL
copy: src=startwm-rhel.sh dest=/etc/xrdp/startwm.sh owner=root group=root mode=755 backup=yes
notify: restart xrdp
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
- name: Open up Firewall
command: firewall-cmd --permanent --zone=public --add-port=3389/tcp
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
notify: Reload Firewall
- name: Fix SELinux Contexts
command: chcon --type=bin_t /usr/sbin/xrdp /usr/sbin/xrdp-sesman
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'
notify: restart xrdp
handlers:
- name: restart xrdp
service: name=xrdp state=restarted
- name: Reload Firewall
command: firewall-cmd --reload
when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'