added inventory finsing

This commit is contained in:
CHIEFSOFT\ameye
2025-01-19 19:01:37 -05:00
parent 2b7f61f103
commit f4d1b12c5b
4 changed files with 43 additions and 72 deletions
+8 -2
View File
@@ -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);
}