-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathopenstack-common.install
executable file
·145 lines (132 loc) · 4.8 KB
/
openstack-common.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
#
# Copyright (C) 2013-2014 eNovance SAS <licensing@enovance.com>
#
# Author: Emilien Macchi <emilien.macchi@enovance.com>
#
# 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.
#
# What is common to all OpenStack nodes is here.
#
src="$1"
dir="$2"
version="$3"
ROLE=openstack-common
ORIG=$(cd $(dirname $0); pwd)
. ${ORIG}/functions
. ./repositories
case $version in
*-I.*)
OS_VERS=icehosue
;;
*-J.*)
OS_VERS=juno
;;
*)
echo "unsupported version $version" 1>&2
exit 1
;;
esac
install_ib_if_needed $ORIG $dir
prepare_packages () {
case "$OS" in
"Debian")
local repository=$(add_main_repository $DIST)
do_chroot ${dir} wget --no-verbose http://apt.puppetlabs.com/puppetlabs-release-$RELEASE.deb
do_chroot ${dir} dpkg -i puppetlabs-release-$RELEASE.deb
do_chroot ${dir} rm puppetlabs-release-$RELEASE.deb
do_chroot ${dir} apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E52660B15D964F0B
cat > ${dir}/etc/apt/sources.list.d/$RELEASE-backport.list <<EOF
deb $repository ${RELEASE}-backports main
EOF
get_openstack_repository $DIST $dir $OS_VERS > ${dir}/etc/apt/sources.list.d/openstack-$RELEASE-$OS_VERS.list
update_repositories $dir
install_packages $dir ntpstat
hiera_dir=usr/lib/ruby/vendor_ruby/hiera
;;&
"Ubuntu")
do_chroot ${dir} wget --no-verbose http://apt.puppetlabs.com/puppetlabs-release-$RELEASE.deb
do_chroot ${dir} dpkg -i puppetlabs-release-$RELEASE.deb
do_chroot ${dir} rm puppetlabs-release-$RELEASE.deb
do_chroot ${dir} apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E52660B15D964F0B
get_openstack_repository $DIST $dir $OS_VERS > ${dir}/etc/apt/sources.list.d/openstack.list
hiera_dir=usr/lib/ruby/vendor_ruby/hiera
softprop=python-software-properties
;;&
"Debian" | "Ubuntu")
update_repositories $dir
packages="$softprop augeas-tools iptables build-essential puppetdb-terminus"
install_packages_disabled $dir puppet
install_packages $dir "$packages"
do_chroot ${dir} sed -e 's/START=yes/START=no/' -i /etc/default/puppet
do_chroot ${dir} sed -e '/templatedir/d' -i /etc/puppet/puppet.conf
;;
"CentOS")
add_puppet_repository $DIST
install_packages_disabled $dir puppet
install_packages $dir puppetdb-terminus
remove_puppet_repository $DIST
hiera_dir=usr/share/ruby/vendor_ruby/hiera
;;
"RedHatEnterpriseServer")
# Redhat is using a channel to get openstack
add_puppet_repository $DIST
if [ $CODENAME_MAJOR = 6 ]; then
add_rhn_channel rhel-x86_64-server-6-ost-beta
else
# Attach to the pool "Red Hat Enterprise Linux OpenStack Platform (Physical)"
attach_pool_rh_cdn $dir $RHN_CDN_POOL_ID
add_rh_cdn_repo $dir rhel-7-server-openstack-6.0-rpms
add_rh_cdn_repo $dir rhel-7-server-rpms
# for augeas
add_rh_cdn_repo $dir rhel-7-server-optional-rpms
fi
install_packages_disabled $dir puppet
install_packages $dir facter hiera augeas yum-plugin-priorities puppetdb-terminus
remove_puppet_repository $DIST
hiera_dir=usr/share/ruby/vendor_ruby/hiera
;;
*)
fatal_error "OS ($OS) or Release ($RELEASE) not supported"
;;
esac
do_chroot ${dir} sed -e 's/ - puppet/#- puppet/g' -i /etc/cloud/cloud.cfg
# (Spredzy) Specific patch
cd ${dir}/$hiera_dir
patch -p0 < $SRC/files/backend.rb.patch
cd -
}
install_logging() {
add_fluentd_repo
add_epel_repository $DIST
update_repositories $dir
declare -A logging_packages
logging_packages=(
["deb"]="
td-agent \
rsyslog-gnutls \
rsyslog-relp
"
["rpm"]="
td-agent \
rsyslog-gnutls \
rsyslog-relp
")
install_packages_disabled $dir ${logging_packages[$(package_type)]}
remove_fluentd_repo
remove_epel_repository $DIST
}
prepare_packages
install_logging
# TODO (spredzy) : https://bugzilla.redhat.com/show_bug.cgi?id=1159894
# install_monitoring