diff --git a/defaults/main.yml b/defaults/main.yml index 86725e6..649b3a0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,7 +24,7 @@ grafana_kiosk: ignore_certificate_errors: false enable_systemd: true display: DISPLAY=:0 - + lightdm_autologin: false # perform basic versionscheck? submodules_versioncheck: false diff --git a/tasks/lightdm.yml b/tasks/lightdm.yml new file mode 100644 index 0000000..9055c6a --- /dev/null +++ b/tasks/lightdm.yml @@ -0,0 +1,16 @@ +--- +- name: set autologin user to '{{ grafana_kiosk.user }}' + become: true + lineinfile: + path: /etc/lightdm/lightdm.conf + regexp: '^autologin-user=' + insertafter: '^#autologin-user=' + line: "autologin-user={{ grafana_kiosk.user }}" + +- name: set autologin user timeout to 0 + become: true + lineinfile: + path: /etc/lightdm/lightdm.conf + regexp: '^autologin-user-timeout=' + insertafter: '^#autologin-user-timeout=' + line: "autologin-user-timeout=0" diff --git a/tasks/main.yml b/tasks/main.yml index e1f8839..bc745f8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,7 +4,7 @@ grafana_kiosk: "{{ _grafana_kiosk|combine(grafana_kiosk, recursive=True) }}" - include_tasks: versioncheck.yml - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool - include_tasks: packages.yml when: grafana_kiosk.install_requirements | bool @@ -12,3 +12,6 @@ - include_tasks: install.yml - include_tasks: config.yml + +- include_tasks: lightdm.yml + when: grafana_kiosk.lightdm_autologin | bool diff --git a/vars/main.yml b/vars/main.yml index b177cfe..5e06865 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -23,6 +23,7 @@ _grafana_kiosk: ignore_certificate_errors: false enable_systemd: true display: DISPLAY=:0 + lightdm_autologin: false _dl_matrix: 'x86_64': "grafana-kiosk.linux.amd64" @@ -31,5 +32,5 @@ _dl_matrix: 'armv6l': "grafana-kiosk.linux.armv6" 'armv5l': "grafana-kiosk.linux.armv5" -playbook_version_number: 11 # should be an integer +playbook_version_number: 12 # should be an integer playbook_version_path: 'role-grafana-kiosk_roles-ansible_github.com.version' # unique string