Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6630665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:26:16+00:00 2026-05-25T22:26:16+00:00

I wrote puppet manifests and I use puppet to deploy my system. I am

  • 0

I wrote puppet manifests and I use puppet to deploy my system.
I am now refactoring manifests in order to make it maintainable.

One of sub systems is tomcat with webapplications.
I have ~10 webapps. Each of those has almost the same procedure to deploy.
For now I use classes. 10 files – almost identical.

When I tried to use parametrized class, puppet lets me instantiate it just once.
Then I tried to create ’empty’ classes which inherit from webapp class.
It does not work as well because puppet complains that parameters are not passed parent class.

I do not see any method I could abstract the code. How to do it?

I would like to achieve:

   node {
     class {"webapp::first": param1 = one}
     class {"webapp::second": param1 = two}   
   }

where first and second are applications using the same recipes.

I know there is define, but recipe is pretty big and even if it would be possible I find class more readable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:26:16+00:00Added an answer on May 25, 2026 at 10:26 pm

    You can use parameters in your classes, but defines are more what you want. Quoting the official documentation

    Classes and defined types are created similarly, but they are used very differently.

    Defined types are used to define reusable objects which will have multiple instances on a given host, so > they cannot include any resources that will only have one instance. For instance, multiple uses of the > same define cannot create the same file.

    see http://docs.puppetlabs.com/guides/language_guide.html#resource-collections

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote code in C# for ASP.Net website , but when i select one
I wrote this code to get my hands working on the system calls. I
I wrote some code to generate a boost::mpl::vector to use as a lookup table
I wrote the most simple wcf service that have one method // return a+b
I wrote the following code to make the plot pd<- position_dodge(.2) # # move
I wrote this, and wanted to get everyones opinion. I use this when I'm
Wrote the following in PowersHell as a quick iTunes demonstration: $iTunes = New-Object -ComObject
Wrote a quick Java proggy to spawn 10 threads with each priority and calculate
I wrote a simple batch file as a PowerShell script, and I am getting
I wrote a windows service using VB that read some legacy data from Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.