summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2016-12-06 23:06:44 +0000
committerSteve Baker <sbaker@redhat.com>2016-12-08 20:09:26 +0000
commitf592e195e2d9ec6cd57e83fe546ae80d9b9ac09b (patch)
treeff8a2283a932edec1301ae9a8733f6a763ebd4b5 /scripts
parentbb73874310ce7a7a2a7da6a848dbd60e4e0aff12 (diff)
Don't rely on lsb_release for hosts template write
This is problematic for the containerised heat-agents, lsb_release has to be bind-mounted in, and atomic host doesn't even have lsb_release installed. Instead just write to every /etc/cloud/templates/hosts.*.tmpl file. Change-Id: If2aab7e9b1e03aa657baf1c33aa4392ef7044075
Diffstat (limited to 'scripts')
-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."