Start switching to declarative package-installs
Make use of the package-installs element to declare in yaml format the packages to be installed at the beginning of a phase. Other than reducing the amont of explicit 'install-packages pkg1 ...' invocations, they can also be installed just once per-phase. Change-Id: I1f1acfb2bd74fed5cf4c0b48bc739f7f75c35d83
This commit is contained in:
parent
c3e937604a
commit
c8cbe25f1b
1
elements/disable-firewall/element-deps
Normal file
1
elements/disable-firewall/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
2
elements/disable-firewall/package-installs.yaml
Normal file
2
elements/disable-firewall/package-installs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
which:
|
||||
phase: post-install.d
|
@ -6,8 +6,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages which
|
||||
|
||||
if which systemctl; then
|
||||
systemctl disable firewalld
|
||||
fi
|
||||
|
@ -1,3 +1,4 @@
|
||||
java
|
||||
package-installs
|
||||
sahara-version
|
||||
ssh
|
||||
|
4
elements/hadoop-cdh/package-installs.yaml
Normal file
4
elements/hadoop-cdh/package-installs.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
curl:
|
||||
phase: post-install.d
|
||||
wget:
|
||||
phase: post-install.d
|
@ -29,7 +29,6 @@ esac
|
||||
|
||||
echo "CDH 4 will be injected into image. Starting the download"
|
||||
|
||||
install-packages wget
|
||||
# Here more versions of CDH could be supported by downloading the right repository package.
|
||||
wget -P $tmp_dir "http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb"
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -1,2 +1,3 @@
|
||||
extjs
|
||||
package-installs
|
||||
ssh
|
||||
|
2
elements/hadoop-cloudera/package-installs.yaml
Normal file
2
elements/hadoop-cloudera/package-installs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
wget:
|
||||
phase: pre-install.d
|
@ -1,5 +1,6 @@
|
||||
disable-firewall
|
||||
disable-selinux
|
||||
java
|
||||
package-installs
|
||||
sahara-version
|
||||
source-repositories
|
||||
|
@ -26,14 +26,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages wget
|
||||
install-packages ntp
|
||||
|
||||
install-packages bind-utils
|
||||
|
||||
#install cloud-inint which is necessary for all images
|
||||
install-packages cloud-init
|
||||
|
||||
# change the cloud-init user to root
|
||||
sed "s/ec2-user/root/" -i /etc/cloud/cloud.cfg
|
||||
sed "s/disable_root: 1/disable_root: 0/" -i /etc/cloud/cloud.cfg
|
||||
|
@ -150,9 +150,6 @@ function installHDP_2_0 {
|
||||
|
||||
# Start of Main HDP Install Element
|
||||
|
||||
# Make sure wget is installed
|
||||
install-packages wget
|
||||
|
||||
# Call version-specific script to install the desired version of HDP
|
||||
if [[ $DIB_HDP_VERSION == "1.3" ]]; then
|
||||
echo "Installing HDP Version $DIB_HDP_VERSION..."
|
||||
|
5
elements/hadoop-hdp/package-installs.yaml
Normal file
5
elements/hadoop-hdp/package-installs.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
wget:
|
||||
ntp:
|
||||
bind-utils:
|
||||
# install cloud-init which is necessary for all images
|
||||
cloud-init:
|
@ -1,3 +1,4 @@
|
||||
extjs
|
||||
java
|
||||
mysql
|
||||
package-installs
|
||||
|
@ -8,8 +8,6 @@ set -o pipefail
|
||||
|
||||
echo "START: installing MapR core repository"
|
||||
|
||||
install-packages curl
|
||||
|
||||
MAPR_REPO_DIR=/opt/mapr-repository/core
|
||||
|
||||
if [ "$DISTRO_NAME" = "ubuntu" ]; then
|
||||
|
2
elements/hadoop-mapr/package-installs.yaml
Normal file
2
elements/hadoop-mapr/package-installs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
curl:
|
||||
wget:
|
@ -1,4 +1,5 @@
|
||||
cache-url
|
||||
java
|
||||
package-installs
|
||||
sahara-version
|
||||
ssh
|
||||
|
4
elements/hadoop/package-installs.yaml
Normal file
4
elements/hadoop/package-installs.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
wget:
|
||||
phase: post-install.d
|
||||
tar:
|
||||
phase: post-install.d
|
@ -13,8 +13,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages wget tar
|
||||
|
||||
function install_hadoop_v1 {
|
||||
case "$DISTRO_NAME" in
|
||||
ubuntu )
|
||||
|
@ -1,3 +1,4 @@
|
||||
cache-url
|
||||
hadoop
|
||||
mysql
|
||||
package-installs
|
||||
|
2
elements/hive/package-installs.yaml
Normal file
2
elements/hive/package-installs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
tar:
|
||||
phase: post-install.d
|
@ -6,8 +6,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages tar
|
||||
|
||||
tmp_dir=/tmp/hive
|
||||
cd $tmp_dir
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
cache-url
|
||||
package-installs
|
||||
sahara-version
|
||||
|
@ -8,8 +8,6 @@ set -o pipefail
|
||||
|
||||
echo "Oozie setup"
|
||||
|
||||
install-packages zip unzip tar
|
||||
|
||||
tmp_dir=/tmp/oozie
|
||||
|
||||
if [[ "$DIB_HADOOP_VERSION" < "2.0.0" ]]; then
|
||||
|
5
elements/oozie/package-installs.yaml
Normal file
5
elements/oozie/package-installs.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
zip:
|
||||
unzip:
|
||||
tar:
|
||||
wget:
|
||||
phase: post-install.d
|
@ -6,8 +6,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages wget
|
||||
|
||||
ln -s /usr/share/java/mysql-connector-java.jar /opt/oozie/libtools/mysql.jar
|
||||
ln -s /usr/share/java/mysql-connector-java.jar /opt/oozie/oozie-server/lib/mysql.jar
|
||||
|
||||
|
1
elements/redhat-lsb/element-deps
Normal file
1
elements/redhat-lsb/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
2
elements/redhat-lsb/package-installs.yaml
Normal file
2
elements/redhat-lsb/package-installs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
redhat-lsb:
|
||||
phase: pre-install.d
|
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
||||
set -x
|
||||
fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages redhat-lsb
|
1
elements/root-passwd/element-deps
Normal file
1
elements/root-passwd/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
6
elements/root-passwd/package-installs.yaml
Normal file
6
elements/root-passwd/package-installs.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
augeas-tools:
|
||||
phase: post-install.d
|
||||
openssh-server:
|
||||
phase: post-install.d
|
||||
openssh-client:
|
||||
phase: post-install.d
|
@ -11,7 +11,6 @@ if [ -z "$DIB_PASSWORD" ]; then
|
||||
exit 1
|
||||
fi
|
||||
sed -i "s/disable_root: true/disable_root: false/" /etc/cloud/cloud.cfg
|
||||
install-packages augeas-tools openssh-server openssh-client
|
||||
augtool -s set /files/etc/ssh/sshd_config/PasswordAuthentication yes
|
||||
augtool -s set /files/etc/ssh/sshd_config/PermitRootLogin yes
|
||||
augtool -s set /files/etc/ssh/ssh_config/PasswordAuthentication yes
|
||||
|
@ -1,2 +1,3 @@
|
||||
cache-url
|
||||
hadoop-cdh
|
||||
package-installs
|
||||
|
@ -8,8 +8,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages tar
|
||||
|
||||
tmp_dir=/tmp/spark
|
||||
pushd $tmp_dir
|
||||
|
||||
|
1
elements/spark/package-installs.yaml
Normal file
1
elements/spark/package-installs.yaml
Normal file
@ -0,0 +1 @@
|
||||
tar:
|
1
elements/ssh/element-deps
Normal file
1
elements/ssh/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
@ -7,12 +7,6 @@ set -u
|
||||
set -o pipefail
|
||||
echo "Begin: install and configure SSH"
|
||||
|
||||
# /etc/ssh/sshd_config is provided by openssh-server
|
||||
# /etc/ssh/ssh_config is provided by openssh-client
|
||||
# Note: You need diskimage-builder w/ SHA 82eacdec (11 July 2013) for
|
||||
# this install to work on Fedora - https://review.openstack.org/#/c/36739/
|
||||
install-packages augeas-tools openssh-server openssh-client
|
||||
|
||||
augtool -s set /files/etc/ssh/sshd_config/GSSAPIAuthentication no
|
||||
augtool -s set /files/etc/ssh/sshd_config/UseDNS no
|
||||
augtool -s set /files/etc/ssh/sshd_config/PermitTunnel yes
|
||||
|
5
elements/ssh/package-installs.yaml
Normal file
5
elements/ssh/package-installs.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
augeas-tools:
|
||||
# /etc/ssh/sshd_config is provided by openssh-server
|
||||
openssh-server:
|
||||
# /etc/ssh/ssh_config is provided by openssh-client
|
||||
openssh-client:
|
@ -1,2 +1,3 @@
|
||||
cache-url
|
||||
package-installs
|
||||
zookeeper
|
||||
|
@ -8,8 +8,6 @@ fi
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
install-packages wget unzip build-essential uuid-dev git libtool autoconf pkg-config tar
|
||||
|
||||
tmp_dir=/tmp/storm
|
||||
|
||||
echo "Creating Storm User"
|
||||
|
8
elements/storm/package-installs.yaml
Normal file
8
elements/storm/package-installs.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
unzip:
|
||||
build-essential:
|
||||
uuid-dev:
|
||||
git:
|
||||
libtool:
|
||||
autoconf:
|
||||
pkg-config:
|
||||
tar:
|
1
elements/swift_hadoop/element-deps
Normal file
1
elements/swift_hadoop/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
2
elements/swift_hadoop/package-installs.yaml
Normal file
2
elements/swift_hadoop/package-installs.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
wget:
|
||||
phase: post-install.d
|
@ -6,8 +6,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages wget
|
||||
|
||||
HDFS_LIB_DIR=${DIB_HDFS_LIB_DIR:-"/usr/share/hadoop/lib"}
|
||||
SWIFT_LIB_URI="http://sahara-files.mirantis.com/hadoop-swift/hadoop-swift-latest.jar"
|
||||
|
||||
|
1
elements/zookeeper/element-deps
Normal file
1
elements/zookeeper/element-deps
Normal file
@ -0,0 +1 @@
|
||||
package-installs
|
@ -8,8 +8,6 @@ fi
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
install-packages wget
|
||||
|
||||
echo "Downloading Zookeeper"
|
||||
|
||||
mkdir -p /opt/zookeeper
|
||||
|
1
elements/zookeeper/package-installs.yaml
Normal file
1
elements/zookeeper/package-installs.yaml
Normal file
@ -0,0 +1 @@
|
||||
wget:
|
Loading…
Reference in New Issue
Block a user