DevOps Bootcamp · Lesson

The always & never Special Tags

Force or block tasks regardless.

Lesson 3 of 413 steps

The always & never Special Tags is a free DevOps Bootcamp lesson on CoddyKit. This is lesson 3 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.

Two Reserved Tags

Ansible reserves two special tag names with built-in behavior: always and never. They are not filters but rules. 🔒

always Runs Every Time

A task tagged always runs in every play, no matter which --tags you pass. It is perfect for must-do setup.

- name: Gather setup
  ansible.builtin.setup:
  tags:
    - always

Skipping always

There is one escape hatch: passing --skip-tags always will exclude even those tasks when you really need to.

ansible-playbook site.yml --skip-tags always

A Good Use for always

Loading variables or facts that later tasks depend on is ideal for always, so they exist no matter how you filter.

- ansible.builtin.include_vars: app.yml
  tags:
    - always

never Stays Hidden

A task tagged never is skipped by default. It runs only when you explicitly ask for it or another of its tags.

- name: Wipe database
  ansible.builtin.command: drop-all
  tags:
    - never
    - debug

Opting Into never

To run a never task, name it directly with --tags. Asking for it overrides the default skip.

ansible-playbook site.yml --tags debug

never for Dangerous Steps

Use never to guard risky or rarely needed tasks, like destructive cleanup, so they never fire by accident.

Pairing never With a Real Tag

Give a never task a second tag too. Then you trigger it by that friendly name while never keeps it safely off by default.

always Beats Selection

Even if you run --tags config, every always task still executes alongside your selected ones. It is additive.

Two Opposite Defaults

Remember the symmetry: always opts a task in unless skipped, and never opts it out unless requested.

A Safe Cleanup Task

This destructive task carries never plus a cleanup tag, so it only runs when you deliberately ask for cleanup. 🛡️

- name: Reset state
  ansible.builtin.command: reset.sh
  tags:
    - never
    - cleanup

Quick Check

A task is tagged only with never. When does it run?

Recap

You learned always runs unless skipped, and never stays off until you explicitly request its tag, guarding risky tasks. ✅

Free to start

Learn DevOps Bootcamp with an AI tutor — free

Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.

Courses
142
Lessons
568

Frequently Asked Questions

Is the “The always & never Special Tags” lesson free?

Yes — any 3 lessons of the DevOps Bootcamp learning path, including “The always & never Special Tags”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.

What will I learn in “The always & never Special Tags”?

Force or block tasks regardless. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 3 of 4.

How long does the “The always & never Special Tags” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Tagging Tasks, Plays & Roles
  2. Filter Runs with --tags & --skip-tags
  3. The always & never Special Tags
  4. List Tags & Tasks Before Running
← Back to DevOps Bootcamp