Yedidyah Bar David has posted comments on this change.

Change subject: core: Allow changing the manager hostname
......................................................................


Patch Set 6: (6 inline comments)

....................................................
File packaging/bin/ovirt-engine-rename-manager-host
Line 1: #!/bin/sh
Is there a specific technical reason?

My main reason against doing this is that if one day we decide to write it in 
python and rename, we'll also  have to update documentation, retrain 
users/support, etc.
Line 2: # ovirt-engine-rename-manager-host - Change the engine's host name
Line 3: #
Line 4: # Copyright (C) 2013 Red Hat, Inc.
Line 5: #


Line 35:        if [ -z "${hostname}" ]; then
Line 36:                die "Please specify ${which}"
Line 37:        fi
Line 38:        if ! echo "${hostname}" | grep -q '^[a-zA-Z0-9.-]*$'; then
Line 39:                die "${which} contains invalid characters"
I know about www..com. It's just a simple sanity check. If we really want to 
check validity it's a much more complex check that I would not code myself but 
use some library.
Line 40:        fi
Line 41: }
Line 42: 
Line 43: edit_file(){


Line 89:                        exit 1
Line 90:                        ;;
Line 91:        esac
Line 92: done
Line 93: 
I prefer it that way, unless you find it really bad.
Line 94: checkhostname oldname "${OLDNAME}"
Line 95: checkhostname newname "${NEWNAME}"
Line 96: 
Line 97: # Inform the user about whta's going to happen


Line 111: Editing the following files to have the new host name.
Line 112: Backup files are with the suffix ${BCKSFX} :
Line 113: __EOF__
Line 114: 
Line 115: find /etc/*ovirt* -iname "*.conf" | while read filename; do
Currently, on my test system, this is:

/etc/ovirt-engine
has many files, the following ones contain the hostname, on my system:
engine.conf.d/10-setup-protocols.conf
imageuploader.conf
imageuploader.conf.d/10-engine-setup.conf
isouploader.conf
isouploader.conf.d/10-engine-setup.conf
logcollector.conf
logcollector.conf.d/10-engine-setup.conf

/etc/ovirt-engine-setup.conf.d
has:
20-setup-ovirt-post.conf:OVESETUP_CONFIG/fqdn=str:HOSTNAME
where HOSTNAME is the current hostname.

/etc/ovirt-host-deploy.conf.d
empty

What would you prefer? Just /etc/ovirt-engine ? Just specific files in it?
Also /etc/ovirt-engine-setup.conf.d or perhaps 
/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf ?

Having a hard-coded list means we'll have to update it if/when we add files 
with the hostname.
Line 116:       edit_file "${filename}" "=${OLDNAME}\>" "=${NEWNAME}"
Line 117: done
Line 118: 
Line 119: for filename in /etc/pki/ovirt-engine/cert.{template,conf}; do


Line 123: # 
Line 124: 
Line 125: # Enrolling new apache key/cert
Line 126: target=$(readlink ${apacheca})
Line 127: if [ $? -ne 0 -o "${target}" != "${ca}" ]; then
We create a symlink. If the admin changed it, even if to make it a 
normal-file-copy, they probably have their reasons.
Line 128:       cat << __EOF__
Line 129: 
Line 130: Seems like ${apacheca} is not a symlink to ${ca} .
Line 131: It was probably replaced with a 3rd party certificate.


Line 133: the new host name ${NEWNAME}.
Line 134: __EOF__
Line 135: else
Line 136:       echo
Line 137:       echo "Enrolling new apache key/cert for the new name ${NEWNAME} 
:"
I will, if I have to do more significant changes
Line 138:       . $(find /etc/ovirt-engine -name "*pki*.conf")
Line 139:       pass="${ENGINE_PKI_ENGINE_STORE_PASSWORD}"
Line 140:       O=$(sed -n "0,/^ *Subject:/s/^ *Subject:.*, O=\([^,]*\).*/\1/p" 
\
Line 141:               $(openssl x509 -in "${ca}" -text))


-- 
To view, visit http://gerrit.ovirt.org/16404
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb03d638be1e030865d3ebabaa163ca9be9e70ce
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: Alex Lourie <alou...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Ofer Schreiber <oschr...@redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to