This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplaybook.yml
106 lines (85 loc) · 3.88 KB
/
playbook.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
- hosts: all
remote_user: vagrant
vars:
ctng_dir: "/home/vagrant/crosstool-ng" # ctng download,install dir
ctng_staging_dir: "/home/vagrant/staging" # ctng toolchain staging folder
toolchain_dir: "/home/vagrant/x-tools6h" # DONT CHANGE, toolchain folder
# feel free to substitute newer (or entirely different) versions
ctng_version: "linaro-1.13.1-4.9-2014.08"
ctng_url: "https://releases.linaro.org/latest/components/toolchain/binaries/crosstool-ng-{{ ctng_version }}.tar.bz2"
# crosstool-NG config files for building the tc
ctng_config: "/vagrant/ctng-configs/linaro-arm-linux-gnueabihf-raspbian.201408.modified.config"
# whether for convenience or stability, here some prebuilt tcs
prebuilt_xt: "/vagrant/prebuilt-toolchains/linaro-arm-linux-gnueabihf-raspbian.201408.modified.tar.xz"
# if not already present, download from this url
prebuilt_xt_url: "https://github.com/tjanson/rpi-cross/releases/download/v0.1/linaro-arm-linux-gnueabihf-raspbian.201408.modified.tar.xz"
# allowed nets for distcc connection (potential security risk!)
distcc_allowednets: "192.168.0.0/16" # wide open
vars_prompt:
- name: "custom_build"
prompt: "Hi!
First off, I recommend you take a look at `provisioning/playbook.yml` before proceeding to get an idea what's going to happen.
If you want to build a custom toolchain using the settings in the playbook, (blindly) type `yes` and hit Enter... You should know what you're getting into; this will take a while.
Otherwise, just hit Enter and the Raspbian Linaro toolchain tarball will be used."
default: no
private: yes
tasks:
- name: fix trusty/Vagrant issue 3860
shell: 'sed --in-place -e "s:post-up route del default dev \\$IFACE$:post-up route del default dev \\$IFACE || true:g" /etc/network/interfaces'
sudo: yes
- name: dist-upgrade system
apt: upgrade=dist update_cache=yes
sudo: yes
- name: install useful (but non-required) tools
apt: name={{ item }}
sudo: yes
with_items:
- tmux
- vim
- htop
- name: install essentials build, VCSs
apt: name={{ item }}
sudo: yes
with_items:
- curl
- wget
- build-essential
- git
- cvs
- subversion
- name: create folders
file: path={{ item }} state=directory owner=vagrant group=vagrant
sudo: yes
with_items:
- "{{ ctng_dir }}"
- "{{ ctng_staging_dir }}"
- "{{ ctng_staging_dir }}/tarballs"
- "{{ toolchain_dir }}"
- "{{ toolchain_dir }}/arm-linux-gnueabihf"
# install crosstool-NG and build toolchain based on specified config file
# this can take ~1h (don't be surprised), and you will unfortunately get
# much feedback in between. just have lunch and see how it goes...
- include: ctng.yml
when: custom_build | bool
# alternatively, and default-ively, download & extract prebuilt tc
- name: download prebuilt toolchain
get_url: dest={{ prebuilt_xt }} url={{ prebuilt_xt_url }}
when: not custom_build | bool
- name: extract prebuilt toolchain
unarchive: copy=no src={{ prebuilt_xt}} dest=/home/vagrant/
when: not custom_build | bool
# intentionally not added to PATH; intended for distccd's path
- name: create tupleless bin directory with links to real tools
shell: "mkdir bin-tupleless;
for file in $(ls bin); do
ln -s ../bin/$file bin-tupleless/${file#arm-linux-gnueabihf-};
done"
args:
chdir: "{{ toolchain_dir }}"
creates: "{{ toolchain_dir }}/bin-tupleless"
- name: prepend toolchain bin dir to PATH
lineinfile: 'dest=/home/vagrant/.bashrc line="export PATH={{ toolchain_dir }}/bin:$PATH"'
# install, configure, enable, and start distcc daemon
- include: distcc.yml
sudo: yes