aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-13 14:36:20 +0000
committerGerrit Code Review <review@openstack.org>2016-12-13 14:36:20 +0000
commit1e88f875239b30de24552450b623e6892941fa1e (patch)
tree6a3dad25fd93238fdfcba8b2c6e32193f5cbf60a
parent99a2a2f414b3a21e39a7a46e2bfea052796f8623 (diff)
parentf592e195e2d9ec6cd57e83fe546ae80d9b9ac09b (diff)
Merge "Don't rely on lsb_release for hosts template write"
-rwxr-xr-xscripts/hosts-config.sh14
1 files changed, 3 insertions, 11 deletions
diff --git a/scripts/hosts-config.sh b/scripts/hosts-config.sh
index 4826d615..f456b316 100755
--- a/scripts/hosts-config.sh
+++ b/scripts/hosts-config.sh
@@ -30,17 +30,9 @@ write_entries() {
}
if [ ! -z "$hosts" ]; then
- # cloud-init files are /etc/cloud/templates/hosts.OSNAME.tmpl
- DIST=$(lsb_release -is | tr -s [A-Z] [a-z])
- case $DIST in
- fedora|redhatenterpriseserver)
- name="redhat"
- ;;
- *)
- name="$DIST"
- ;;
- esac
- write_entries "/etc/cloud/templates/hosts.${name}.tmpl" "$hosts"
+ for tmpl in /etc/cloud/templates/hosts.*.tmpl ; do
+ write_entries "$tmpl" "$hosts"
+ done
write_entries "/etc/hosts" "$hosts"
else
echo "No hosts in Heat, nothing written."