| --- |
| - hosts: all |
| connection: local |
| remote_user: chrome-bot |
| become_user: root |
| become: yes |
| become_method: sudo |
| vars: |
| # override with --extra-vars "nfs_mount_point=/opt/stage" |
| nfs_mount_point: /opt/prod |
| image: /opt/rpi_img/prod.img |
| # 8192 * 512 |
| offset_boot: 4194304 |
| # 131072 * 512 |
| offset_root: 67108864 |
| tasks: |
| - file: path={{nfs_mount_point}}/root state=directory |
| |
| - mount: src="{{image}}" name="{{nfs_mount_point}}/root" fstype="auto" opts="loop,offset={{offset_root}},noauto" state="mounted" |
| |
| - command: cp /usr/bin/qemu-arm-static {{nfs_mount_point}}/root/usr/bin/ |
| # These do NOT use the mount: command, as it does not currently support --rbind. |
| # Additionally, I don't necessarily want to update fstab |
| - command: mount --rbind /dev {{nfs_mount_point}}/root/dev |
| - command: mount -t proc none {{nfs_mount_point}}/root/proc |
| - command: mount -o bind /sys {{nfs_mount_point}}/root/sys |
| |
| # Comment out this line in this file so as to avoid |
| # qemu: uncaught target signal 4 (Illegal instruction) - core dumped |
| # Illegal instruction (core dumped) |
| - lineinfile: dest={{nfs_mount_point}}/root/etc/ld.so.preload line="/usr/lib/arm-linux-gnueabihf/libarmmem.so" state=absent |
| - lineinfile: dest={{nfs_mount_point}}/root/etc/ld.so.preload line="#/usr/lib/arm-linux-gnueabihf/libarmmem.so" state=present |
| |
| - name: Create the startup script |
| copy: src=start_swarming dest={{nfs_mount_point}}/root/opt/start_swarming owner=root group=root mode=0755 |
| |
| - name: Create the swarming service |
| copy: src=swarming dest={{nfs_mount_point}}/root/etc/init.d/swarming owner=root group=root mode=0755 |
| |
| handlers: |
| |