Commit 2f08e98b938bb49ca412f1dedbb9e77df779d0dc
1 parent
b81c3e23
Test
Showing
2 changed files
with
3 additions
and
1 deletions
Show diff stats
site/add.php
@@ -43,6 +43,9 @@ session_start(); | @@ -43,6 +43,9 @@ session_start(); | ||
43 | $ini = $ini.$_POST['raspberry']." capteur=".$_POST['numero']." setup=".$setup."\n"; | 43 | $ini = $ini.$_POST['raspberry']." capteur=".$_POST['numero']." setup=".$setup."\n"; |
44 | file_put_contents('upload/inventaire.ini', $ini); | 44 | file_put_contents('upload/inventaire.ini', $ini); |
45 | setup($_POST['raspberry']); | 45 | setup($_POST['raspberry']); |
46 | + $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini"; | ||
47 | + $retour = system($cmd, $retval); | ||
48 | + $message = $message." Retour : ".$retval."---".$retour; | ||
46 | ?> | 49 | ?> |
47 | <div class="alert alert-success" role="alert"> | 50 | <div class="alert alert-success" role="alert"> |
48 | Le capteur a bien été ajouté ! | 51 | Le capteur a bien été ajouté ! |
site/reception.php
@@ -53,7 +53,6 @@ if(isset($_POST['sensor'])) | @@ -53,7 +53,6 @@ if(isset($_POST['sensor'])) | ||
53 | $message = "Upload du fichier réussi !"; | 53 | $message = "Upload du fichier réussi !"; |
54 | $color = "alert-success"; | 54 | $color = "alert-success"; |
55 | $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini"; | 55 | $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini"; |
56 | - $cmd = "ping 172.26.145.113"; | ||
57 | $retour = system($cmd, $retval); | 56 | $retour = system($cmd, $retval); |
58 | //$ansible = exec($cmd, $result); | 57 | //$ansible = exec($cmd, $result); |
59 | $message = $message." Retour : ".$retval."---".$retour; | 58 | $message = $message." Retour : ".$retval."---".$retour; |