diff --git a/roles/xrdp_apphost/defaults/main.yml b/roles/xrdp_apphost/defaults/main.yml index 77d679f..32584e4 100644 --- a/roles/xrdp_apphost/defaults/main.yml +++ b/roles/xrdp_apphost/defaults/main.yml @@ -29,6 +29,7 @@ xrdp_applications: group: lightburn pass: fckgw01lightburn salt: $1$SomeSalt$ + git_config_folder: /home/lightburn/.config/LightBurn/ checksum: sha256:30d3cd573f5036edf74922ce56515304e668c345b5921fa0786248a8cc4be048 version: 1.0.04 @@ -38,12 +39,14 @@ xrdp_applications: group: estlcam pass: fckgw01estlcam salt: $1$SomeSalt$ + git_config_folder: /home/estlcam/.wine32/drive_c/ProgramData/Estlcam/ Slicer: user: slicer group: slicer pass: fckgw01slicer salt: $1$SomeSalt$ + git_config_folder: /home/slicer/.config/PrusaSlicer/ checksum: sha256:b6c34157ff2acffae5b39a1997f5694e9ca4717d5c9b370f75a6728eeadb9cab version: 2.4.0+linux-x64-202112211614 diff --git a/roles/xrdp_apphost/tasks/app_common.yml b/roles/xrdp_apphost/tasks/app_common.yml index 3d2c43b..f0b4d6f 100644 --- a/roles/xrdp_apphost/tasks/app_common.yml +++ b/roles/xrdp_apphost/tasks/app_common.yml @@ -1,5 +1,10 @@ --- +- name: Install global dependencies + apt: + name: + - git + - name: Create Application groups group: name={{ item.value.group }} with_dict: @@ -49,3 +54,51 @@ user: "{{ item.value.user }}" with_dict: - "{{ xrdp_applications }}" + +- name: Create config directory + file: + path: "{{ item.value.git_config_folder }}" + state: directory + become: yes + become_user: "{{ item.value.user }}" + with_dict: + - "{{ xrdp_applications }}" + +- name: Create git repo for configs + command: git init {{ item.value.git_config_folder }} + become: yes + become_user: "{{ item.value.user }}" + args: + creates: "{{ item.value.git_config_folder }}/.git" + with_dict: + - "{{ xrdp_applications }}" + +- name: Setup git user names + git_config: + name: user.name + scope: global + value: "{{ item.value.user }}" + become: yes + become_user: "{{ item.value.user }}" + with_dict: + - "{{ xrdp_applications }}" + +- name: Setup git E-Mail + git_config: + name: user.email + scope: global + value: "{{ item.value.user }}@{{ inventory_hostname }}" + become: yes + become_user: "{{ item.value.user }}" + with_dict: + - "{{ xrdp_applications }}" + +- name: Create config git commit cron + cron: + name: "Add and commit all changes" + minute: "5" + hour: "5" + job: "cd {{ item.value.git_config_folder }} && git add -A && git commit -m 'Commit via cronjob'" + user: "{{ item.value.user }}" + with_dict: + - "{{ xrdp_applications }}" \ No newline at end of file