Check in diskimage-builder elements
This checks in diskimage-builder elements from the akanda-appliance-builder repository, which we'll be merging with this one. Co-Authored-By: David Lenwell <dlenwell@gmail.com> Co-Authored-By: Mark McClain <mark@mcclain.xyz> Change-Id: Ic53dec0ff675be1e38babc893820f27561cfd774 Partial-Bug: #1464359
This commit is contained in:
parent
a73e8da993
commit
2d892d54e4
22
diskimage-builder/README.md
Normal file
22
diskimage-builder/README.md
Normal file
@ -0,0 +1,22 @@
|
||||
This directory contains elements necessary to build the Akanda appliance with
|
||||
the diskimage-builder from the OpenStack project.
|
||||
|
||||
1) Install diskimage-builder via:
|
||||
|
||||
pip install diskimage-builder
|
||||
or source at:
|
||||
http://git.openstack.org/cgit/openstack/diskimage-builder
|
||||
|
||||
2) Ensure a few require packages are installed:
|
||||
- debootstrap
|
||||
- qemu-utils
|
||||
|
||||
3) Add elements to path
|
||||
$ export ELEMENTS_PATH=~/akanda-appliance-builder/diskimage-builder/elements
|
||||
|
||||
4) Build image
|
||||
$ DIB_RELEASE=wheezy DIB_EXTLINUX=1 disk-image-create debian vm akanda
|
||||
|
||||
5) If you're testing with kvm, don't forget to build the nocloud iso image
|
||||
|
||||
|
3
diskimage-builder/elements/akanda/README.rst
Normal file
3
diskimage-builder/elements/akanda/README.rst
Normal file
@ -0,0 +1,3 @@
|
||||
This is the base element for building an Akanda appliance image.
|
||||
|
||||
Ansible is required on the local system.
|
3
diskimage-builder/elements/akanda/element-deps
Normal file
3
diskimage-builder/elements/akanda/element-deps
Normal file
@ -0,0 +1,3 @@
|
||||
cloud-init-datasources
|
||||
source-repositories
|
||||
ansible
|
1
diskimage-builder/elements/akanda/environment.d/10-cloudinit-akanda
Executable file
1
diskimage-builder/elements/akanda/environment.d/10-cloudinit-akanda
Executable file
@ -0,0 +1 @@
|
||||
export DIB_CLOUD_INIT_DATASOURCES="ConfigDrive, NoCloud"
|
@ -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
|
5
diskimage-builder/elements/akanda/post-install.d/90-fix-locale
Executable file
5
diskimage-builder/elements/akanda/post-install.d/90-fix-locale
Executable 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
|
@ -0,0 +1 @@
|
||||
akanda git /tmp/akanda-appliance https://github.com/stackforge/akanda-appliance.git
|
11
diskimage-builder/elements/ansible/README.md
Normal file
11
diskimage-builder/elements/ansible/README.md
Normal 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/
|
5
diskimage-builder/elements/ansible/cleanup.d/50-remove-source-ansible
Executable file
5
diskimage-builder/elements/ansible/cleanup.d/50-remove-source-ansible
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
sudo rm -fr "${TMP_MOUNT_PATH}/opt/stack/tripleo-ansible"
|
1
diskimage-builder/elements/ansible/element-deps
Normal file
1
diskimage-builder/elements/ansible/element-deps
Normal file
@ -0,0 +1 @@
|
||||
pip-and-virtualenv
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -ue
|
||||
|
||||
export ANSIBLE_VENV_DIR=${ANSIBLE_VENV_DIR:-"/opt/stack/venvs/ansible"}
|
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
install-packages ansible
|
@ -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
|
10
diskimage-builder/elements/debug-user/README.md
Normal file
10
diskimage-builder/elements/debug-user/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
Creates a sudo privileged user in the appliance VM that can be used for
|
||||
debugging connectivity issues via the console, when SSH connectivity is
|
||||
not possible. Note that an 'akanda' user is created by the RUG and setup
|
||||
to authenticate using a SSH public key. This element should only be included
|
||||
when building images for develoment environments.
|
||||
|
||||
The username and password can be set in the build environment as
|
||||
$DIB_AKANDA_APPLIANCE_DEBUG_USER and $DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD
|
||||
The defaults are akanda-debug/akanda.
|
21
diskimage-builder/elements/debug-user/install.d/50-debug-user
Executable file
21
diskimage-builder/elements/debug-user/install.d/50-debug-user
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIB_AKANDA_APPLIANCE_DEBUG_USER=${DIB_AKANDA_APPLIANCE_DEBUG_USER:-akanda-debug}
|
||||
DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD=${DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD:-akanda}
|
||||
|
||||
set -eu
|
||||
set -o xtrace
|
||||
|
||||
useradd -m $DIB_AKANDA_APPLIANCE_DEBUG_USER -s /bin/bash
|
||||
|
||||
passwd $DIB_AKANDA_APPLIANCE_DEBUG_USER <<EOF
|
||||
$DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD
|
||||
$DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD
|
||||
EOF
|
||||
|
||||
cat > /etc/sudoers.d/akanda-debug-user <<eof
|
||||
$DIB_AKANDA_APPLIANCE_DEBUG_USER ALL=(ALL) NOPASSWD:ALL
|
||||
eof
|
||||
|
||||
chmod 0440 /etc/sudoers.d/akanda-debug-user
|
||||
visudo -c
|
3
diskimage-builder/elements/nginx-plus/README.rst
Normal file
3
diskimage-builder/elements/nginx-plus/README.rst
Normal file
@ -0,0 +1,3 @@
|
||||
Before using this element copy your nginx-repo.key and nginx-repo.crt into ./bin
|
||||
|
||||
|
2
diskimage-builder/elements/nginx-plus/element-deps
Normal file
2
diskimage-builder/elements/nginx-plus/element-deps
Normal file
@ -0,0 +1,2 @@
|
||||
cloud-init-datasources
|
||||
source-repositories
|
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# this is an install script for nginx plus
|
||||
|
||||
# make nginx ssl dir
|
||||
mkdir /etc/ssl/nginx
|
||||
cp $(dirname $0)/../bin/* /etc/ssl/nginx/
|
||||
|
||||
wget https://cs.nginx.com/static/files/CA.crt -P /etc/ssl/nginx/
|
||||
wget http://nginx.org/keys/nginx_signing.key -P /etc/ssl/nginx/
|
||||
|
||||
apt-key add nginx_signing.key
|
||||
|
||||
printf "deb https://plus-pkgs.nginx.com/debian `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
|
||||
|
||||
wget https://cs.nginx.com/static/files/90nginx -P /etc/apt/apt.conf.d
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install nginx-plus -y
|
2
diskimage-builder/elements/nginx/README.rst
Normal file
2
diskimage-builder/elements/nginx/README.rst
Normal file
@ -0,0 +1,2 @@
|
||||
This element installs the open source nginx package.
|
||||
|
1
diskimage-builder/elements/nginx/element-deps
Normal file
1
diskimage-builder/elements/nginx/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
@ -0,0 +1 @@
|
||||
nginx
|
21
diskimage-builder/elements/pip-and-virtualenv/README.md
Normal file
21
diskimage-builder/elements/pip-and-virtualenv/README.md
Normal 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/
|
||||
|
@ -0,0 +1,2 @@
|
||||
package-installs
|
||||
source-repositories
|
@ -0,0 +1,2 @@
|
||||
python-pip
|
||||
python-virtualenv
|
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
python /tmp/get-pip.py
|
||||
pip install virtualenv
|
@ -0,0 +1 @@
|
||||
get-pip-py file /tmp/get-pip.py https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py
|
Loading…
x
Reference in New Issue
Block a user