Commit 0163ddbb4b9595b621938b3162ca5d36644d3ab5
1 parent
2a801f51
Test de lancement d'Ansible depuis le site
Showing
3 changed files
with
5 additions
and
5 deletions
Show diff stats
site/reception.php
@@ -46,14 +46,14 @@ if(isset($_POST['sensor'])) | @@ -46,14 +46,14 @@ if(isset($_POST['sensor'])) | ||
46 | 46 | ||
47 | if(!$err) | 47 | if(!$err) |
48 | { | 48 | { |
49 | - file_put_contents('upload/inventaire.ini', $ini) | 49 | + file_put_contents('upload/inventaire.ini', $ini); |
50 | $upload = load($_FILES['fichier']['tmp_name'], $_FILES['fichier']['name']); | 50 | $upload = load($_FILES['fichier']['tmp_name'], $_FILES['fichier']['name']); |
51 | if($upload) | 51 | if($upload) |
52 | { | 52 | { |
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 | - /*if(shell_exec($cmd)==NULL) | 56 | + if(shell_exec($cmd)==NULL) |
57 | { | 57 | { |
58 | // gestion de l'erreur | 58 | // gestion de l'erreur |
59 | $message = $message." Ansible est lancé !"; | 59 | $message = $message." Ansible est lancé !"; |
@@ -62,7 +62,7 @@ if(isset($_POST['sensor'])) | @@ -62,7 +62,7 @@ if(isset($_POST['sensor'])) | ||
62 | { | 62 | { |
63 | $message = $message." Echec du lancement d'Ansible !"; | 63 | $message = $message." Echec du lancement d'Ansible !"; |
64 | $color = "alert-danger"; | 64 | $color = "alert-danger"; |
65 | - }*/ | 65 | + } |
66 | } | 66 | } |
67 | else | 67 | else |
68 | { | 68 | { |
site/reponse.php
1 | <div class="row"> | 1 | <div class="row"> |
2 | - <div class="col-4 col-md-4 offset-4 offset-md-4"> | 2 | + <div class="col-4 col-md-4 offset-4 offset-md-4" style="margin-bottom:20px; margin-top:60px;"> |
3 | <br/> | 3 | <br/> |
4 | <div class="alert <?php echo $color;?>" role="alert"> | 4 | <div class="alert <?php echo $color;?>" role="alert"> |
5 | <?php echo $message;?> | 5 | <?php echo $message;?> |
site/tableau.php
1 | <div class="row"> | 1 | <div class="row"> |
2 | <div class="col-4 col-md-4 offset-4 offset-md-4"> | 2 | <div class="col-4 col-md-4 offset-4 offset-md-4"> |
3 | - <h1 style="margin-bottom:20px; margin-top:60px; 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; margin-top:20px; border-bottom:1px solid #CCC; padding-bottom:20px;"><i class="fa fa-info-circle"></i> Informations complémentaires</h1> |
4 | <table class="table table-striped table-bordered"> | 4 | <table class="table table-striped table-bordered"> |
5 | <tbody> | 5 | <tbody> |
6 | <tr> | 6 | <tr> |