Ubuntu Pastebin

Paste from smoser at Fri, 5 Aug 2016 18:12:59 +0000

Download as text
 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
name="centos7"
lxc launch images:centos/7/amd64 "$name"

# from inside container
cat > build-it <<"EOF"
#!/bin/sh
# this is needed at least for python-oauthlib
set -e
ssh=false
repo="${1:-https://git.launchpad.net/~smoser/cloud-init}"
branch="${2:-master}"

packages="$packages
  rpm-build
  git
"

# these come from translating the output of read-dependencies
# through the package map in packages/brpm
packages="$packages
  python-oauthlib
  python-argparse 
  python-cheetah 
  python-jinja2 
  python-configobj 
  python-jsonpatch 
  python-oauthlib 
  python-prettytable 
  pyserial 
  PyYAML 
  python-requests 
  python-six 
  python-devel
"

if $openssh; then
   packages="$packages openssh-server"
fi

yum install --assumeyes epel-release
yum install --assumeyes $packages

if $openssh; then
   systemctl enable sshd
   systemctl start sshd
   # lock root logins via password, and un-expire it
   # 117005 is days since 1970, that one is in 2026
   passwd -l root
   sed -i 's,\(root:[^:]*:\)0,\117005,p' /etc/shadow
fi

git clone "$repo" cloud-init
cd cloud-init
git branch -l | grep -q "^$branch$" ||
    git branch "$branch" "origin/$branch"
git checkout "$branch"

./packages/brpm
EOF

lxc file push $name/root/build-it "build-it"
lxc exec "$name" -- chmod 755 /root/build-it
lxc exec "$name" -- /root/build-it 
lxc ecec "$name" -- /root/build-it \
   https://git.launchpad.net/~smoser/cloud-init feature/move-to-git
Download as text