serilaze output

This commit is contained in:
CHIEFSOFT\ameye
2025-01-25 15:33:11 -05:00
parent bf86edd465
commit dfb17b92f2
+7 -8
View File
@@ -219,23 +219,22 @@ class Provision extends BaseController
public function releaseProvision(){
// Use ls command with shell_exec function
$output = shell_exec('ls -alt /var/www/html/ANSIBLE/');
//$output = shell_exec('ls -alt /var/www/html/ANSIBLE/');
//
//// Display the list of all files and directories
//echo "<pre>$output</pre>";
//log_message('critical', "Test poath -> ".$output);
// Display the list of all files and directories
echo "<pre>$output</pre>";
log_message('critical', "Test poath -> ".$output);
$this->runAnsibleShell('a file wll be sent');
$this->runAnsibleShell('a file wll be sent');
return 0;
}
public function runAnsibleShell($provisionFile){
try{
log_message('critical', "***** ***** Provision :: runAnsibleShell($provisionFile) ");
$shellCommand ="/var/www/html/ANSIBLE/auto_play.sh ";
log_message('critical', $shellCommand);
$output = shell_exec($shellCommand );
// var_dump($output);
log_message('critical', "***** ***** Provision :: runAnsibleShell(output) AFTER SHELL RUN ".$output);
log_message('critical', "***** ***** Provision :: runAnsibleShell(output) AFTER SHELL RUN ".serialize($output));
// $shellCommand ="ansible-playbook --vault-password-file /var/www/html/ANSIBLE/secrets.pass --key-file ~/.ssh/ansible_worker -i /var/www/html/ANSIBLE/inventory $provisionFile";
// log_message('critical', $shellCommand);