Ask Your Question
0

How to Use Defined Resource?

asked 2016-04-18 06:11:56 -0500

ory gravatar image

Hi, I'm trying to use Icinga2 module (I'm new to both Puppet and Icinga). I want to use the Check Plugin defined resource in order to add a check plugin. I'm using PE. How should I use a 'defined resource'?

Icinga moudle

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-18 10:50:28 -0500

mike.r gravatar image

updated 2016-04-18 12:29:02 -0500

defined resource or type is basically a resource, use it the same way as a regular resource.

simple example:

 define hello_define ($contentvar) {
        file {"$title":
          ensure  => file,
          content => $contentvar,
        }
      }

class puppet_tests::definedTypes {

      hello_define { '/tmp/hello1':
        contentvar => "hello there 1",
      }


      hello_define { '/tmp/hello2':
        contentvar => "hello there 2",
      }


    }
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

Stats

Asked: 2016-04-18 06:11:56 -0500

Seen: 68 times

Last updated: Apr 18 '16