Add dib element to build an image with murano-agent
blueprint use-dib-to-build-images Change-Id: I8738a621af4203c1a20eeeed2dcb1fa52df76252
This commit is contained in:
parent
840ef721ac
commit
7358c5471d
19
README.rst
19
README.rst
|
@ -30,6 +30,25 @@ Additional resources are linked from the project wiki page:
|
|||
|
||||
https://wiki.openstack.org/wiki/Murano
|
||||
|
||||
|
||||
Image building using dib
|
||||
------------------------
|
||||
|
||||
contrib/elements contains `diskimage-builder <https://github.com/openstack/diskimage-builder>`_
|
||||
elements to build an image which contains the Murano Agent required to use Murano.
|
||||
|
||||
An example ubuntu based image containing the agent can be built and uploaded to glance
|
||||
with the following commands:
|
||||
|
||||
::
|
||||
|
||||
git clone https://git.openstack.org/openstack/diskimage-builder.git
|
||||
git clone https://git.openstack.org/stackforge/murano-agent.git
|
||||
export ELEMENTS_PATH=murano-agent/contrib/elements
|
||||
diskimage-builder/bin/disk-image-create vm ubuntu murano-agent -o ubuntu-murano-agent.qcow2
|
||||
glance image-create --disk-format qcow2 --container-format bare --name ubuntu-murano < ubuntu-murano.qcow2
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
install-packages git wget make gcc python-pip python-iso8601 python-six python-anyjson python-eventlet python-dev python-setuptools
|
||||
|
||||
mkdir -p /opt/git
|
||||
git clone https://github.com/stackforge/murano-agent.git /opt/git/murano-agent
|
||||
cd /opt/git/murano-agent
|
||||
|
||||
if [ "$DISTRO_NAME" = 'debian' ] || [ "$DISTRO_NAME" = 'ubuntu' ]; then
|
||||
./setup.sh install
|
||||
else
|
||||
# rhel7/centos7/fedora
|
||||
./setup-centos.sh install
|
||||
fi
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
# Until http://pad.lv/1101347 is fixed, we need this user to be able to
|
||||
# Log on to heat booted machines using the given SSH keypair
|
||||
|
||||
set -uex
|
||||
|
||||
# This is a specific workaround for Ubuntu 12.10 "quantal"
|
||||
distro=$(lsb_release -is || :)
|
||||
if [ "$distro" != "Ubuntu" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
codename=$(lsb_release -cs || :)
|
||||
if [ "$codename" != "quantal" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Setup ec2-user as expected by HEAT
|
||||
if ! getent passwd ec2-user ; then
|
||||
useradd -m -G admin ec2-user -s /bin/bash
|
||||
fi
|
||||
if ! [ -e /etc/sudoers.d/ec2-user ] ; then
|
||||
echo "ec2-user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ec2-user
|
||||
chmod 0440 /etc/sudoers.d/ec2-user
|
||||
visudo -c
|
||||
fi
|
||||
|
||||
# We must pin to this fixed cloud-init from the demo ppa to ensure keys
|
||||
# are installed. This can be removed if http://pad.lv/1100920 is ever
|
||||
# fixed in the distro
|
||||
|
||||
add-apt-repository -y ppa:tripleo/demo
|
||||
apt-get update
|
||||
|
||||
cat > /etc/apt/preferences.d/cloud-init-from-ppa <<EOF
|
||||
Package: cloud-init
|
||||
Pin: release o=LP-PPA-tripleo-demo
|
||||
Pin-Priority: 900
|
||||
EOF
|
||||
# Should pull from demo PPA if cloud-init exists there.
|
||||
# Since this is Ubuntu only, the --force-yes is OK
|
||||
install-packages --force-yes cloud-init
|
Loading…
Reference in New Issue