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