Overriding variables

Before we finish, we should quickly discuss how we can override the default variables we have been setting. To do this, add the following lines to group_vars/common.yml file:

html_body: |  This HTML page has been deployed using Ansible to <b>{{ ansible_nodename }}</b>.<br>  The user is <b>{{ users.0.name }}</b> who is in the <b>{{ apache_group }}</b> group.<br>  The weboot is <b>{{ document_root }}</b>, the default index file is <b>{{ index_file }}</b>.<br>  You can access a <a href="/info.php">PHP Info file</a> or <a href="/adminer/">Adminer</a>.

Then, rerun the playbook. Once the playbook has finished, opening http://192.168.50.4.nip.io/ will show you the following page:

As you can see, the default index.html page has ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.