Skip to main content

Webservers Role

Updated Jan 12, 2021 ·

Overview

This role configures web servers for the role-based Ansible project.

It keeps package installation, service handling, variables, and application files together in a reusable role layout.

Structure

PathPurpose
tasks/main.ymlMain web server setup tasks.
handlers/main.ymlService restart handlers.
files/index.phpSample PHP application file.
defaults/main.ymlDefault role variables.
vars/main.ymlRole variables.
vars/secrets.ymlVault-related variables for lab testing.
testsBasic role test inventory and playbook.

Usage

Use the role from a playbook.

- name: Configure web servers
hosts: webservers
become: true
roles:
- webservers