Elements to build the Akanda appliance with diskimage-builder
This commit is contained in:
parent
af0f90495e
commit
5d0dafde81
1
README.md
Normal file
1
README.md
Normal file
@ -0,0 +1 @@
|
||||
This repo contains various methods to build an Akanda appliance.
|
10
diskimage-builder/README.md
Normal file
10
diskimage-builder/README.md
Normal 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
|
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.
|
4
diskimage-builder/elements/akanda/element-deps
Normal file
4
diskimage-builder/elements/akanda/element-deps
Normal file
@ -0,0 +1,4 @@
|
||||
install-static
|
||||
cloud-init-nocloud
|
||||
source-repositories
|
||||
ansible
|
@ -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/markmcclain/akanda-appliance.git ansible
|
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
|
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…
Reference in New Issue
Block a user