From b403ea358041bc6fedaad6a59746718366e3b8b9 Mon Sep 17 00:00:00 2001 From: jan kaufman Date: Mon, 9 May 2016 13:24:19 +0200 Subject: [PATCH 1/4] add templates plugin --- baseimage/bin/install-foreman | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/baseimage/bin/install-foreman b/baseimage/bin/install-foreman index aeb44c8..c42848a 100755 --- a/baseimage/bin/install-foreman +++ b/baseimage/bin/install-foreman @@ -21,7 +21,8 @@ apt-get install -qqy \ ruby-foreman-docker \ ruby-foreman-hooks \ ruby-puppetdb-foreman \ - python-websocket + python-websocket \ + ruby-foreman-templates bl "installing Passenger..." cd /usr/share/foreman From f02c8eb729a42fd0a8b31e04710de6157da95d6d Mon Sep 17 00:00:00 2001 From: jan kaufman Date: Mon, 9 May 2016 13:23:46 +0200 Subject: [PATCH 2/4] make shellcheck happy --- baseimage/bin/install-foreman | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/baseimage/bin/install-foreman b/baseimage/bin/install-foreman index c42848a..318b5ec 100755 --- a/baseimage/bin/install-foreman +++ b/baseimage/bin/install-foreman @@ -11,10 +11,10 @@ apt-get install -qqy \ apache2-threaded-dev \ libapr1-dev \ libaprutil1-dev \ - foreman-postgresql=${FOREMAN_VERSION}* \ - foreman-compute=${FOREMAN_VERSION}* \ - foreman-libvirt=${FOREMAN_VERSION}* \ - foreman-cli=${FOREMAN_VERSION}* \ + foreman-postgresql="${FOREMAN_VERSION}*" \ + foreman-compute="${FOREMAN_VERSION}*" \ + foreman-libvirt="${FOREMAN_VERSION}*" \ + foreman-cli="${FOREMAN_VERSION}*" \ ruby-hammer-cli-foreman-discovery \ ruby-foreman-discovery \ ruby-foreman-dhcp-browser \ @@ -33,9 +33,9 @@ bl "compiling Apache's mod_passenger (this may take a while)..." bundle exec passenger-install-apache2-module --auto 2>&1 | tee /etc/apache2/.passenger_install_log.txt b "installing Apache's passenger..." -PASSENGER_MOD=`awk '/^\ +LoadModule/ { print $3 }' /etc/apache2/.passenger_install_log.txt` -PASSENGER_ROOT=`awk '/^\ +PassengerRoot/ { print $2 }' /etc/apache2/.passenger_install_log.txt` -PASSENGER_RUBY=`awk '/^\ +PassengerDefaultRuby/ { print $2 }' /etc/apache2/.passenger_install_log.txt` +PASSENGER_MOD=$(awk '/^\ +LoadModule/ { print $3 }' /etc/apache2/.passenger_install_log.txt) +PASSENGER_ROOT=$(awk '/^\ +PassengerRoot/ { print $2 }' /etc/apache2/.passenger_install_log.txt) +PASSENGER_RUBY=$(awk '/^\ +PassengerDefaultRuby/ { print $2 }' /etc/apache2/.passenger_install_log.txt) echo "# this config is autogenerated by docker build LoadModule passenger_module ${PASSENGER_MOD} From ab4126e388d8c5ff4f2271037975a390c1415fcf Mon Sep 17 00:00:00 2001 From: jan kaufman Date: Mon, 9 May 2016 14:56:03 +0200 Subject: [PATCH 3/4] ensure that we have actual packages lists --- baseimage/bin/install-foreman | 1 + 1 file changed, 1 insertion(+) diff --git a/baseimage/bin/install-foreman b/baseimage/bin/install-foreman index 318b5ec..5060414 100755 --- a/baseimage/bin/install-foreman +++ b/baseimage/bin/install-foreman @@ -5,6 +5,7 @@ source /etc/mother-versions export DEBIAN_FRONTEND=noninteractive bl 'installing Foreman packages...' +apt-get update apt-get install -qqy \ libcurl4-openssl-dev \ apache2-mpm-worker \ From 457a7d94d80d74263f39cdf01a12acbee081af4f Mon Sep 17 00:00:00 2001 From: jan kaufman Date: Mon, 9 May 2016 16:48:20 +0200 Subject: [PATCH 4/4] ssl verify off for git, keyscan for ssh, sync templates --- foreman/prepare.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/foreman/prepare.sh b/foreman/prepare.sh index 68f3245..c4f5669 100755 --- a/foreman/prepare.sh +++ b/foreman/prepare.sh @@ -71,3 +71,10 @@ bl 'done' b "configuring Apache vhost..." etcd-erb < /cfg/apache-vhost.erb > /etc/apache2/sites-available/foreman.conf bl "done" + +b "configuring foreman templates..." +su foreman -s /bin/bash -c "git config --global http.sslVerify false" +su foreman -s /bin/bash -c "ssh-keyscan git.prz > ~/.ssh/known_hosts 2>/dev/null" +foreman-rake templates:sync repo="https://git@git.prz/orchestration/templates.git" > /dev/null +bl "done" +