puppetpuppetlabs-apache

Can I take create_resources as requirement to exec command


Can I use create_resources as requirement in a exec command in puppet class

$configFileDetails = getConfigFileDetails($allConfigurations['configurations'])
create_resources(change_config::fill_template, $configFileDetails)


   Change_config::Fill_template<| |> -> Exec<| title == "strating" |>

   exec { "strating":
        user        => 'root',
        environment => "JAVA_HOME=/home/ubuntu/tools/jdk1.6.0_45",
        path        => $command_path,
        command     => "sh ${agentLocation}/${product_pack}/bin/server.sh ${serverOptions}",
        logoutput => true,
        timeout => 3600,
   }

}

Is there a way to use the create_resources as the requirement for exec here ?


Solution

  • I guess you mean by requiring create_resources to require the created resources, if so then you can use a collector ensure order

    exec { "strating" :
       ....
    }
    Myclass::Myfunc <||> -> Exec <| title == "strating" |> 
    

    Hope this helps