Interview Prep/Ansible/Playbooks, Plays, Tasks and Handlers

What does the `meta` module do? Name useful actions.

AdvancedConceptPlaybooks, Plays, Tasks and Handlers
Answer

meta tasks influence Ansible's own execution rather than the host.

  • flush_handlers — run pending handlers now
  • refresh_inventory — reload inventory (after add_host/cloud changes)
  • clear_facts / clear_host_errors — reset cached facts or failed state
  • end_play — stop the whole play without failure
  • end_host — stop this host only; end_batch — stop the current serial batch
  • reset_connection — drop the connection so new group membership (for example after adding a user to docker) takes effect
  • noop — do nothing
- ansible.builtin.meta: end_play
  when: skip_all | default(false)

meta tasks cannot be used with loop, and when is evaluated per host.

All Ansible questions Roadmap: Ansible

More on Playbooks, Plays, Tasks and Handlers