[opensuse-autoinstall] Automatic time zone configuration with Autoyast
Is it possible for autoyast to query an external source to determine the appropriate time zone for a device? I have 5000+ machines that are identical except that they reside in different time zones, US/Mountain, US/Eastern and US/Central. I would like to only have one autoyast.xml file to maintain, but as these are all at remote sites, I cannot have a prompt pop up to have a user select the appropriate time zone. Does anyone have any suggestions? Thanks, Rob -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-autoinstall+owner@opensuse.org
On Wed, Sep 12, Rob Beglinger wrote:
Is it possible for autoyast to query an external source to determine the appropriate time zone for a device? I have 5000+ machines that are identical except that they reside in different time zones, US/Mountain, US/Eastern and US/Central. I would like to only have one autoyast.xml file to maintain, but as these are all at remote sites, I cannot have a prompt pop up to have a user select the appropriate time zone. Does anyone have any suggestions?
Most probably a pre-script that modifies the timezone tags in xml file would be a possible approach as long as you are able to find out from the installation environment at all. Tschuess, Thomas Fehr -- Thomas Fehr, SuSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Tel: +49-911-74053-0, Fax: +49-911-74053-482, Email: fehr@suse.de GPG public key available. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-autoinstall+owner@opensuse.org
On Wed, Sep 12, Rob Beglinger wrote:
Is it possible for autoyast to query an external source to determine the appropriate time zone for a device? I have 5000+ machines that are identical except that they reside in different time zones, US/Mountain, US/Eastern and US/Central. I would like to only have one autoyast.xml file to maintain, but as these are all at remote sites, I cannot have a prompt pop up to have a user select the appropriate time zone. Does anyone have any suggestions?
If the groups of machines have something in common, like IP address ranges, or anything else that you can use to distinguish them, you could use that to build a simple rules file. (I can give you an example if you wish, but I can't access it right now.) -- Kind regards Christopher 'm4z' Holm / 686f6c6d "When one person suffers from a delusion, it is called insanity. When many people suffer from a delusion it is called Religion" --Robert M. Pirsig -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-autoinstall+owner@opensuse.org
I would be interested in seeing the rules file solution. The 5000+ machines are spread across ~300 remote sites, with 300 different IP subnets. I may be better off going with Thomas's suggestion and just using sed to replace a default time zone in the XML file, but options are always good. Here's a better look at my environment: I have: 1 master repository server at a central location, master-repo 2 slave repository servers at each remote location, repo-a and repo-b (~300 locations spread across 3 time zones) Weekly I rsync the repositories and xml files from the master to the slave servers. The repositories are used for both installation and patch management. What I currently have, based on Thomas's solution is a syncscript that looks like this (the default value for time zone in my autoyast.xml file is America\Chicago): #/bin/bash rsync -ae ssh --delete master-repo:/srv/www/htdocs/install/ /srv/www/htdocs/install/ rsync -ae ssh --delete master-repo:/tftpboot/ /tftpboot/ TZ=`date +%Z` case $TZ in MDT|MST) #replace Chicago with Denver echo "replace Chicago with Denver" sed -i 's/Chicago/Denver/g' /srv/www/htdocs/install/autoyast.xml ;; EDT|EST) #replace Chicago with New_York echo "replace Chicago with New_York" sed -i 's/Chicago/New_York/g' /srv/www/htdocs/install/autoyast.xml ;; CDT|CST) #Do Nothing echo "Do Nothing" ;; *) echo $TZ "is not a valid Time zone" ;; esac REPO=`hostname |awk -F"-" ' { print $2}'` case $REPO in b) #replace repo-a with repo-b echo "replace repo-a with repo-b" sed -i 's/repo-a/repo-b/g' /srv/www/htdocs/install/autoyast.xml sed -i 's/repo-a/repo-b/g' /tftpboot/pxelinux.cfg/default ;; a) #Do Nothing echo "Do Nothing" ;; *) echo $REPO "is not a valid Repo server" ;; esac On Wed, Sep 12, 2012 at 5:32 AM, 686f6c6d <686f6c6d@googlemail.com> wrote:
On Wed, Sep 12, Rob Beglinger wrote:
Is it possible for autoyast to query an external source to determine the appropriate time zone for a device? I have 5000+ machines that are identical except that they reside in different time zones, US/Mountain, US/Eastern and US/Central. I would like to only have one autoyast.xml file to maintain, but as these are all at remote sites, I cannot have a prompt pop up to have a user select the appropriate time zone. Does anyone have any suggestions?
If the groups of machines have something in common, like IP address ranges, or anything else that you can use to distinguish them, you could use that to build a simple rules file. (I can give you an example if you wish, but I can't access it right now.)
-- Kind regards Christopher 'm4z' Holm / 686f6c6d
"When one person suffers from a delusion, it is called insanity. When many people suffer from a delusion it is called Religion" --Robert M. Pirsig
-- "When fascism comes to America it will be wrapped in the flag and carrying a cross." -- Sinclair Lewis -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-autoinstall+owner@opensuse.org
We are using DHCP/pxe to provide the installation information. In case you use DHCP as well you could serve this info via dhcp. For example we are misusing the DHCP NETBIOSSCOPE variable to provide some information to the system during installation So you could use a pre script to modify your autoinst.xml file The logic could be ... cat /var/lib/dhcpcd/dhcpcd-*info > /mnt/root/dhcpcd.info LocalTimeZone=$( cat /mnt/root/dhcpcd.info | grep NETBIOSSCOPE | cut -f2 -d= ) ... # Replace within the autoyast.xml the timezone to the required value I would use something like: ... <timezone>@TZ@</timezone> ... Within the autoinst.xml file and either replace @TZ@ with $LocalTimeZone or if $LocalTimeZone is not set use a default value like Etc/GMT In anyway: The question should more like: What is unique to each sides and can this info be given/requested to/from the installation process. cheers Hajo -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-autoinstall+owner@opensuse.org
participants (4)
-
686f6c6d
-
Hans-Joachim Ehlers
-
Rob Beglinger
-
Thomas Fehr