centos tools for cloud-init
What is here right now is just centos-setup.
The goal is to put stuff here to help work with centos on cloud-init.
General info
centos-setup should be run on CentOS 6 or CentOS 7. Its intent is simply
to install packages necessary for testing or building cloud-init.
It takes an argument of one or more sets of packages to install. The test targets utilize packages installed via pip as rpm/yum may not have packages available for test dependencies.
The package sets are:
-
test-distro: Install dependencies need to runnosetestsand use the OS provided system packages (an environment like a distro-installed cloud-init would likely run in). -
test-tox: install all necessary dependencies to runtox. This will test cloud-init using the system python executable but python packages at levels specified intox.ini. -
build: install rpm dependencies needed for./packages/bdrpm -
run: install rpm dependencies needed for cloud-init runtime.
Test
To run tests, assuming you are in a CentOS environment and have
centos-setup.
./centos-setup test-distro # or test-tox
git clone git://git.launchpad.net/cloud-init
cd cloud-init
nosetests tests/unittests
Note you could also use test-tox above and then run tox.
RPM Build
./centos-setup build
git clone git://git.launchpad.net/cloud-init
cd cloud-init
./packages/brpm
Usage via LXD
LXD is not necessary at all, but if you have a 16.04 host and want to easily be able to develop/test cloud-init in CentOS it is useful.
lxd setup
from a fresh 16.04+ instance, setting up lxd is fairly easy enough. mostly just consists of:
$ apt-get update -qy && apt-get --assume-yes -q install lxc2
$ lxd init
<answer some questions... mostly hit enter many times>
Getting centos environment for cloud-init
Then create a centos container, push centos-setup inside and use it as described above.
name=cent6
src=images:centos/6/amd64 # or images:centos/7/amd64
lxc launch $src $name
lxc push centos-setup "$name/root/centos-setup"
lxc exec "$name" /bin/bash
% ./centos-setup test-distro
% git clone ...
raharper commentedApr 26, 2017
with centos7, I need to also install 'rpm-build' and 'python-devel'