Playbooks
Playbooks
Playbooks are the core of Jetpack automation.
Structure
A playbook is a YAML file containing one or more plays:
- name: Configure web servers
hosts: webservers
tasks:
- name: Install nginx
package:
name: nginx
state: present
- name: Start nginx
service:
name: nginx
state: started
enabled: truePlays
Each play targets a group of hosts and defines tasks to execute.
Tasks
Tasks are the individual units of work. Each task uses a module to perform an action.
Modules
Jetpack includes modules for common operations:
package- Install and manage packagesservice- Manage system servicesfile- Create and manage filestemplate- Render templatescommand- Run shell commandscopy- Copy files to remote hosts