serilaze output
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user