Malintha
Malintha

Reputation: 4766

Puppet : How to use "defined" type as requirement inside exec

I have defined type as follows

define fill_templates() {
    $fileName = $name["filename"]                                                      
    $fileLocation = $name["filelocation"]  
    file { "${fileLocation}/${fileName}/":
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0777',
        content => template("config/${fileName}.erb"),
    require => Exec["unzip_pack"],
}

}

And I call that type as

fill_templates { $foo:}

I want to make this a pre-requirement to my another exec. So I want to make it "require" for that exec.

exec { "strating":
    user       => 'root',
    environment => 'JAVA_HOME=/home/agent2/jdk1.6.0',
    path        => $command_path,
    command    => "${agents_location}/...../bin/myFiler.sh",
   logoutput => true,
timeout => 3600,
require =>XXXXXXXXXXX,
  }

How Can I do that ?

Upvotes: 1

Views: 676

Answers (1)

Sekm
Sekm

Reputation: 1676

This should do the trick:

require => Fill_templates[$foo],

The capitalisation is important.

Upvotes: 3

Related Questions