Skip to content
Snippets Groups Projects

raspberrypi playbook

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Nick Erdmann
    Edited
    playbook.yaml 1.11 KiB
    - hosts: 134.130.214.96
      remote_user: root
      tasks:
        - service:
            name: ssh
            enabled: yes
            state: started
        - hostname: name=raspberry
        - authorized_key:
            user: pi
            state: present
            key: "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAiD...."
        - command: passwd -l pi
        - timezone: name=Europe/Berlin
        - lineinfile:
            path: /home/pi/.config/lxkeymap.cfg
            insertafter: '^\[Global\]$'
            regexp: '^layout '
            line: 'layout = de'
        - lineinfile:
            path: /etc/lightdm/lightdm.conf
            regexp: '^#\[Seat:\*\]$'
            line: '[Seat:*]'
        - lineinfile:
            path: /etc/lightdm/lightdm.conf
            insertafter: '^\[Seat:\*\]$'
            line: 'xserver-command=X -s 0 -dpms'
        - lineinfile:
            path: /etc/dhcpcd.conf
            regexp: '^slaac '
            line: 'slaac hwaddr'
        - lineinfile:
            path: /boot/config.txt
            regexp: '^dtoverlay='
            line: 'dtoverlay=pi3-disable-bt'
          #notify: reboot
      roles:
        - role: bennojoy.ntp
          ntp_server: [ntp.rwth-aachen.de]
      handlers:
         - name: reboot
           command: /sbin/reboot
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment