Ensure "rows" in a mysql table

20 views
Skip to first unread message

Abhijeet Rastogi

unread,
Nov 21, 2014, 10:34:40 PM11/21/14
to puppet...@googlegroups.com
Hi everyone,

I've this unique requirement where I have to manage "rows" in a
database using puppet. Well, these rows actually represent "dns
entries". (I'm using powerdns witih mysql
http://doc.powerdns.com/html/generic-mypgsql-backends.html ).

What do you guys thing is the right way to approach this? Below are
the couple of things I can think of:-

1. First write various command line scripts like show_rows, add_rows &
delete_rows. And then call "exec" with conditionals to alter these
rows.
2. Write a custom type/resource which connects to mysql instance and
does it's job.

Although, second option is the most optimal way to do, it also
requires more man hours. I would be happy to choose something that's
already built and tested. Any ideas?


--
Cheers,
Abhijeet Rastogi (shadyabhi)

Felix Frank

unread,
Nov 22, 2014, 4:40:11 PM11/22/14
to puppet...@googlegroups.com
Yes, option 1 is likely more economic. Perhaps you can start from this:

http://serverfault.com/a/560568/216487

HTH,
Felix

Javier Palacios

unread,
Nov 24, 2014, 4:16:46 AM11/24/14
to puppet...@googlegroups.com
For the second path, around one year ago I wrote a module to manage a web app configuration table (key value pairs). Although now I could probably write a better module, It did work well enough. You can have a look at https://forge.puppetlabs.com/jpalacios/sqltable. It would require some adaptation for your case, but it shouldn't be hard.

Javier Palacios

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACXxYfxzz1fCYim-xG6-WxUeWu3BREgLC-quzagjyL%3DUy2TvUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Abhijeet Rastogi

unread,
Nov 24, 2014, 4:30:15 AM11/24/14
to puppet...@googlegroups.com
@Felix, thanks for the link.

@Javier, your module seems like a good starting point. That's
definitely helpful. Thanks.
> https://groups.google.com/d/msgid/puppet-users/CAOAgqVz3UiHswQ%3DqOyRGDa-HGBjpyf_OijBhZ_%2BZb9P0HevNWQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
0 new messages