-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue in
linux_xrdp_server
role where Polkit configuration…
… did not apply on Kali Linux
- Loading branch information
Showing
7 changed files
with
51 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
# Role Name | ||
# linux_xrdp_server | ||
|
||
COMING SOON | ||
A brief description of the role goes here. | ||
This roles installs and configures xrdp on a Linux machine. | ||
|
||
## Requirements | ||
|
||
COMING SOON | ||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
none | ||
|
||
## Role Variables | ||
|
||
COMING SOON | ||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. | ||
All required role variables are coming from gather_facts. | ||
|
||
## Dependencies | ||
|
||
COMING SOON | ||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. | ||
none | ||
|
||
## Example Playbook | ||
## Example | ||
|
||
COMING SOON | ||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
|
||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
|
||
## License | ||
|
||
AGPL-3.0-or-later | ||
|
||
## Author Information | ||
|
||
COMING SOON | ||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). | ||
```yaml | ||
- name: Inlcude role linux_xrdp_server | ||
ansible.builtin.include_role: | ||
name: nova.core.linux_xrdp_server | ||
``` |
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
nova/core/roles/linux_xrdp_server/files/10-configuration.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
polkit.addRule(function(action, subject) { | ||
if ((action.id == "org.freedesktop.color-manager.create-device" || | ||
action.id == "org.freedesktop.color-manager.create-profile" || | ||
action.id == "org.freedesktop.color-manager.delete-device" || | ||
action.id == "org.freedesktop.color-manager.delete-profile" || | ||
action.id == "org.freedesktop.color-manager.modify-device" || | ||
action.id == "org.freedesktop.color-manager.modify-profile" || | ||
action.id == "org.freedesktop.login1.reboot" || | ||
action.id == "org.freedesktop.login1.reboot-multiple-sessions" ) && | ||
(subject.isInGroup ("sudo") || subject.isInGroup ("users"))) { | ||
return polkit.Result.YES; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# https://c-nergy.be/blog/?p=12073 | ||
- name: Configuring XRDP polkit... | ||
ansible.builtin.copy: | ||
src: 10-configuration.rules | ||
dest: /etc/polkit-1/rules.d/10-configuration.rules | ||
mode: "0644" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
- name: Installing xrdp on Debian based OS... | ||
ansible.builtin.include_tasks: debian.yml | ||
when: (ansible_distribution == 'Debian') or (ansible_distribution == 'Kali') or (ansible_distribution == "Ubuntu") | ||
when: ansible_os_family == "Debian" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
# http://c-nergy.be/blog/?p=12043 | ||
- name: Configuring XRDP polkit... | ||
ansible.builtin.copy: | ||
src: 10-configuration.pkla | ||
dest: /etc/polkit-1/localauthority/50-local.d/10-configuration.pkla | ||
mode: "0644" | ||
|
||
- name: Creating xrdp start cron job... # Because if there's a lot of (security) agents installed the xrdp service times out on boot | ||
ansible.builtin.cron: | ||
name: Start xrdp.service | ||
special_time: reboot | ||
job: sleep 30 && systemctl restart xrdp.service | ||
user: root |