2021-11-03 13:37:46 +01:00
|
|
|
---
|
|
|
|
|
2022-01-08 03:52:25 +01:00
|
|
|
- name: Set Default umask for Users
|
|
|
|
lineinfile:
|
|
|
|
dest: '/etc/login.defs'
|
|
|
|
regexp: "UMASK"
|
|
|
|
line: "UMASK 027"
|
|
|
|
state: present
|
|
|
|
|
|
|
|
|
2022-01-08 03:04:42 +01:00
|
|
|
- include: xrdp.yml
|
|
|
|
- include: lightburn.yml
|
|
|
|
- include: estlcam.yml
|
2022-01-08 03:39:36 +01:00
|
|
|
- include: slicer.yml
|
2022-01-08 03:04:42 +01:00
|
|
|
- include: samba.yml
|
2021-11-04 20:12:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
- name: Create tsadmin group
|
|
|
|
group: name={{ tsadmin_group }}
|
|
|
|
|
|
|
|
- name: Create tsadmin_user
|
|
|
|
user: name={{ tsadmin_user }} password={{ tsadmin_pass | password_hash('sha512', tsadmin_salt) }} home=/home/{{ tsadmin_user }} group={{ tsadmin_group }}
|
|
|
|
|
|
|
|
- name: Allow 'tsadmin_user' group to have passwordless sudo to other users
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/sudoers
|
|
|
|
state: present
|
2022-01-09 18:19:16 +01:00
|
|
|
regexp: '^{{ tsadmin_user }} ALL=({{ item.value.user }}) NOPASSWD: ALL'
|
|
|
|
line: '{{ tsadmin_user }} ALL=({{ item.value.user }}) NOPASSWD: ALL'
|
2021-11-04 20:12:24 +01:00
|
|
|
validate: visudo -cf %s
|
2022-01-09 18:19:16 +01:00
|
|
|
with_dict:
|
|
|
|
- "{{ xrdp_applications }}"
|
2021-11-04 20:12:24 +01:00
|
|
|
|
|
|
|
- name: Create tsadmin_user .xsession
|
|
|
|
template: src=tsadmin_xsession.j2 dest=/home/{{ tsadmin_user }}/.xsession
|
2022-01-09 16:37:41 +01:00
|
|
|
|
|
|
|
- name: Create file cleanup cron
|
|
|
|
cron:
|
|
|
|
name: "Delete files older than 30 days"
|
|
|
|
minute: "0"
|
|
|
|
hour: "5"
|
2022-01-09 18:19:16 +01:00
|
|
|
job: "find /home/{{ item.value.user }}/data -type f -mtime +30 ! -name \"{{ info_folder_name }}\" -delete"
|
|
|
|
user: "{{ item.value.user }}"
|
|
|
|
with_dict:
|
|
|
|
- "{{ xrdp_applications }}"
|
2022-01-09 16:37:41 +01:00
|
|
|
|
|
|
|
- name: Create directory cleanup cron
|
|
|
|
cron:
|
|
|
|
name: "Delete empty directories"
|
|
|
|
minute: "1"
|
|
|
|
hour: "5"
|
2022-01-09 18:19:16 +01:00
|
|
|
job: "find /home/{{ item.value.user }}/data -type d -empty ! -name \"{{ info_folder_name }}\" -delete"
|
|
|
|
user: "{{ item.value.user }}"
|
|
|
|
with_dict:
|
|
|
|
- "{{ xrdp_applications }}"
|