Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've read a lot of different sources, and I just can't decide what is the best way to handle deployment of modules to nodes/hosts nor have I gotten some of them to work. I have created everything in modules.

That being said, when I was testing I was deploying the modules like this;

node 'basetesting' {
        include fail2ban
        include nrpe
}

node 'test-dev' inherits 'basetesting' {
}

However, I've created a lot of modules and realized that my servers will vary on what their role is (application, web, etc). There is a set of base requirements all of them have. So I essentially want a node to have the base. Then have their required modules, which I believe would look something like this;

node 'basetesting' {
        include fail2ban
        include nrpe
}

node 'test-dev' inherits 'basetesting' {
            include httpd
}

Then I realized ... that I would have to make a definition for every single node. Which, I guess wouldn't be bad, but I imagine if you had 50+ servers, that might become quite the nodes.pp file.

Is there a better way to do this?

share|improve this question
    
What would be your preferred way to set up the nodes? Hiera might be a good option. –  Shane Madden Jan 10 '13 at 7:01

1 Answer 1

The solution I use is regexing the node names:

node 'www\d.domain.com' inherits 'webserver' {}

That way all of my www1, www2, www3, etc get the right setup. Using descriptive server names also makes it easier for new people to understand how your system as a whole works.

share|improve this answer
    
I was afraid of this answer. Our server naming -- is, well. If I tried to regex them, it would not go over well. :P It's more of a server1, server2, server3 kind of naming convention. Thanks for the tip, though! If I ever implement it in another environment this is good knowledge to have! Much appreciated. –  Ethabelle Jan 9 '13 at 15:58
    
Another possible method is to use hiera to look up details of a server configuration from a database. At some point you have to describe what each server is doing so you can apply the correct configuration. Using naming conventions do that makes life a lot easier. –  n8whnp Jan 10 '13 at 13:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.