Re: "clone" an example client?
On 12/08/2011 12:21 PM, Thomas Lange wrote: >> # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' aptitude search \~M | awk '{ print $3 }' does the same. Not to me for some reason. The first one is a lot shorter. I use the debian repo and the trinity repos from pearsoncomputing, could that make a diffrence? or ist the second command more equal than the first ;-)
Re: "clone" an example client?
On 12/08/2011 12:20 PM, SYSTEMS Oliver Osburg wrote: b) get a list of modified config files with "dpkg-query -W -f='${Conffiles}\n' '*' | awk 'OFS=" "{print $2,$1}' | md5sum -c 2>/dev/null | awk -F': ' '$2 !~ /OK/{print $1}'" or any other method. I yet found no way to do this in a really good way. Often important files are not listed. Hth & Regards, Oliver I think this misses perhaps all files that are modified by hand. In my case e.g.: /etc/fstab /etc/cups/client.conf /etc/passwd ..and perhpas some I forgot. My approach so far would be: Install a new client with a packagelist from the example client, run some sort of diff betweeen the /et of the example and the freshly installed client, and the "just copy" (?) the different files from the example to the fai config (at the moment I don't know where that would be, because of missing knowledge).
Re: "clone" an example client?
On 12/08/2011 04:47 PM, Frank Lienhard wrote: client*) echo "FAIBASE DHCP DEMO MACHINE" assuming the host client50 is rechable/resolved (by pinging it). Than I have to run e.g this: " fai-chroot -IFv client50 " ->but I get 'fai-chboot: unknown host' doesn't work either. or do I have to run 'fai-conf-update' after editing the config/class/* section? (just read/googled around while waiting for reply..) Frank must have been a typo.. Just did other names and now it works. "Wir entschuldigen uns für die Unanhemlichkeiten" Frank
Re: "clone" an example client?
On 12/08/2011 04:39 PM, Alexander Bugl wrote: Hi! client*) echo "FAIBASE DHCP DEMO MACHINE" assuming the host client50 is rechable/resolved (by pinging it). Than I have to run e.g this: " fai-chroot -IFv client50 " ->but I get 'fai-chboot: unknown host' You should use the FQDN of the server: fai-chroot -IFv client50.example.org With regards, Alex doesn't work either. or do I have to run 'fai-conf-update' after editing the config/class/* section? (just read/googled around while waiting for reply..) Frank
Re: "clone" an example client?
Hi! client*) echo "FAIBASE DHCP DEMO MACHINE" assuming the host client50 is rechable/resolved (by pinging it). Than I have to run e.g this: " fai-chroot -IFv client50 " ->but I get 'fai-chboot: unknown host' You should use the FQDN of the server: fai-chroot -IFv client50.example.org With regards, Alex -- Alexander Bugl, Central IT Services, ZMAW Max Planck Institute for Meteorology Bundesstrasse 53, D-20146 Hamburg, Germany tel +49-40-41173-351, fax -356, room PE048
Re: "clone" an example client?
On 12/08/2011 04:10 PM, Brian Kroth wrote: Your package list config files go in config/package_config/MACHINE_CLASS_NAME where MACHINE_CLASS_NAME is what you defined for the host in the config/class/* section. NFSROOT is the package_config for building the nfs boot environment that your clients use during PXE boot for install (for instance). However, you'll probably want to read through the other package_config files and docs so that when your machine gets multiple classes assigned it still does what you expect. Brian Still need assistence :-( Lets say I define a config/package_config/MACHINE (ony with some extra packages). and I want all machines called "clientXX" use this additional class. Then I edit 50-host-classes in config/class like this: client*) echo "FAIBASE DHCP DEMO MACHINE" assuming the host client50 is rechable/resolved (by pinging it). Than I have to run e.g this: " fai-chroot -IFv client50 " ->but I get 'fai-chboot: unknown host' what am I missing (most likely missing some knowledge on my side) Thanks again
Re: "clone" an example client?
SYSTEMS Oliver Osburg 2011-12-08 12:20: On 07.12.2011 17:15, Frank Lienhard wrote: I have an i386 client, which I installed manually and I'm now wondering how to setup future clients "identical" to that with FAI at least to have the package selection transfered to the FAI config would save a lot of work, I think Hi, I often reconfigure my clients, too. Config Files change, and I also would appreciate a way to "automatically" create FAI configs from a running Debian Machine. But in a way, this violates the FAI philosophy "Do all configurations on the server". After some thinking, one could conclude that this will never be possible to do 'perfectly' But I'm sure one could do nice things which could make a Sysadmin's life easier. Here, Machines constantly are updated. The following would be useful: a) check regularly if files deployed by FAI change on a Host in a certain class, so the file on the FAI server needs to be updated. b) check regularly if new packages are installed on the clients. If so add these packages to the package lists. c) check regularly if packages were removed on the clients. If so, remove these packages from the package lists on the FAI server. d) for all packages it needs to be checked if any configuration file is changed from the Debian default I tend to think of fai as being useful for installs and use cfengine (or pick your variant) for config file maintenance (it also stores everything in a vcs). In my environment cfengine and fai work very closely together to bring a machine up and working in very little time - just add it to the right cfengine classes (eg: webserver or lab_host), which are dynamically turned into fai classes (eg: WEBSERVER or LAB_HOST) using a config/class/ script. Those FAI classes then make use of service specific disk_config and package_config files to install the machine's packages (eg: apache2 or rsync), then cfengine controls the configuration of those services. The usual mantra after that is to replace the machine (usually a vm) rather than upgrade it, so we just go through the same process again and transfer service ips/cnames around as necessary once the new one is up and running. That way if we replace or change packages on a service's config we just get the new version the next time we install rather than fighting with upgrading. For lab hosts, I tend to let FAI get them partially working via netboot and then rsync the rest off of a golden image. That makes for a single point of management for most configs and customizations, then cfengine handles the rest. Also, there's a tool called pkgsync I ran across a while ago that may help with some of the other points you outline above: http://packages.debian.org/squeeze/pkgsync Brian signature.asc Description: Digital signature
Re: "clone" an example client?
Frank Lienhard 2011-12-08 14:28: On 12/08/2011 12:21 PM, Thomas Lange wrote: >> # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' aptitude search \~M | awk '{ print $3 }' does the same. OK with one of the above I get my list., but it seams I still mist a major point at all, because I still can't figure out, how to set up a own client config with that. I do understand that I have to generate the appropiate class files in /srv/fai/config, but I don't understand how to configure a new host-type with that. Your package list config files go in config/package_config/MACHINE_CLASS_NAME where MACHINE_CLASS_NAME is what you defined for the host in the config/class/* section. NFSROOT is the package_config for building the nfs boot environment that your clients use during PXE boot for install (for instance). However, you'll probably want to read through the other package_config files and docs so that when your machine gets multiple classes assigned it still does what you expect. Brian signature.asc Description: Digital signature
Re: "clone" an example client?
On 12/08/2011 12:21 PM, Thomas Lange wrote: >> # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' aptitude search \~M | awk '{ print $3 }' does the same. OK with one of the above I get my list., but it seams I still mist a major point at all, because I still can't figure out, how to set up a own client config with that. I do understand that I have to generate the appropiate class files in /srv/fai/config, but I don't understand how to configure a new host-type with that. Thanks Frank
Re: "clone" an example client?
> On Thu, 08 Dec 2011 10:42:03 +0100, Frank Lienhard said: > On 12/08/2011 10:02 AM, Frank Lienhard wrote: >> On 12/08/2011 03:07 AM, Brian Kroth wrote: >>> Henning Sprang 2011-12-07 23:54: On Wed, Dec 7, 2011 at 5:15 PM, Frank Lienhard wrote: > I have an i386 client, which I installed manually and I'm now Please do NOT cite all mails completly. -- regards Thomas
Re: "clone" an example client?
> On Thu, 08 Dec 2011 10:02:57 +0100, Frank Lienhard said: >> # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' aptitude search \~M | awk '{ print $3 }' does the same. -- regards Thomas
Re: "clone" an example client?
On 07.12.2011 17:15, Frank Lienhard wrote: I have an i386 client, which I installed manually and I'm now wondering how to setup future clients "identical" to that with FAI at least to have the package selection transfered to the FAI config would save a lot of work, I think Hi, I often reconfigure my clients, too. Config Files change, and I also would appreciate a way to "automatically" create FAI configs from a running Debian Machine. But in a way, this violates the FAI philosophy "Do all configurations on the server". After some thinking, one could conclude that this will never be possible to do 'perfectly' But I'm sure one could do nice things which could make a Sysadmin's life easier. Here, Machines constantly are updated. The following would be useful: a) check regularly if files deployed by FAI change on a Host in a certain class, so the file on the FAI server needs to be updated. b) check regularly if new packages are installed on the clients. If so add these packages to the package lists. c) check regularly if packages were removed on the clients. If so, remove these packages from the package lists on the FAI server. d) for all packages it needs to be checked if any configuration file is changed from the Debian default I already did some versions of this, I called "fai-conf-update", starting with http://wiki.fai-project.org/wiki/Helper_scripts#fai-conf-update In my private "FAI-Lab" I have other scripts, but none of these I consider especially useful for other admins not working in my "Lab". But I still think it should be possible to create a script, which can create FAI config files based on the differences of the configuration files of a running host compared to the files in the vanilla debian repository. Wouldn't it be neat it we could offer "sample Debian installations" from a website some day? E.G. If someone figured out how to setup a special kind of Hardware on Debian wheezy, he could share this configs. I know That this in some way violates the FAI philosophy but I hope that I made my point clear: I don't want to change this philosophy (because it's good) but I want to make it easier for sysadmins to deal with the FAI config space - Even the setup of the config space could be automated, I think. But generally a good idea to start off installing clients with fai is: a) get the list of installed packages with "dpkg -l" b) get a list of modified config files with "dpkg-query -W -f='${Conffiles}\n' '*' | awk 'OFS=" "{print $2,$1}' | md5sum -c 2>/dev/null | awk -F': ' '$2 !~ /OK/{print $1}'" or any other method. I yet found no way to do this in a really good way. Often important files are not listed. c) use "etckeeper" or any other revision control system. If you check-in right after "vanilla install" and compare the ready-configured host later, you should get a list of the files you or the system did modify. Problem here: Mostly, only some of the listed files are actually necessary on the install-server. If someone reading the list has a helper script roughly like this - please share :) Hth & Regards, Oliver -- Osburg.Systems - UNIX Solutions
Re: "clone" an example client?
On 12/08/2011 10:02 AM, Frank Lienhard wrote: On 12/08/2011 03:07 AM, Brian Kroth wrote: Henning Sprang 2011-12-07 23:54: On Wed, Dec 7, 2011 at 5:15 PM, Frank Lienhard wrote: I have an i386 client, which I installed manually and I'm now wondering how to setup future clients "identical" to that with FAI at least to have the package selection transfered to the FAI config would save a lot of work, I think you could use the output of dpkg -l but you should probably remove stuff staring with lib and you could install a basic system and remove everything that's in there already from the list. Also, there are logs from apt/aptitude that could show you which packages you installed manually. You could do something similar by diffing the /etc of the manuall system with the system after installing all packages to identify manually changed configs. If you know that you will install the system with fai after (e.g. in an early development stage) fiddling with it manully, you could use git ot etckeeper to see which changes you really made to /etc - or just saving all files you edit with %-orig before changing them. Henning If the client is recent, aptitude will tell you what's been manually requested and installed versus what's been installed as a dependency (eg: libs that were referred to previously). Here's what I usually use, though I know there's some other commands out there to do something similar in a more elegant way: # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' Brian OK, I think I still miss something essential. I understand that the above aptitude line gives me all packages which have to be installed and all others will get installed via dependencies. But I'm supposed to put this in the /etc/fai/NFSROOT file? I guess not, because I think I don't have to have them all in the nfsroot dir. So can someone point me the right direction to the docu/config files (I'm somewhat lost in the FAI docu..) Thanks OK: Me-> to impatient :-) /srv/fai/config I'm exploring that, but I'll be back ;-)
Re: "clone" an example client?
On 12/08/2011 03:07 AM, Brian Kroth wrote: Henning Sprang 2011-12-07 23:54: On Wed, Dec 7, 2011 at 5:15 PM, Frank Lienhard wrote: I have an i386 client, which I installed manually and I'm now wondering how to setup future clients "identical" to that with FAI at least to have the package selection transfered to the FAI config would save a lot of work, I think you could use the output of dpkg -l but you should probably remove stuff staring with lib and you could install a basic system and remove everything that's in there already from the list. Also, there are logs from apt/aptitude that could show you which packages you installed manually. You could do something similar by diffing the /etc of the manuall system with the system after installing all packages to identify manually changed configs. If you know that you will install the system with fai after (e.g. in an early development stage) fiddling with it manully, you could use git ot etckeeper to see which changes you really made to /etc - or just saving all files you edit with %-orig before changing them. Henning If the client is recent, aptitude will tell you what's been manually requested and installed versus what's been installed as a dependency (eg: libs that were referred to previously). Here's what I usually use, though I know there's some other commands out there to do something similar in a more elegant way: # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' Brian OK, I think I still miss something essential. I understand that the above aptitude line gives me all packages which have to be installed and all others will get installed via dependencies. But I'm supposed to put this in the /etc/fai/NFSROOT file? I guess not, because I think I don't have to have them all in the nfsroot dir. So can someone point me the right direction to the docu/config files (I'm somewhat lost in the FAI docu..) Thanks
Re: "clone" an example client?
On Wed, Dec 07, 2011 at 05:15:15PM +0100, Frank Lienhard wrote: > I have an i386 client, which I installed manually and I'm now > wondering how to setup future clients "identical" to that with FAI > > at least to have the package selection transfered to the FAI config > would save a lot of work, I think Use debtree to identify the "leaf packages" so you don't have to put all and everything into the package list. Identify the files (supposedly mainly in /etc) which have been modified during or after installation, and convert them into a fcopy-able tree. S -- Steffen Grunewald * MPI Grav.Phys.(AEI) * Am Mühlenberg 1, D-14476 Potsdam Cluster Admin * - * http://www.aei.mpg.de/ * e-mail: steffen.grunewald(*)aei.mpg.de * +49-331-567-{fon:7274,fax:7298}
Re: "clone" an example client?
Henning Sprang 2011-12-07 23:54: On Wed, Dec 7, 2011 at 5:15 PM, Frank Lienhard wrote: I have an i386 client, which I installed manually and I'm now wondering how to setup future clients "identical" to that with FAI at least to have the package selection transfered to the FAI config would save a lot of work, I think you could use the output of dpkg -l but you should probably remove stuff staring with lib and you could install a basic system and remove everything that's in there already from the list. Also, there are logs from apt/aptitude that could show you which packages you installed manually. You could do something similar by diffing the /etc of the manuall system with the system after installing all packages to identify manually changed configs. If you know that you will install the system with fai after (e.g. in an early development stage) fiddling with it manully, you could use git ot etckeeper to see which changes you really made to /etc - or just saving all files you edit with %-orig before changing them. Henning If the client is recent, aptitude will tell you what's been manually requested and installed versus what's been installed as a dependency (eg: libs that were referred to previously). Here's what I usually use, though I know there's some other commands out there to do something similar in a more elegant way: # aptitude search . | grep ^i | grep -v '^i A' | awk '{ print $2 }' Brian signature.asc Description: Digital signature
Re: "clone" an example client?
On Wed, Dec 7, 2011 at 5:15 PM, Frank Lienhard wrote: > I have an i386 client, which I installed manually and I'm now wondering how > to setup future clients "identical" to that with FAI > > at least to have the package selection transfered to the FAI config would > save a lot of work, I think you could use the output of dpkg -l but you should probably remove stuff staring with lib and you could install a basic system and remove everything that's in there already from the list. Also, there are logs from apt/aptitude that could show you which packages you installed manually. You could do something similar by diffing the /etc of the manuall system with the system after installing all packages to identify manually changed configs. If you know that you will install the system with fai after (e.g. in an early development stage) fiddling with it manully, you could use git ot etckeeper to see which changes you really made to /etc - or just saving all files you edit with %-orig before changing them. Henning -- Henning Sprang http://www.sprang.de