lmn-client/roles/kiosk/tasks/main.yml
2019-05-20 18:59:10 +03:00

97 lines
2.5 KiB
YAML

- name: install extra packages from stable
apt: name={{ extra_pkgs }} state=latest
- name: add {{ deb_release }}-backports
apt_repository:
repo: deb http://deb.debian.org/debian/ {{ deb_release }}-backports main
state: present
update_cache: yes
when: extra_pkgs_bpo|length
- name: install extra packages from backports
apt: name={{ extra_pkgs_bpo }} state=latest default_release={{ deb_release }}-backports
when: extra_pkgs_bpo|length
- 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" or ansible_product_name == "HP 550"
lineinfile:
dest: /etc/default/grub
regexp: '^(GRUB_CMDLINE_LINUX=)""'
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