Hello James Thank you for your answer. Unfortunately this doesn't work. My wget won't be executed even a active repo.
[root@cobbler sl]# cobbler profile dumpvars --name=rhel5-intranet | grep -w repos repos : rhel58-x86_64-20120723 [root@cobbler sl]# cobbler profile getks --name=rhel5-Intranet | grep updates repo --name=rhel58-x86_64-20120723 --baseurl=http://cobbler/pub/updates/rhel5server-x86_64/20120723 [root@cobbler sl]# Regards Manuel -----Ursprüngliche Nachricht----- Von: cobbler-boun...@lists.fedorahosted.org [mailto:cobbler-boun...@lists.fedorahosted.org] Im Auftrag von James Cammarata Gesendet: Dienstag, 31. Juli 2012 05:29 An: cobbler mailing list Betreff: Re: [cobbler] Can't read out variable repos in snippet On Mon, Jul 30, 2012 at 10:19 AM, <manuel.laes...@swisslife.ch> wrote: > Hello togehter > I would like to read out variable repos (cobbler profile dumpvars > --name=rhel5-intranet | grep -w repos) in my snippet create_repos_snippet > and download a yum repo file if the string is not empty. > > [root@cobbler sl]# cobbler profile dumpvars --name=rhel5-intranet | grep -w > repos > repos : rhel58-x86_64-20120723 > <snipp> > #if 'rhel58' in $repos > #echo $repos > wget http://cobbler/pub/files/5_rhel5-updates.repo -O > /etc/yum.repos.d/rhel5-updates.repo > #end if > </snipp> > > Unfortunately this doesn't work. I have to specifie the whole name of the > repo like > > <snipp> > #if 'rhel58-x86_64-20120723' in $repos > #echo $repos > wget http://cobbler/pub/files/5_rhel5-updates.repo -O > /etc/yum.repos.d/rhel5-updates.repo > #end if > </snipp> > > Has anybody any idea how to test $repos without using the whole name of the > repo? I also tried #if $repos != ' ' without any success. You want to use this: #if $repos.find('rhel58') != -1 #end if _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/cobbler _______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/cobbler