I've patched a lxc container with that, and then launched several instances. My experience is that out of 5 containers 2 or 3 of them will have a running postgres at the end (per systemctl status postgresql@9.5-main).
The user-data I'm providing is just:
#cloud-config
packages: [postgresql]
runcmd:
- "systemctl status postgresql@9.5-main > /run/my-status || true"
Then you can just look at /run/my-status.
To start a patched image what you can do is:
n=y1
lxc init ubuntu-daily:yakkety $n "--config=user.user-data=$(cat my.user-data)"
lxc-chroot $n -- sh -ec 'd=/tmp/my.deb; trap "rm -f $d" EXIT; cat > $d && dpkg -i $d' < "$deb"
lxc start $n
I have a branch at https:/ /code.launchpad .net/~smoser/ cloud-init/ +git/cloud- init/+ref/ bug/1576692 which: update- upgrade- install to run in the final_modules
a.) moves cloud-init-final to be Type=idle
b.) moves config modules such as package-
I've patched a lxc container with that, and then launched several instances. My experience is that out of 5 containers 2 or 3 of them will have a running postgres at the end (per systemctl status postgresql@ 9.5-main) .
The user-data I'm providing is just:
#cloud-config
packages: [postgresql]
runcmd:
- "systemctl status postgresql@9.5-main > /run/my-status || true"
Then you can just look at /run/my-status.
To start a patched image what you can do is: daily:yakkety $n "--config= user.user- data=$( cat my.user-data)"
n=y1
lxc init ubuntu-
lxc-chroot $n -- sh -ec 'd=/tmp/my.deb; trap "rm -f $d" EXIT; cat > $d && dpkg -i $d' < "$deb"
lxc start $n