On 06/04/12 16:37, James Cammarata wrote:
>> What would I need to do to manually replicate what `cobbler import` does?
>>
>> E.g. `cobbler repo add ...` and reposync will fetch the repository, but will
>> not fetch the files needed for distribution, etc.
> 
> You're going to need the ISO anyway for an import, so doing it
> manually won't buy you anything. There are a lot of files required
> outside of the packages in the repo.
> 
> But, for the record, import is basically a wrapper around the following steps:
> 
> cobbler distro add
> cobbler profile add
> cobbler repo add
> 
> All of which might add more than one object.

I have asked the same question before and got basically the same answer. However
I think it misses some details which you have to spelunk the source code to find
out, such as creating links, supplying the right vmlinuz and initrd paths, etc.

Which I've actually done, so hopefully I can be useful, and check I've done the
right things at the same time.

For the record, this is for use with cobbler-2.0.11-2.el6 on CentOS 6.

I have a script (attached) which I think supplies the missing details, but note
my case is somewhat different from yours, so it does more than you need, and
you'll need to modify the rsync invocation to work within your restrictions.

The script's purpose is to reconstruct a cobbler installation given a git
snapshot of the cobbler config in /etc/cobbler and /var/lib/cobbler/*.

 - It assumes cobbler has been freshly installed from the rpm, that there is
   only one known distro required.

 - It works around the fact that cobblerd will not start in the installed state
   by creating a dummy dhcpd.conf.

 - Then it starts cobblerd and adds a single distro/install tree.

 - Finally, it stops cobblerd, inserts the snaphotted configuration (in
   $PUPPET_BASE), and restarts it.


Hope this helps,

Cheers

N

Attachment: cobbler-import.sh
Description: Bourne shell script

_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to