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

What are the special tags `always`, `never`, `tagged`, `untagged` and `all`?

IntermediateConceptPlaybooks, Plays, Tasks and Handlers
Answer
  • always — runs even when you select other tags (unless --skip-tags always). Good for facts or setup that later tasks need.
  • never — task is skipped unless you explicitly request it by a tag it has too, such as [never, debug]. Good for dangerous or rare tasks.
  • tagged / untagged — as arguments to --tags, select any tagged or untagged tasks.
  • all — the default, run everything except never.
- ansible.builtin.command: /opt/app/wipe-cache
  tags: [never, wipe_cache]
All Ansible questions Roadmap: Ansible

More on Playbooks, Plays, Tasks and Handlers