Commit 3183a785c7f1dcc1d92d3c02f9cc6ac040af3b99

Authored by grouille
1 parent 0163ddbb

Test de lancement d'Ansible depuis le site

Showing 3 changed files with 8 additions and 6 deletions   Show diff stats
site/reception.php
... ... @@ -53,16 +53,18 @@ if(isset($_POST['sensor']))
53 53 $message = "Upload du fichier réussi !";
54 54 $color = "alert-success";
55 55 $cmd = "ansible-playbook ../Ansible/taskPing.yml -i upload/inventaire.ini";
56   - if(shell_exec($cmd)==NULL)
  56 + system($cmd, $retval);
  57 + //$ansible = exec($cmd, $result);
  58 + $message = $message." Retour : ".$retval;
  59 + /*if($ansible!=NULL)
57 60 {
58   - // gestion de l'erreur
59   - $message = $message." Ansible est lancé !";
  61 + $message = $message." Ansible est lancé ! Retour : ".;
60 62 }
61 63 else
62 64 {
63 65 $message = $message." Echec du lancement d'Ansible !";
64 66 $color = "alert-danger";
65   - }
  67 + }*/
66 68 }
67 69 else
68 70 {
... ...
site/reponse.php
1 1 <div class="row">
2   - <div class="col-4 col-md-4 offset-4 offset-md-4" style="margin-bottom:20px; margin-top:60px;">
  2 + <div class="col-4 col-md-4 offset-4 offset-md-4" style="margin-top:60px;">
3 3 <br/>
4 4 <div class="alert <?php echo $color;?>" role="alert">
5 5 <?php echo $message;?>
... ...
site/tableau.php
1 1 <div class="row">
2 2 <div class="col-4 col-md-4 offset-4 offset-md-4">
3   - <h1 style="margin-bottom:20px; margin-top:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1>
  3 + <h1 style="margin-bottom:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1>
4 4 <table class="table table-striped table-bordered">
5 5 <tbody>
6 6 <tr>
... ...