Merge "Cleanup hosts name on initial install"

This commit is contained in:
Zuul 2018-07-10 08:13:40 +00:00 committed by Gerrit Code Review
commit 7f146a1e46
1 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,11 @@ write_entries() {
diff "$file" "$temp" || true
cat "$temp" > "$file"
else
# NOTE(aschultz): we purge any entries in the hosts file that match
# the existing short hostname on initial installation only. This
# prevents existing data from coming through and causing deployment
# issues when services (I'm looking at you rabbitmq) start up.
sed -i "/$(hostname -s)/d" "$file"
echo -ne "\n# HEAT_HOSTS_START - Do not edit manually within this section!\n" >> "$file"
echo "$entries" >> "$file"
echo -ne "# HEAT_HOSTS_END\n\n" >> "$file"