Elements to build the Akanda appliance with diskimage-builder

This commit is contained in:
Mark McClain 2015-04-02 16:57:31 -04:00
parent af0f90495e
commit 5d0dafde81
18 changed files with 125 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
This repo contains various methods to build an Akanda appliance.

View File

@ -0,0 +1,10 @@
This directory contains elements necessary to build the Akanda appliance with
the diskimage-builder from the OpenStack project.
Install via:
pip install diskimage-builder
or source at:
http://git.openstack.org/cgit/openstack/diskimage-builder

View File

@ -0,0 +1,3 @@
This is the base element for building an Akanda appliance image.
Ansible is required on the local system.

View File

@ -0,0 +1,4 @@
install-static
cloud-init-nocloud
source-repositories
ansible

View File

@ -0,0 +1,9 @@
#!/bin/bash
set -eux
set -o pipefail
APP_SRC_DIR="/tmp/akanda-appliance"
[ -d "${APP_SRC_DIR}" ] || exit 0
ansible-playbook -i "localhost," -c local $APP_SRC_DIR/ansible/main.yml

View File

@ -0,0 +1,5 @@
#!/bin/bash
# ensure the locale is properly setup
sed -i 's/^# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
locale-gen

View File

@ -0,0 +1 @@
akanda git /tmp/akanda-appliance https://github.com/markmcclain/akanda-appliance.git ansible

View File

@ -0,0 +1,11 @@
Install Ansible.
Configuration
-------------
At Present there is no configuration for this element.
NOTICE
------
This element is copied from the OpenStack Tripleo project at
http://git.openstack.org/cgit/openstack/tripleo-image-elements/

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eu
sudo rm -fr "${TMP_MOUNT_PATH}/opt/stack/tripleo-ansible"

View File

@ -0,0 +1 @@
pip-and-virtualenv

View File

@ -0,0 +1,4 @@
#!/bin/bash
set -ue
export ANSIBLE_VENV_DIR=${ANSIBLE_VENV_DIR:-"/opt/stack/venvs/ansible"}

View File

@ -0,0 +1,4 @@
#!/bin/bash
set -eux
install-packages ansible

View File

@ -0,0 +1,35 @@
#!/bin/bash
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
set -eux
set -o pipefail
install-packages build-essential libssl-dev libyaml-dev python-dev libxml2-dev libxslt-dev
virtualenv $ANSIBLE_VENV_DIR
set +u
source $ANSIBLE_VENV_DIR/bin/activate
set -u
$ANSIBLE_VENV_DIR/bin/pip install paramiko PyYAML jinja2 httplib2
$ANSIBLE_VENV_DIR/bin/pip install ansible==1.8.1
ln -s $ANSIBLE_VENV_DIR/bin/ansible /usr/local/bin/ansible
ln -s $ANSIBLE_VENV_DIR/bin/ansible-playbook /usr/local/bin/ansible-playbook

View File

@ -0,0 +1,21 @@
Install latest pip and virtualenv
=================================
We have problems with the latest binary package of pip and virtualenv.
Packaged version of pip can be old and virtualenv can also contain its
own version of pip. Issues include downloading packages from a local
pypi mirror that include a wheel package for pip.
The element follows the instructions from the pip website here:
http://www.pip-installer.org/en/latest/installing.html on how to install
the latest version of pip. That is to download get-pip.py and run this
file.
We use source-repositories element to download the file so it will be
cached and can be overridden to use package if that is required.
NOTICE
------
This element is copied from the OpenStack Tripleo project at
http://git.openstack.org/cgit/openstack/tripleo-image-elements/

View File

@ -0,0 +1,2 @@
package-installs
source-repositories

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -eux
python /tmp/get-pip.py
pip install virtualenv

View File

@ -0,0 +1 @@
get-pip-py file /tmp/get-pip.py https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py