- name: add stretch-backports apt_repository: repo: deb http://deb.debian.org/debian/ stretch-backports main state: present update_cache: yes - name: install extra packages from stable apt: name={{ item }} state=latest with_items: "{{ extra_pkgs }}" - name: install extra packages from backports apt: name={{ item }} state=latest default_release=stretch-backports with_items: "{{ extra_pkgs_bpo }}" - 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