diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 6b67a40..167e1aa 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -192,6 +192,14 @@ - sudoers +# tags supported inside mount_samba_shares.yml: +# +- import_tasks: mount_samba_shares.yml + when: "groups['client_pc']|string is search(inventory_hostname)" + tags: + - samba-shares + + # Tasks: Configure VNC (x11vnc) for Ubuntu systems # # Supported OS: @@ -231,14 +239,6 @@ - finish-client-install -# tags supported inside mount_samba_shares.yml: -# -- import_tasks: mount_samba_shares.yml - when: "groups['client_pc']|string is search(inventory_hostname)" - tags: - - samba-shares - - #- name: "Configure LUKS" # import_tasks: luks.yml # when: "groups['client_pc']|string is search(inventory_hostname)" diff --git a/roles/common/tasks/nis-install-client.yml b/roles/common/tasks/nis-install-client.yml index 9bb7f7f..665b378 100644 --- a/roles/common/tasks/nis-install-client.yml +++ b/roles/common/tasks/nis-install-client.yml @@ -179,7 +179,7 @@ - name: (nis-install-client.yml) Adjust file /etc/nsswitch.conf (set hosts) replace: path: /etc/nsswitch.conf - regexp: '(hosts:\s+files)\s+([^nis].*)' + regexp: '(hosts:\s+files)\s+((?!nis).*)$' replace: '\1 nis \2' tags: - nis-install @@ -188,7 +188,7 @@ - name: (nis-install-client.yml) Adjust file /etc/nsswitch.conf (set passwd/group/shadow) replace: path: /etc/nsswitch.conf - regexp: '^({{ item }}:\s+.*)' + regexp: '^({{ item }}:\s+((?!nis).)*)$' replace: '\1 nis' with_items: - passwd diff --git a/roles/common/tasks/ubuntu-x11vnc-1804-amd64.yml b/roles/common/tasks/ubuntu-x11vnc-1804-amd64.yml index 7fe1792..0c939ea 100644 --- a/roles/common/tasks/ubuntu-x11vnc-1804-amd64.yml +++ b/roles/common/tasks/ubuntu-x11vnc-1804-amd64.yml @@ -18,7 +18,26 @@ state: present vars: packages: - - x11vnc + - x11vnc + + - name: "(ubuntu-x11vnc-1804-amd64.yml) get numeric id for group 'gdm'" + shell: echo "$(id -u gdm)" + register: grp_id_gdm + + - name: Check if file '/etc/gdm3/custom.conf' exists + stat: + path: /etc/gdm3/custom.conf + register: etc_gdm_custom_conf_exists + + - name: Adjust file '/etc/gdm3/custom.conf' + lineinfile: + dest: /etc/gdm3/custom.conf + state: present + regexp: '^WaylandEnable' + line: 'WaylandEnable=false' + insertafter: '^#?\s*WaylandEnable' + when: + - etc_gdm_custom_conf_exists.stat.exists - name: "(ubuntu-x11vnc-1804-amd64.yml) Store password" raw: "x11vnc -storepasswd {{ vnc_password }} /etc/x11vnc.pass" @@ -30,7 +49,7 @@ - name: "(ubuntu-x11vnc-1804-amd64.yml) Transfer x11vnc.service.j2 to /lib/systemd/system/x11vnc.service" template: - src: lib/systemd/system/x11vnc.service.j2 + src: lib/systemd/system/x11vnc-gdm3.service.j2 dest: /lib/systemd/system/x11vnc.service - name: "(ubuntu-x11vnc-1804-amd64.yml) Enable service" diff --git a/roles/common/tasks/ubuntu-x11vnc-2004-amd64.yml b/roles/common/tasks/ubuntu-x11vnc-2004-amd64.yml index 566cb24..5d67afe 100644 --- a/roles/common/tasks/ubuntu-x11vnc-2004-amd64.yml +++ b/roles/common/tasks/ubuntu-x11vnc-2004-amd64.yml @@ -27,6 +27,22 @@ - name: "(ubuntu-x11vnc-2004-amd64.yml) Store password" raw: "x11vnc -storepasswd {{ vnc_password }} /etc/x11vnc.pass" + - name: Check if file '/etc/gdm3/custom.conf' exists + stat: + path: /etc/gdm3/custom.conf + register: etc_gdm_custom_conf_exists + + - name: Adjust file '/etc/gdm3/custom.conf' + lineinfile: + dest: /etc/gdm3/custom.conf + state: present + regexp: '^WaylandEnable' + line: 'WaylandEnable=false' + insertafter: '^#?\s*WaylandEnable' + when: + - etc_gdm_custom_conf_exists.stat.exists + + - name: "(ubuntu-x11vnc-2004-amd64.yml) Set permissions on /etc/x11vnc.pass" file: path: "/etc/x11vnc.pass"