Ask Your Question
0

how to execute puppet class

asked 2015-06-17 04:23:49 -0500

I am new to puppet. I want to know how to execute/run a simple puppet class. Below is the class I am trying to execute using:-

puppet apply classExample.pp

classExample.pp is the file in which class is written. This code just compiles the class and nothing happens. How to execute this class?

 # A class with no parameters
class exampleClass {

 #create a directory
  file {"create directory":
    path => '/root/rahil/puppet/puppetDemo/tmp',
    ensure => "directory",
  }

}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-06-17 04:55:42 -0500

Hi, got the solution. I just defined the class. I need to declare it also as:-

class { 'example_class': }

This is how my final corrected class looks like:-

 # A class with no parameters
class exampleClass {

 #create a directory
  file {"create directory":
    path => '/root/rahil/puppet/puppetDemo/tmp',
    ensure => "directory",
  }

}

class { 'example_class': }
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-06-17 04:23:49 -0500

Seen: 38 times

Last updated: Jun 17 '15