what are Resources in puppet

0 votes
Could somebody explain the concept of "resources" in puppet?
Jul 24, 2019 in Puppet by Karan
• 19,610 points

1 answer to this question.

0 votes
  • Resources are the fundamental unit for modeling system configurations.

  • Each resource describes the desired state for some aspect of a system, like a specific service or package. When Puppet applies a catalog to the target system, it manages every resource in the catalog, ensuring the the actual state matches the desired state.

  • Resources contained in classes and defined types share the relationships of those classes and defined types. 

  • Resources are not subject to scope: a resource in any area of code can be referenced from any other area of code.

  • A resource declaration adds a resource to the catalog and tells Puppet to manage that resource's state.

  • Resource declarations

  • At minimum, every resource declaration has a resource type, a title, and a set of attributes:

  • <TYPE> { '<TITLE>': 

    <ATTRIBUTE> => <VALUE>, }

  • The resource title and attributes are called the resource body. A resource declaration can have one resource body or multiple resource bodies of the same resource type.

  • Resource declarations are expressions in the Puppet language — they always have a side effect of adding a resource to the catalog, but they also resolve to a value.The value of a resource declaration is an array of resource references, with one reference for each resource the expression describes.

  • Below is an example of a user resource declaration:

  • user { 'Sam':
     ensure     => present,
     uid        => '100',
     gid        => '100',
     shell      => '/bin/bash',
     home       => '/home/Sam'

answered Jul 24, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer

What are profiles in Puppet?

Wrapper classes that use multiple component modules ...READ MORE

answered Feb 15, 2019 in Puppet by Sheela
0 votes
1 answer

What are classes in Puppet?

Classes in Puppet are introduced using the ...READ MORE

answered Mar 8, 2019 in Puppet by Haider
0 votes
1 answer

What are modules in puppet?

A module can be defined as a ...READ MORE

answered Mar 8, 2019 in Puppet by Vivek
0 votes
1 answer

what are the important commands in puppet?

Here's a list of commands that you ...READ MORE

answered Jul 25, 2019 in Puppet by Sirajul
• 59,230 points
+15 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer

what are the different plugins in modules of puppet?

Puppet supports several kinds of plug-ins: Custom facts ...READ MORE

answered Jul 25, 2019 in Puppet by Sirajul
• 59,230 points
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP