438a65bf332c8451a3f651b98b11145f03ffab04
[noc.git] / ansible / tuer.yml
1 - hosts: torwaechter
2   connection: local
3   tasks:
4     - name: Create go directories
5       file:
6         path: .cache/openwrt/tuer/{{ item }}
7         state: directory
8       with_items: [ gopath, gocache ]
9
10     - name: Clone necessary git repositories
11       git:
12         repo: https://github.com/realraum/{{ item }}.git
13         dest: .cache/openwrt/tuer/{{ item }}
14         update: True
15       with_items: [ door_and_sensors ]
16
17 #    - name: Build update-keys
18
19     - name: Download dependencies
20       command: go get -d ./...
21       args:
22         chdir: .cache/openwrt/tuer/door_and_sensors/{{ item }}
23       environment:
24         GOCACHE: "{{ playbook_dir }}/.cache/openwrt/tuer/gocache"
25         GOPATH:  "{{ playbook_dir }}/.cache/openwrt/tuer/gopath"
26       with_items: [ door_client, door_daemon ]
27
28     - name: Cross-compile Go binaries
29       command: go build -ldflags "-s"
30       args:
31         chdir: .cache/openwrt/tuer/door_and_sensors/{{ item }}
32       environment:
33         GOCACHE: "{{ playbook_dir }}/.cache/openwrt/tuer/gocache"
34         GOPATH:  "{{ playbook_dir }}/.cache/openwrt/tuer/gopath"
35         GO386: 387
36         CGO_ENABLED: 0
37         GOOS: linux
38         GOARCH: 386
39       with_items: [ door_client, door_daemon ]
40
41 - hosts: torwaechter
42   connection: local
43   roles:
44     - role: openwrt-image
45       delegate_to: localhost
46       vars:
47         openwrt_arch: x86
48         openwrt_target: geode
49         openwrt_packages_remove:
50           - ppp
51           - ppp-mod-pppoe
52           - dnsmasq
53           - firewall
54           - odhcpd
55         openwrt_packages_add:
56           - flashrom
57           - haveged
58           - htop
59           - hwclock
60           - ip
61           - less
62           - nano
63           - tcpdump
64         openwrt_packages_extra:
65           - git