The LAMP playbook
As mentioned at the start of this chapter when we discussed the playbook structure, the main playbook file is called site.yml
, which contains the following:
--- - name: "Install LAMP stack" hosts: ansible_hosts gather_facts: true become: true become_method: ansible.builtin.sudo vars_files: - group_vars/common.yml roles: - common - apache - mariadb - php
As you can see, it calls the four roles we have already walked through and also loads a variables
file from group_vars/common.yml
; this file contains an override for html_body
, which is configured in roles/apache/defaults/main.yml
and looks like the following:
html_body: | This HTML page has been deployed using Ansible to <b>{{ ansible_nodename }}</b>.<br> The user is...