diff --git a/group_vars/all/main.yml b/group_vars/all/main.yml index d651887..c5f31d9 100644 --- a/group_vars/all/main.yml +++ b/group_vars/all/main.yml @@ -572,6 +572,11 @@ apt_remove: - tor - tor-geoipdb - torsocks + +apt_remove_xenial: + - netplan.io + +apt_remove_bionic: - netplan.io apt_remove_purge: false diff --git a/roles/common/files/USER_HOME/.config/autostart/x11vnc.desktop b/roles/common/files/USER_HOME/.config/autostart/x11vnc.desktop new file mode 100644 index 0000000..4814b2d --- /dev/null +++ b/roles/common/files/USER_HOME/.config/autostart/x11vnc.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Exec=x11vnc -rfbport -rfbauth /etc/x11vnc.pass +Hidden=false +NoDisplay=false +X-GNOME-Autostart-enabled=true +Name[de_DE]=X11VNC User-Service +Name=X11VNC User-Service +Comment[de_DE]= +Comment= diff --git a/roles/common/tasks/apt.yml b/roles/common/tasks/apt.yml index 249ed87..e602270 100644 --- a/roles/common/tasks/apt.yml +++ b/roles/common/tasks/apt.yml @@ -265,6 +265,28 @@ tags: - apt-remove +- name: (apt.yml) Remove unwanted packages Ubuntu bionic + apt: + name: "{{ apt_remove_bionic }}" + state: absent + purge: "{{ apt_remove_purge }}" + when: + - ansible_facts['distribution'] == "Ubuntu" + - ansible_facts['distribution_release'] == "bionic" + tags: + - apt-remove + +- name: (apt.yml) Remove unwanted packages Ubuntu xenial + apt: + name: "{{ apt_remove_xenial }}" + state: absent + purge: "{{ apt_remove_purge }}" + when: + - ansible_facts['distribution'] == "Ubuntu" + - ansible_facts['distribution_release'] == "xenial" + tags: + - apt-remove + - name: (apt.yml) autoremove apt: autoremove: true diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index e7a0f1b..3eb5c06 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -69,7 +69,7 @@ # tags supported inside pure-ftpd-install.yml: # - import_tasks: pure-ftpd-install.yml - when: + when: - groups['ftp_server']|string is search(inventory_hostname) tags: - pure-ftpd @@ -110,7 +110,7 @@ - system-user -# tags supported inside :nis-install-server.yml +# tags supported inside nis-install-server.yml: # # nis-install-server - import_tasks: nis-install-server.yml diff --git a/roles/common/tasks/nis-user.yml b/roles/common/tasks/nis-user.yml index 5077d53..409c438 100644 --- a/roles/common/tasks/nis-user.yml +++ b/roles/common/tasks/nis-user.yml @@ -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 + +