inisital commit

This commit is contained in:
Olivier Barais
2021-12-02 11:43:36 +01:00
parent dd84b7dcab
commit 8545eb3d66
25 changed files with 515 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<html>
<head>
<title>Ansible Application</title>
</head>
<body>
</br>
<a href=http://{{ publicip }}/index.html>Homepage</a>
</br>
<?php
Print "Hello, World! I am a web server configured using Ansible and I am : ";
echo exec('hostname');
Print "</BR>";
echo "List of Databases: </BR>";
{% for host in groups['dbservers'] %}
$link = mysqli_connect('{{ databasepublicip }}', '{{ hostvars[host].dbuser }}', '{{ hostvars[host].upassword }}') or die(mysqli_connect_error($link));
{% endfor %}
$res = mysqli_query($link, "SHOW DATABASES;");
while ($row = mysqli_fetch_assoc($res)) {
echo $row['Database'] . "\n";
}
?>
</body>
</html>