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
|
#cloud-config
#apt_update: false
#apt_upgrade: true
packages: [ bzr, pastebinit, ubuntu-dev-tools, ccache, bzr-builddeb, vim-nox, git-core, lftp ]
#apt_sources:
# - source: ppa:smoser/ppa
#disable_root: False
# mounts:
# - [ ephemeral0, /mnt ]
# - [ swap, none, swap, sw, 0, 0 ]
ssh_import_id: [smoser ]
#!/bin/sh
output: {all: '| tee -a /var/log/cloud-init-output.log'}
sm_misc:
- &user_setup |
set -x; exec > ~/user_setup.log 2>&1
echo "starting at $(date -R)"
echo "set -o vi" >> ~/.bashrc
cat >> ~/.profile <<"EOF"
export EDITOR=vi
export DEB_BUILD_OPTIONS=parallel=4
export PATH=/usr/lib/ccache:$PATH
EOF
mkdir ~/bin
chmod 755 ~/bin
cat > ~/bin/mdebuild <<"EOF"
#!/bin/sh
exec debuild --prepend-path /usr/lib/ccache "$@"
EOF
chmod 755 ~/bin/*
#byobu-launcher-install
byobu-ctrl-a screen 2>&1 || :
echo "pinging 8.8.8.8"
ping -c 4 8.8.8.8
runcmd:
- [ sudo, -Hu, ubuntu, sh, -c, '[ -e /var/log/cloud-init.log ] || exit 0; grep "cloud-init.*running" /var/log/cloud-init.log > ~/runcmd.log' ]
- [ sudo, -Hu, ubuntu, sh, -c, 'read up sleep < /proc/uptime; echo $(date): runcmd up at $up | tee -a ~/runcmd.log' ]
- [ sudo, -Hu, ubuntu, sh, -c, *user_setup ]
byobu_by_default: user
output: {all: '| tee -a /var/log/cloud-init-output.log'}
|