No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

playbook.yml 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. - hosts: all
  3. remote_user: vagrant
  4. sudo: yes
  5. vars:
  6. offset_boot: 4194304
  7. offset_root: 62914560
  8. tasks:
  9. - apt: upgrade=dist
  10. - command: mkdir -p /opt/raspberrypi creates=/opt/raspberrypi
  11. - apt: name=nfs-kernel-server
  12. - lineinfile: dest=/etc/exports line="/opt/raspberrypi/root 10.0.0.0/24(rw,sync,no_root_squash,no_subtree_check)"
  13. - service: name=nfs-kernel-server state=restarted
  14. - apt: name=build-essential
  15. - apt: name=pkg-config
  16. - apt: name=git
  17. - apt: name=python-pip
  18. - apt: name=unzip
  19. - unarchive: src=tools-master.zip dest=/opt/raspberrypi creates=/opt/raspberrypi/tools-master
  20. - file: path=/opt/raspberrypi/boot state=directory
  21. - file: path=/opt/raspberrypi/root state=directory
  22. - mount: src="/vagrant/image.img" name="/opt/raspberrypi/boot" fstype="auto" opts="loop,offset={{offset_boot}},noauto" state="mounted"
  23. - mount: src="/vagrant/image.img" name="/opt/raspberrypi/root" fstype="auto" opts="loop,offset={{offset_root}},noauto" state="mounted"
  24. # the pi is unbootable unless it is told not to mount the root filesystem from the card!
  25. - lineinfile: dest=/opt/raspberrypi/root/etc/fstab regexp="^\/dev\/mmcblk0p2" state="absent"
  26. - replace: dest=/opt/raspberrypi/boot/cmdline.txt regexp="rootwait$" replace="rootwait ip=10.0.0.101:10.0.0.1:10.0.0.1:255.255.255.0:rpi:eth0:off root=/dev/nfs rootfstype=nfs nfsroot=10.0.0.1:/opt/raspberrypi/root,udp,vers=3 smsc95xx.turbo_mode=N" backup=no
  27. # build helpies
  28. - lineinfile: dest="/home/vagrant/.bashrc" line="export RPI_TOOLS=/opt/raspberrypi/tools-master"
  29. - lineinfile: dest="/home/vagrant/.bashrc" line="export RPI_ROOT=/opt/raspberrypi/root"
  30. - lineinfile: dest="/home/vagrant/.bashrc" line="export PKG_CONFIG_PATH=$RPI_ROOT/usr/lib/arm-linux-gnueabihf/pkgconfig:$RPI_ROOT/usr/share/pkgconfig:$RPI_ROOT/usr/lib/pkgconfig"
  31. - lineinfile: dest="/home/vagrant/.bashrc" line="alias rmake='make RPI_TOOLS=$RPI_TOOLS RPI_ROOT=$RPI_ROOT GST_VERSION=1.0 PLATFORM_OS=Linux PLATFORM_ARCH=armv6l'"
  32. - command: /vagrant/fixQualifiedLibraryPaths.sh /opt/raspberrypi/root /opt/raspberrypi/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++
  33. - apt: name=python-dev
  34. - pip: name=ansible
  35. - apt: name=sshpass
  36. - pip: name=paramiko
  37. - pip: name=PyYAML
  38. - pip: name=jinja2
  39. - pip: name=httplib2
  40. - unarchive: src=of_v0.8.4_linuxarmv6l_release.tar.gz dest=/opt/raspberrypi/root/opt creates=/opt/raspberrypi/root/opt/of_v0.8.4_linuxarmv6l_release
  41. - file: src=of_v0.8.4_linuxarmv6l_release dest=/opt/raspberrypi/root/opt/openframeworks state=link
  42. - file: src=/opt/raspberrypi/root/opt/openframeworks dest=/opt/openframeworks state=link
  43. - command: chown -R vagrant /opt/raspberrypi/root/opt/of_v0.8.4_linuxarmv6l_release
  44. - apt: name=tinyproxy
  45. - lineinfile: dest="/etc/tinyproxy.conf" line="Allow 10.0.0.0/8"
  46. - service: name=tinyproxy state=restarted
  47. handlers: