provison files
This commit is contained in:
@@ -13,7 +13,7 @@ class Provision extends BaseController
|
||||
|
||||
$this->updateProvision();
|
||||
|
||||
// $this->runAnsibleShell();
|
||||
$this->runAnsibleShell('94099_devprov_mermsemr_com.yml');
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -202,16 +202,18 @@ class Provision extends BaseController
|
||||
$data["product_uid"] = $provisionUID;
|
||||
$this->APIcall("GET", 'http://10.0.0.32:5006/broadcast/provisionings', $data);
|
||||
|
||||
} catch (Exception $e) {
|
||||
} catch ( \Exception $e) {
|
||||
// echo 'Caught exception: ', $e->getMessage(), "\n";
|
||||
log_message('critical', "***** ***** Provision Error:: provisionActions() ".$e->getMessage());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public function runAnsibleShell(){
|
||||
public function runAnsibleShell($provisionFile){
|
||||
try{
|
||||
$output = shell_exec('ansible-playbook --ask-become-pass --key-file ~/.ssh/ansible_worker -i inventory 94099_devprov_mermsemr_com.yml');
|
||||
log_message('critical', "***** ***** Provision :: runAnsibleShell($provisionFile) ");
|
||||
$shellCommand ="ansible-playbook --vault-password-file secrets.pass --key-file ~/.ssh/ansible_worker -i inventory $provisionFile";
|
||||
$output = shell_exec($shellCommand );
|
||||
log_message('critical', "***** ***** Provision :: runAnsibleShell(output) ".$output);
|
||||
} catch ( \Exception $e){
|
||||
log_message('critical', "***** ***** Provision Error:: runAnsibleShell() ".$e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user