On Sun, Jan 9, 2011 at 10:42 AM, trey85stang <trey85st...@gmail.com> wrote:
> I hope my title makes sense. I'm still new to puppet but have made a > lot o progress in a matter of 2-3 days and have a good grasp on the > fundamentals... Now I'm trying to determine how to do a little more > then basic things. > > My hosts all have standard hosts files that are almost identical, > what's not identical is 3 lines, 2 lines I can generate with ip > address information and hostname, the third line I can pull from an > outside db or from the existing file. > > i.e.: > > custom host entries: > > 192.168.1.20 host1.domain.com > 192.168.1.30 host2.domain.com > 192.168.1.250 unique_host.domain.com > > Is there a way to manage this with puppet? It sounds like something you can do with the host resource type. It can specify individual lines of /etc/hosts as resources. > What I would like to do is > be able to check that those 3 entries exist... if not replace the file > and generate the custom content that needs to be in the file? > so you want to transform the host files based on their current state? The only way to get system specific information to make determinations during compile time would be with a custom fact. This feels a little ugly though. I have a feeling I am not understanding your requirements though. > Not sure how to do this in puppet.. or if it is even possible. > > My thought's are a custom script that verifies the file, if that > script fails... replace the file, It is not very easy to model things like this in Puppet. With Puppet you want to specify the end states of things, you should try to model it with that in mind. > then run another script to populate > the custom information. Or can this all be done from within puppet? > Also the hosts file is just an example... I have probably a dozen > other files I need to be able to do this with. > feel free to ping me on irc, might be a little easier to understand what you mean synchronously - bodepd<at>freenode.net > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-us...@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscr...@googlegroups.com<puppet-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.