From 5efd5d98f4c0afa2b20d1f86397d87c7c081677a Mon Sep 17 00:00:00 2001 From: mpelle426 Date: Wed, 10 Jul 2019 21:50:23 +0100 Subject: [PATCH] -more tweaks to gui autologin --- roles/pi/files/autologin.conf | 3 +++ roles/pi/tasks/main.yaml | 18 ++++++++++-------- temp.yaml | 13 +++++++++---- 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 roles/pi/files/autologin.conf diff --git a/roles/pi/files/autologin.conf b/roles/pi/files/autologin.conf new file mode 100644 index 0000000..951657a --- /dev/null +++ b/roles/pi/files/autologin.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin pi --noclear %I \$TERM diff --git a/roles/pi/tasks/main.yaml b/roles/pi/tasks/main.yaml index a0759b9..d360e05 100644 --- a/roles/pi/tasks/main.yaml +++ b/roles/pi/tasks/main.yaml @@ -34,16 +34,18 @@ state: link - name: autologin systemd become: true - blockinfile: - path: /etc/systemd/system/getty@tty1.service.d/autologin.conf - create: yes - block: | - [Service] - ExecStart= - ExecStart=-/sbin/agetty --autologin pi --noclear %I \$TERM + copy: + src: "{{ role_path }}/files/autologin.conf" + dest: "/etc/systemd/system/getty@tty1.service.d/autologin.conf" + owner: root + group: root - name: autologin replacement become: true - command: '/bin/sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=pi/"' + # command: '/bin/sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=pi/"' + lineinfile: + path: /etc/lightdm/lightdm.conf + regexp: '^#autologin-user=' + line: 'autologin-user=pi' - name: force systemd reload become: true systemd: diff --git a/temp.yaml b/temp.yaml index de480af..a6c2773 100644 --- a/temp.yaml +++ b/temp.yaml @@ -1,4 +1,9 @@ ---- -- hosts: pi - roles: - - pi +--- +- hosts: all + name: install programs and libraries + become: true + apt: + name: [ 'expect', 'ftp', 'cadaver', 'iperf', 'iperf3', 'libpcap0.8', 'libsctp1', 'libsctp-dev', 'libncurses-dev', 'libssl-dev', 'libpcap-dev', 'vim', 'mc', 'smbclient', 'ncurses-dev', 'build-essential', 'openvpn', 'lightdm', 'lxde', 'realvnc-vnc-server', 'aptitude', 'chromium-browser', 'raspberrypi-ui-mods' ] + update_cache: true + state: present +