From dfb17b92f23dac273094975f8673a3fce7bce21c Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 25 Jan 2025 15:33:11 -0500 Subject: [PATCH] serilaze output --- app/Controllers/Provision.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Controllers/Provision.php b/app/Controllers/Provision.php index 3564b98..6292ec9 100644 --- a/app/Controllers/Provision.php +++ b/app/Controllers/Provision.php @@ -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 "
$output
"; +//log_message('critical', "Test poath -> ".$output); - // Display the list of all files and directories - echo "
$output
"; - 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);