[rancid] hostname glob - regex?
heasley
heas at shrubbery.net
Mon Feb 10 17:30:57 UTC 2014
Mon, Feb 10, 2014 at 12:01:34AM +0100, Pawe?? Rzepa:
> W dniu 06.02.2014 08:44, Pawel Rzepa pisze:
>
> Hi,
> Any help? I've digged into this a little and found that .cloginrc is
> interpreted by expect. I'm not very familiar with expect, tried some
> regexps with braces, escaped braces etc and no success. Is it impossible
> to use regexp in this context?
no; if it were, the manpage would have read regex, not glob. regex would
be useful; though i'm not sure how to implement it, since glob and regex
are not complatible. perhaps a global knob in cloginrc that switches the
format to regex? or an regex-specific version of the 'add' function and
search regexes before globs?
Per Olaf, ideas?
> Regards,
> Pawel Rzepa
>
> > Hi,
> > When I log into my devices to get configuration with rancid I must use
> > two different users for two different groups of devices. I know that I
> > can modify .cloginrc to achieve this:
> >
> > add user group-1-* {user1}
> > add user group-2-* {user2}
> >
> > Unfortunately I am unable to describe groups of devices in such a
> > consistent manner and now my .cloginrc looks like this:
> >
> > add user 192.168.1.* {user1}
> > add password 192.168.1.* {pass1}
> > add user 192.168.2.5 {user1}
> > add password 192.168.2.5 {pass1}
> > add user *-core-* {user1}
> > add password *-core-* {pass1}
> >
> > add user 10.1.2.3 {user2}
> > add user 10.1.5.* {user2}
> > etc..
> >
> > Is it possible to use regular expression to describe hostname? I'd
> > love to specify them like that:
> >
> > add user {192.168.1.*|192.168.2.5|*-core-*} {user1}
> > add password {192.168.1.*|192.168.2.5|*-core-*} {pass1}
> >
> > add user {10.1.2.3|10.1.5.*} {user2}
> > ...
> >
> > Best regards,
> > Pawel Rzepa
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss
More information about the Rancid-discuss
mailing list