How to execute/run puppet class
Solution 1:
What you did is defining a class.
But you also need to declare it.
For the sake of the example, it could look like this:
# A class with no parameters
class example_class {
#create a directory
file {"create directory":
path => '/root/rahil/puppet/puppetDemo/tmp',
ensure => "directory",
}
}
class { 'example_class': }
Please note that I changed the name to example_class
as upper case letters should not be used in class names.
And also note that usually you don't define and declare classes in the same file.
How that is done is a bigger topic, see Modules fundamentals Documentation for a start.