aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-09-10 10:32:17 +0000
committerGerrit Code Review <review@openstack.org>2018-09-10 10:32:17 +0000
commitbbab10815ceb23993aa29a1743bfe2b3cbd87f6e (patch)
tree60808e277e64e1704d8de848efa5e8c3969bfc4d
parent451d0fc023c9a167364cfa15cead808f74d9ac67 (diff)
parente1b37f5444bae2400490917b697a18b03c90cace (diff)
downloadkolla-bbab10815ceb23993aa29a1743bfe2b3cbd87f6e.tar.gz
kolla-bbab10815ceb23993aa29a1743bfe2b3cbd87f6e.zip
Merge "Add a tripleoclient container"
-rw-r--r--docker/tripleoclient/Dockerfile.j240
-rw-r--r--docker/tripleoclient/create_super_user.sh18
-rwxr-xr-xkolla/common/config.py4
-rwxr-xr-xkolla/image/build.py6
-rw-r--r--releasenotes/notes/add-tripleoclient-image-0341fb72fe27ba14.yaml5
5 files changed, 73 insertions, 0 deletions
diff --git a/docker/tripleoclient/Dockerfile.j2 b/docker/tripleoclient/Dockerfile.j2
new file mode 100644
index 000000000..37d8defc7
--- /dev/null
+++ b/docker/tripleoclient/Dockerfile.j2
@@ -0,0 +1,40 @@
+FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
+LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
+
+{% block tripleoclient_header %}{% endblock %}
+
+{% import "macros.j2" as macros with context %}
+
+{% if install_type == 'binary' %}
+ {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
+
+ {% set tripleoclient_packages = [
+ 'python-ipaddr',
+ 'python-openstackclient',
+ 'python-tripleoclient',
+ 'puppet-tripleo',
+ 'openstack-tripleo-validations',
+ 'e2fsprogs',
+ 'xfsprogs',
+ 'openssh-clients',
+ 'git'
+ ] %}
+
+{{ macros.install_packages(tripleoclient_packages | customizable("packages")) }}
+
+ {% else %}
+RUN echo 'tripleoclient not yet available for {{ base_distro }}' && /bin/false
+ {% endif %}
+
+{% elif install_type == 'source' %}
+
+
+RUN echo 'tripleoclient not yet available for {{ base_distro }} source installs' && /bin/false
+
+{% endif %}
+
+COPY create_super_user.sh /usr/local/bin/create_super_user.sh
+RUN chmod 750 /usr/local/bin/create_super_user.sh
+
+{% block tripleoclient_footer %}{% endblock %}
+{% block footer %}{% endblock %}
diff --git a/docker/tripleoclient/create_super_user.sh b/docker/tripleoclient/create_super_user.sh
new file mode 100644
index 000000000..37c8bf1df
--- /dev/null
+++ b/docker/tripleoclient/create_super_user.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# This is a useful entrypoint/cmd if you wish to run commands in a container
+# in an existing users $HOME directory
+# For example: docker run -ti -e USER=stack -e UID=1000 --privileged=true --volume=/home/stack/:/home/stack/ tripleoclient:latest /usr/local/bin/create_super_user.sh
+
+if [ -n "$USER" -a -n "$UID" ]; then
+ useradd "$USER" -u "$UID" -M
+cat >> /etc/sudoers <<EOF_CAT
+$USER ALL=(ALL) NOPASSWD:ALL
+EOF_CAT
+ su -l $USER
+ export TERM="xterm"
+ alias ls='ls --color=auto'
+ /bin/bash
+else
+ echo "Please set valid $USER and $UID env variables."
+ exit 1
+fi
diff --git a/kolla/common/config.py b/kolla/common/config.py
index ee4fbd268..a6bdbc08b 100755
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -779,6 +779,10 @@ SOURCES = {
'type': 'url',
'location': ('$tarballs_base/tempest/'
'tempest-master.tar.gz')},
+ 'tripleoclient': {
+ 'type': 'url',
+ 'location': ('$tarballs_base/python-tripleoclient/'
+ 'tripleoclient-master.tar.gz')},
'tripleo-ui': {
'type': 'url',
'location': ('$tarballs_base/tripleo-ui/'
diff --git a/kolla/image/build.py b/kolla/image/build.py
index c974be9e8..f58848401 100755
--- a/kolla/image/build.py
+++ b/kolla/image/build.py
@@ -96,6 +96,7 @@ SKIPPED_IMAGES = {
],
'centos+source': [
"ovsdpdk",
+ "tripleoclient",
# TODO(jeffrey4l): remove tripleo-ui when following bug is fixed
# https://bugs.launchpad.net/tripleo/+bug/1744215
"tripleo-ui"
@@ -124,6 +125,7 @@ SKIPPED_IMAGES = {
"searchlight-base",
"solum-base",
"tacker-base",
+ "tripleoclient",
"tripleo-ui",
"vitrage-base",
"vmtp",
@@ -133,6 +135,7 @@ SKIPPED_IMAGES = {
'ubuntu+source': [
# There is no qdrouterd package for ubuntu bionic
"qdrouterd",
+ "tripleoclient",
# TODO(jeffrey4l): remove tripleo-ui when following bug is fixed
# https://bugs.launchpad.net/tripleo/+bug/1744215
"tripleo-ui"
@@ -160,6 +163,7 @@ SKIPPED_IMAGES = {
"sensu-base",
"solum-base",
"tacker-base",
+ "tripleoclient",
"tripleo-ui",
"vitrage-base",
"vmtp",
@@ -168,6 +172,7 @@ SKIPPED_IMAGES = {
],
'debian+source': [
"sensu-base",
+ "tripleoclient",
"tripleo-ui"
],
'oraclelinux+binary': [
@@ -190,6 +195,7 @@ SKIPPED_IMAGES = {
'oraclelinux+source': [
"bifrost-base",
"ovsdpdk",
+ "tripleoclient",
# TODO(jeffrey4l): remove tripleo-ui when following bug is fixed
# https://bugs.launchpad.net/tripleo/+bug/1744215
"tripleo-ui"
diff --git a/releasenotes/notes/add-tripleoclient-image-0341fb72fe27ba14.yaml b/releasenotes/notes/add-tripleoclient-image-0341fb72fe27ba14.yaml
new file mode 100644
index 000000000..5033c4c41
--- /dev/null
+++ b/releasenotes/notes/add-tripleoclient-image-0341fb72fe27ba14.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - Add tripleoclient image. This image can be used interactively for ad-hoc
+ tripleoclient commands or automated to output Ansible playbooks from
+ TripleO Heat Templates for TripleO deployment.