ref: bd31e7c59f1fa7ff92ac8c3c1c2f874ba1fe832b cisco/deploy/lxd/install-arm.yml -rw-r--r-- 2.3 KiB View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
- name: LXD Installation
  hosts: "*pi*"
  environment:
    GOPATH: "/usr/local/src/"
  tasks:
  - name: Install dependencies
    apt:
      name:
        - acl
        - autoconf
        - dnsmasq-base
        - git
        - libacl1-dev
        - libcap-dev
        - liblxc1
        - lxc-dev
        - libtool
        - libuv1-dev
        - make
        - pkg-config
        - rsync
        - squashfs-tools 
        - tar
        - tcl
        - xz-utils
        - ebtables
        - ceph
      state: present

  - name: Get latest golang
    get_url:
      url: https://dl.google.com/go/go1.12.5.linux-armv6l.tar.gz
      dest: /tmp

  - name: Unarchive golang
    unarchive:
      src: /tmp/go1.12.5.linux-armv6l.tar.gz
      dest: /usr/local
      remote_src: yes

  - name: Create symbolic link
    file:
      src: /usr/local/go/bin/go
      dest: /usr/bin/go
      state: link

  - name: Cleanup previous installs
    file:
      path: "{{ item }}"
      state: absent
    with_items:
      - /usr/local/src/src
      - /usr/local/src/deps

  - name: Get LXD
    shell: go get -d -v github.com/lxc/lxd/lxd

  - name: Get dependencies of LXD
    shell: make deps
    args:
      chdir: /usr/local/src/src/github.com/lxc/lxd

  - name: Make LXD
    shell: git pull && make
    args:
      chdir: /usr/local/src/src/github.com/lxc/lxd
    environment:
      CGO_CFLAGS: "-I/usr/local/src/deps/sqlite/ -I/usr/local/src/deps/dqlite/include/ -I/usr/local/src/deps/raft/include/ -I/usr/local/src/deps/libco/"
      CGO_LDFLAGS: "-L/usr/local/src/deps/sqlite/.libs/ -L/usr/local/src/deps/dqlite/.libs/ -L/usr/local/src/deps/raft/.libs -L/usr/local/src/deps/libco/"
      LD_LIBRARY_PATH: "/usr/local/src/deps/sqlite/.libs/:/usr/local/src/deps/dqlite/.libs/:/usr/local/src/deps/raft/.libs:/usr/local/src/deps/libco/"

  - name: Get artifacts
    fetch:
      src: "{{ item.src }}"
      dest: "arm/{{ item.dest }}"
      flat: yes
    with_items:
      - src: /usr/local/src/bin/lxd
        dest: lxd
      - src: /usr/local/src/bin/lxc
        dest: lxc
      - src: /usr/local/src/deps/libco/libco.so.0.1.0
        dest: libco.so.0.1.0
      - src: /usr/local/src/deps/raft/.libs/libraft.so
        dest: libraft.so
      - src: /usr/local/src/deps/dqlite/.libs/libdqlite.so
        dest: libdqlite.so
      - src: /usr/local/src/deps/sqlite/.libs/libsqlite3.so
        dest: libsqlite3.so