From: root Date: Sun, 26 Sep 2010 05:44:51 +0000 (-0400) Subject: Preliminary try at automating some of install process. X-Git-Url: https://scripts.mit.edu/gitweb/xen.git/commitdiff_plain/1fdb4d82c39f2bf42e8af44ce289c6a53236dab4 Preliminary try at automating some of install process. Signed-off-by: root --- diff --git a/scripts-server b/scripts-server index b6f8bfb..ab9aff3 100644 --- a/scripts-server +++ b/scripts-server @@ -57,6 +57,9 @@ def serve_kickstart(machine_name, install): hostname = machine_name + ".mit.edu" ip = socket.gethostbyname(hostname) + source_server = "cats-whiskers.mit.edu" # hard-coded + source_ip = re.sub('^18.181.0.', '172.21.0.', socket.gethostbyname(source_server)) + # generate the kickstart file ks_orig = open("/etc/xen/scripts.ks").read() ks = string.Template(ks_orig).substitute( @@ -67,6 +70,9 @@ def serve_kickstart(machine_name, install): hostname = hostname, ip = ip, backend_ip = re.sub('^18.181.0.', '172.21.0.', ip), + branch = "branches/fc13-dev", + source_server = source_server, + source_ip = source_ip, ) class SingleFileHandler(BaseHTTPServer.BaseHTTPRequestHandler): diff --git a/scripts.ks b/scripts.ks index cee6ca1..cb65af6 100644 --- a/scripts.ks +++ b/scripts.ks @@ -8,6 +8,9 @@ # hostname = ${hostname} # ip = ${ip} # backend_ip = ${backend_ip} +# source_server = ${source_server} +# source_ip = ${source_ip} +# branch = ${branch} install url --url=${local_mirror}/fedora/linux/releases/${fedora_release}/Fedora/${arch}/os @@ -56,3 +59,26 @@ fprintd-pam # Installed so we can disable its service isdn4k-utils %end + +%post --erroronfail +set -e +echo "" >> /etc/hosts +echo "${source_ip} ${source_server}" >> /etc/hosts +alias asbuild="sudo -H -u scripts-build env HOME=/home/scripts-build" +cd /srv +svn co svn://${source_server}/${branch} repository +sed -i 's/^\(# *\)?store-passwords.*/store-passwords = no/' /root/.subversion/config +sed -i 's/^\(# *\)?store-auth-creds.*/store-auth-creds = no/' /root/.subversion/config +chown -R scripts-build /srv/repository +cd repository +asbuild svn up # generate the config file +asbuild sed -i 's/^\(# *\)?store-passwords.*/store-passwords = no/' /home/scripts-build/.subversion/config +asbuild sed -i 's/^\(# *\)?store-auth-creds.*/store-auth-creds = no/' /home/scripts-build/.subversion/config +cd /srv/repository/server/fedora +make install-deps +cd /root +svn co svn://${source_server}/${branch}/server/fedora/config/etc etc +mkdir vice +cd vice +svn co svn://${source_server}/${branch}/server/fedora/config/usr/vice/etc etc +%end