Add 'kiosk' configuration.

This commit is contained in:
Andreas B. Mundt 2018-05-31 18:24:15 +03:00
parent 546dabd7aa
commit d203da49c2
9 changed files with 246 additions and 0 deletions

View file

@ -0,0 +1,30 @@
- name: run update-grub
command: update-grub
listen: update grub
- name: reload NetworkManager
when: not run_in_installer|default(false)|bool
systemd:
daemon_reload: yes
name: NetworkManager
state: reloaded
enabled: yes
listen: reload NetworkManager
# fails in installer with stretch, workaround below:
#- name: enable tmp.mount
# systemd:
# daemon_reload: yes
# name: tmp.mount
# enabled: yes
- name: make sure local-fs.target.wants exists
file: path=/etc/systemd/system/local-fs.target.wants/ state=directory
listen: enable tmp.mount
- name: enable tmp.mount
file:
src: /etc/systemd/system/tmp.mount
dest: /etc/systemd/system/local-fs.target.wants/tmp.mount
state: link
listen: enable tmp.mount

View file

@ -0,0 +1,83 @@
- name: check if gdm3 is installed
stat: path=/etc/gdm3/daemon.conf
register: gdm3
- name: enable auto login
when: gdm3.stat.exists == true
lineinfile:
dest: /etc/gdm3/daemon.conf
insertafter: '^#\s*AutomaticLoginEnable = true'
line: 'AutomaticLoginEnable = true'
- name: auto login user
when: gdm3.stat.exists == true
lineinfile:
dest: /etc/gdm3/daemon.conf
insertafter: '^#\s*AutomaticLogin = '
line: 'AutomaticLogin = {{ auto_user }}'
- name: graphics quirk
when: ansible_product_name == "HP 500"
lineinfile:
dest: /etc/default/grub
regexp: '^(GRUB_CMDLINE_LINUX_DEFAULT=).*'
line: '\1"video=SVIDEO-1:d"'
backrefs: yes
notify: update grub
- name: grub timeout
lineinfile:
dest: /etc/default/grub
regexp: '^(GRUB_TIMEOUT=).*'
line: '\g<1>1'
backrefs: yes
notify: update grub
- name: keyboard compose key
lineinfile:
dest: /etc/default/keyboard
regexp: '^(XKBOPTIONS=).*'
line: '\1"compose:caps"'
backrefs: yes
- name: hibernate when lid is closed
lineinfile:
dest: /etc/systemd/logind.conf
insertafter: '^#\s*HandleLidSwitch='
line: 'HandleLidSwitch=hibernate'
- name: tmp on tmpfs
shell: cp /usr/share/systemd/tmp.mount /etc/systemd/system/
args:
creates: /etc/systemd/system/tmp.mount
notify: enable tmp.mount
- name: mount tmpfs on /home/{{ auto_user }}
mount:
name: /home/{{ auto_user }}
src: tmpfs
fstype: tmpfs
opts: uid=1001,gid=1001,mode=755,size=4G
state: mounted
- name: add autologin user
user:
name: "{{ auto_user }}"
comment: "Autologin Debian User,,,"
shell: /bin/bash
createhome: no
password: '*'
- name: check if NetworkManager is installed
stat: path=/etc/NetworkManager/system-connections
register: NetworkManager
- name: add wifi config
when: NetworkManager.stat.exists == true
template:
src: wifi.j2
dest: /etc/NetworkManager/system-connections/{{ wifi_ssid }}
owner: root
group: root
mode: '0600'
notify: reload NetworkManager

View file

@ -0,0 +1,18 @@
[connection]
id={{ wifi_ssid }}
uuid=a9064ab4-e5fc-49d7-bb6d-8a6073c0e757
type=wifi
[wifi]
ssid={{ wifi_ssid }}
security=802-11-wireless-security
[wifi-security]
key-mgmt=wpa-psk
psk={{ wifi_passwd }}
[ipv4]
method=auto
[ipv6]
method=auto