asible create added
This commit is contained in:
@@ -8,4 +8,35 @@ class Home extends BaseController
|
||||
{
|
||||
return view('welcome_message');
|
||||
}
|
||||
|
||||
public function provision(): string
|
||||
{
|
||||
$public_path = FCPATH;
|
||||
$ansible_folder = str_replace("public/", "ANSIBLE", $public_path);
|
||||
$mysql = "SELECT id, internal_url FROM members_products";
|
||||
$query = $this->db->query($mysql);
|
||||
// $num = $query->num_rows();
|
||||
$provision_list= $query->getResult();
|
||||
//$provision_list =[];
|
||||
foreach ($provision_list as $pr){
|
||||
|
||||
$prov_name = str_replace(".", "_", $pr->internal_url).".yml";
|
||||
|
||||
$myfile = fopen( $ansible_folder ."/".$prov_name, "w") or die("Unable to open file!");
|
||||
$txt = "John Doe\n";
|
||||
fwrite($myfile, $txt);
|
||||
$txt = "Jane Doe\n";
|
||||
fwrite($myfile, $txt);
|
||||
fclose($myfile);
|
||||
}
|
||||
|
||||
// echo (__dir__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return view('welcome_message');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user