Exercise 2: A curl + cron Playbook — Possible Solution ==================================================================== --- - name: Ensure curl is installed and cron is running hosts: all become: true tasks: - name: Install curl apt: name: curl state: present - name: Start cron service: name: cron state: started Explanation: This mirrors the chapter's own nginx example structure exactly, with the specific package/service names swapped in per the exercise's own requirements. hosts: all targets every host in the inventory rather than a specific group. become: true is still needed here, since installing packages and managing services both require elevated privileges the same way the chapter's own nginx example did. The first task uses the apt module with state: present to ensure curl is installed (present, not a specific version, meaning "install it if it's missing, leave it alone if it's already there" -- the idempotent behavior the course will formalize in ansible1-4). The second task uses the service module with state: started to ensure the cron service is actively running, following the exact same two-module pattern (apt for installation, service for runtime state) the chapter's own example established. WHY THIS WORKS AS AN ANSWER ------------------------------ This builds a correctly structured playbook using the same two modules and overall shape as the chapter's own worked example, with the target group and package/service names adjusted to match the exercise's specific requirements.