added inventory finsing
This commit is contained in:
@@ -20,12 +20,18 @@ class Home extends BaseController
|
||||
//$provision_list =[];
|
||||
foreach ($provision_list as $pr){
|
||||
|
||||
$productId = $pr->product_id;
|
||||
|
||||
$prov_name = str_replace(".", "_", $pr->internal_url).".yml";
|
||||
$template_file = $ansible_folder ."/templates/".$pr->product_id.".yml";
|
||||
$template_content = file_get_contents($template_file);
|
||||
|
||||
// GET THE TEMPLATE FOR THIS PROVISIONING
|
||||
$template_content = file_get_contents($template_file);
|
||||
$template_content_processed = str_replace("WHAT_HOST_IN_USE", $productId."_SERVER", $template_content);;
|
||||
|
||||
// CREATE PROVISOINING FILE
|
||||
$myfile = fopen( $ansible_folder ."/".$prov_name, "w") or die("Unable to open file!");
|
||||
fwrite($myfile, $template_content);
|
||||
fwrite($myfile, $template_content_processed);
|
||||
fclose($myfile);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user