Fixes compatibility with Consistent Network Device Naming scheme

Fixes compatibility with CentOS and other OSes that use Consistent
Network Device Naming.
pull/63/head
varnav 9 years ago
parent 323b4a4a5e
commit 4229b7ab66
  1. 4
      lamp_simple/roles/web/templates/index.php.j2

@ -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)) {