This commit is contained in:
2021-01-29 21:18:48 +01:00
parent 82dca4a02c
commit 19357fd440
5 changed files with 147 additions and 17 deletions

View File

@ -88,3 +88,88 @@
- system-user
- name: (nis_user.yml) Check if directory ~/.config/autostart exists
stat:
path: '{{ nis_base_home }}/{{ item.name }}/.config/autostart'
loop: "{{ nis_user }}"
loop_control:
label: '{{ item.name }}'
register: home_config_autostart
tags:
- nis-user
- x11vnc
- name: (nis_user.yml) Ensure directory ~/.config/autostart if not exists
file:
path: '{{ nis_base_home }}/{{ item.item.name }}/.config/autostart'
state: directory
owner: "{{ item.item.name }}"
group: "{{ item.item.name }}"
mode: 0700
recurse: yes
loop: "{{ home_config_autostart.results }}"
loop_control:
label: '{{ item.item.name }}'
when : not item.stat.exists|bool
tags:
- nis-user
- x11vnc
#- name: (nis_user.yml) Ensure directory ~/.config/autostart if not exists
# file:
# path: '{{ nis_base_home }}/{{ item.name }}/.config/autostart'
# state: directory
# owner: "{{ item.name }}"
# group: "{{ item.name }}"
# mode: 0700
# recurse: yes
# loop: "{{ nis_user }}"
# loop_control:
# label: '{{ item.name }}'
# tags:
# - nis-user
# - x11vnc
- name: (nis_user.yml) Check if file ~/.config/autostart/x11vnc.desktop exists
stat:
path: '{{ nis_base_home }}/{{ item.name }}/.config/autostart/x11vnc.desktop'
loop: "{{ nis_user }}"
loop_control:
label: '{{ item.name }}'
register: home_config_autostart_x11vnc
tags:
- nis-user
- x11vnc
- name: (nis_user.yml) Ensure file ~/.config/autostart/x11vnc.desktop exists
copy:
src: "{{ role_path + '/files/USER_HOME/.config/autostart/x11vnc.desktop' }}"
dest: '{{ nis_base_home }}/{{ item.item.name }}/.config/autostart/x11vnc.desktop'
owner: '{{ item.item.name }}'
group: '{{ item.item.name }}'
mode: 0600
loop: "{{ home_config_autostart_x11vnc.results }}"
loop_control:
label: '{{ item.item.name }}'
tags:
- nis-user
- x11vnc
#- name: (nis_user.yml) Ensure file ~/.config/autostart/x11vnc.desktop exists
# copy:
# src: "{{ role_path + '/files/USER_HOME/.config/autostart/x11vnc.desktop' }}"
# dest: '{{ nis_base_home }}/{{ item.name }}/.config/autostart/x11vnc.desktop'
# owner: '{{ item.name }}'
# group: '{{ item.name }}'
# mode: 0600
# loop: "{{ nis_user }}"
# loop_control:
# label: '{{ item.name }}'
# tags:
# - nis-user
# - x11vnc