August 2015
Intermediate to advanced
168 pages
3h 32m
English
We created a site-wide playbook and used an include statement to call another playbook by the name www.yml. We will now create this file with one play, which maps our web server hosts to the Nginx role:
---
#www.yml : playbook for web servers
- hosts: www
remote_user: vagrant
sudo: yes
roles:
- nginxThe above code works as follows:
[www] group specified in the hosts file.roles/nginx/* file, include roles/nginx/*/main.yml to the play. This includes tasks, handlers, vars, meta, default, and so on. This is where the auto include rules apply.By default, Ansible looks inside the roles/ subdirectory of the project that we ...
Read now
Unlock full access