From 3183a785c7f1dcc1d92d3c02f9cc6ac040af3b99 Mon Sep 17 00:00:00 2001 From: grouille Date: Wed, 25 Mar 2020 14:49:23 +0100 Subject: [PATCH] Test de lancement d'Ansible depuis le site --- site/reception.php | 10 ++++++---- site/reponse.php | 2 +- site/tableau.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/site/reception.php b/site/reception.php index c5dd35c..4de4285 100644 --- a/site/reception.php +++ b/site/reception.php @@ -53,16 +53,18 @@ if(isset($_POST['sensor'])) $message = "Upload du fichier réussi !"; $color = "alert-success"; $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini"; - if(shell_exec($cmd)==NULL) + system($cmd, $retval); + //$ansible = exec($cmd, $result); + $message = $message." Retour : ".$retval; + /*if($ansible!=NULL) { - // gestion de l'erreur - $message = $message." Ansible est lancé !"; + $message = $message." Ansible est lancé ! Retour : ".; } else { $message = $message." Echec du lancement d'Ansible !"; $color = "alert-danger"; - } + }*/ } else { diff --git a/site/reponse.php b/site/reponse.php index 4ba0c29..2074823 100644 --- a/site/reponse.php +++ b/site/reponse.php @@ -1,5 +1,5 @@
-
+