Ankur Verma
Ankur Verma

Reputation: 5933

Using puppet third party module

I installed one module from :

Puppet Redis Module

Now I have the directory structure as follows :

enter image description here

Contents of g_redis.pp :

class g_redis{
   include redis 

   class {'redis' : 
      version => '2.6.14',
      redis_port => '7000' ----->A
   }

   redis::instance{ 'redis-7000'
      redis_port => '7000', ----->B
   }
}    

Contents of site.pp is :

import 'classes/*.pp'

node default{}

node 'nodename'{
    include g_redis
}

Now I have questions like :

  1. What is the difference in (A) and (B)
  2. The error is coming while running the manifest : enter image description here

Upvotes: 0

Views: 371

Answers (1)

Raul Andres
Raul Andres

Reputation: 3806

  • For your first question, class{'redis':} will start a default instance, so I think you don't need to instantiate a redis:instance, unless you want to have two different instances running in your box.

  • For your second question

 include redis 

 class {'redis' : 
    version => '2.6.14',
    redis_port => '7000' ----->A
 }

Here you are instantiating twice redis class.

   include redis

is almost equivalent to

   class {'redis' :
   }

So second Class['redis'] gives you this error

You should choose between using a basic redis setup or a customized one. If you want two different versions of redis running simultaneously you will have to work hard on the recipes.

  • If you want redis 2.6.14 listening on port 7000', all you want is simply:

node 'nodename'{
    class{'redis':
       version    => '2.6.14',
       redis_port => '7000'
    }
}

Upvotes: 1

Related Questions