eoly / puppet-rancid

Rancid Puppet Module
Other
6 stars 29 forks source link

Is this working with rancid 3.X? #10

Closed elisiano closed 6 years ago

elisiano commented 9 years ago

I had recently to re-install one of our rancid servers and I noticed that all routers were reported as down. After a bit of digging I am still unclear where the problem lies. I noticed that /usr/libexec/rancid/control_rancid changes the logic/format of temporary files, but the original router.db has still the same format.

Did anyone successfully use this module with rancid 3.X?

eoly commented 9 years ago

I will try the module with rancid 3 and post my results.

elisiano commented 9 years ago

Did you have a chance to test this? It's a burden to remember not to upgrade the package when doing system upgrades :-)

supine commented 9 years ago

The main issue with supporting 3.x is this change:

router.db,rancid.types.*: change field separator to ';' (semi-colon) to
    allow for IPv6 addresses in router.db and avoid conflict with :s in
    device commands and perl module names
ghoneycutt commented 9 years ago

If that's the only change, then the template could optionally use : or ; as appropriate. You might want a custom fact that gives you the rancid version.

lemonsquash commented 9 years ago

Both RHEL 6 and 7 have rancid > 3.0 in their epel repos. Also, I've forked the module and modified it a little bit to support CentOS/RHEL 7 and rancid 3.2 If anyone's interested, I can open a new pull request as soon as all work is done & the module is tested?

eoly commented 9 years ago

@lemonsquash a pull request would be appreciated.

lemonsquash commented 9 years ago

Ok, I will open it as soon I've tested the module and solved any bugs (if any ;) )

eoly commented 9 years ago

:+1:

elisiano commented 9 years ago

@lemonsquash: I saw that in your fork you also add support for git (new in rancid 3.2) on top of rancid 3.x support! :+1: How far is a PR?

lemonsquash commented 9 years ago

@elisiano: Sorry for the delay, I didn't had a chance to work on this in the last 3 weeks. I hope to get a hour left for fine tuning next week and will create a PR asap then.

lemonsquash commented 9 years ago

@elisiano Unfortunately, I still didn't got some spare time for working on this. But the code should be already working (at least, it is here ;) ). So I will open a PR now to avoid further delays. If you find any errors or problems, please don't hesitate to tell me.

elisiano commented 9 years ago

@lemonsquash: apologies for the delay but I had to solve an issue we had with foreman and environments before I could test this.

First of all thanks, this mostly works (except on the first run where it spit some errors but then eventually works). There's a couple of things that would need to be addressed:

The fix I applied in the router.db.erb is very simple: just sort the keys before looping over them. The following code is for the pre 3.X version so it still has the ':' instead of ';' but It should work

<%- @devices[@name].keys.sort.each do |key| -%>
<%=@devices[@name][key]['hostname']-%>:<%=@devices[@name][key]['type']-%>:<%=@devices[@name][key]['status']-%>

<%- end -%>

Apologies for not opening a PR but I'm extremely swamped at the moment (but I still wanted to give some feedback).

Thanks!

elisiano commented 9 years ago

And also cvsroot it doesn't seem to be used (the template reference a "@cvsdir" which is uninitialized).

elisiano commented 6 years ago

I'm closing this as it's no more relevant to me. Feel free to reopen for whatever reason.

nhemingway commented 3 years ago

I'm running against rancid 3.13, and the issue definitely exists. Please could this issue be reopened. I'm happy to contribute a PR. Do we still need to support versions < 3.x ?