Is nested class supported in Puppet?

0 votes
Is nested class supported on puppet? If yes, how does it work?
Mar 8, 2019 in Puppet by Laksha
249 views

1 answer to this question.

0 votes

Puppet supports the concept of nesting of classes in which it allows to use nested classes which means one class inside the other. This helps in achieving modularity and scoping.

class testclass { 
   class nested { 
      file {  
         '/etc/passwd': 
         owner => 'superuser', 
         group => 'superuser', 
         mode => 644; 
      } 
   } 
} 
class anotherclass { 
   include myclass::nested 
} 
answered Mar 8, 2019 by Devika

Related Questions In Puppet

0 votes
1 answer

What is class inheritance in Puppet?

What is class Inheritance? Node groups inherent properties ...READ MORE

answered Mar 5, 2019 in Puppet by Yogesh
201 views
0 votes
1 answer

Is using Puppet class Inheritance even useful?

Building a service from reusable Puppet modules ...READ MORE

answered Mar 5, 2019 in Puppet by Kyraa
39 views
0 votes
1 answer

What is resource declaration in Puppet?

Puppet code is composed primarily of resource declarations. ...READ MORE

answered Mar 11, 2019 in Puppet by Bob
50 views
0 votes
1 answer

Is it possible to install puppet agent in a docker container on linux?

Hey @Janice, this is pretty simple. Create ...READ MORE

answered Mar 12, 2019 in Puppet by Jason
433 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
587 views
0 votes
1 answer
0 votes
1 answer

Purpose of node block in Puppet

A node block allows you to specify ...READ MORE

answered Mar 11, 2019 in Puppet by Shalaka
53 views
0 votes
1 answer

Pupper error - Duplicate definition: Service[ServiceName] is already defined

Hey @Nigya, try something like this: class MyClass ...READ MORE

answered Feb 14, 2019 in Puppet by Hatim
52 views