Lab 4: Roles & Structure

Intermediate 60 minutes Intermediate Labs

Learning Objectives

  • Understand role directory structure
  • Create tasks, handlers, and defaults
  • Use roles in playbooks
  • Share variables between roles

Progress

0 of 3 tasks completed

Tasks

1
Create Role Structure
Simulate a role structure with tasks and handlers
2
Define Role Tasks
Create reusable tasks that can be shared
3
Use Handlers
Create handlers that respond to task changes
Hints for Task
    Playbook
    Inventory
    --- - name: Roles and Structure Lab hosts: localhost gather_facts: yes vars: # Define role-like variables here tasks: # Create tasks that simulate a role structure handlers: # Define handlers here
    localhost ansible_connection=local
    Output
    Waiting for playbook execution...