|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
</head> |
|
|
|
|
<body> |
|
|
|
|
</br> |
|
|
|
|
<a href=http://{{ ansible_eth0.ipv4.address }}/index.html>Homepage</a> |
|
|
|
|
<a href=http://{{ ansible_default_ipv4.address }}/index.html>Homepage</a> |
|
|
|
|
</br> |
|
|
|
|
<?php |
|
|
|
|
Print "Hello, World! I am a web server configured using Ansible and I am : "; |
|
|
|
@ -12,7 +12,7 @@ |
|
|
|
|
Print "</BR>"; |
|
|
|
|
echo "List of Databases: </BR>"; |
|
|
|
|
{% for host in groups['dbservers'] %} |
|
|
|
|
$link = mysql_connect('{{ hostvars[host].ansible_eth0.ipv4.address }}', '{{ hostvars[host].dbuser }}', '{{ hostvars[host].upassword }}') or die(mysql_error()); |
|
|
|
|
$link = mysql_connect('{{ hostvars[host].ansible_default_ipv4.address }}', '{{ hostvars[host].dbuser }}', '{{ hostvars[host].upassword }}') or die(mysql_error()); |
|
|
|
|
{% endfor %} |
|
|
|
|
$res = mysql_query("SHOW DATABASES"); |
|
|
|
|
while ($row = mysql_fetch_assoc($res)) { |
|
|
|
|