0Pricing
DevOps Bootcamp · Lesson

Filter Runs with --tags & --skip-tags

Execute a subset of work.

Filter Runs with --tags & --skip-tags is a free DevOps Bootcamp lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Run Only a Slice

Once tasks are tagged, the --tags option tells ansible-playbook to run only the tasks carrying those labels. ⚡

ansible-playbook site.yml --tags install

Several Tags at Once

Pass a comma-separated list to --tags. Any task matching at least one of those tags will run.

ansible-playbook site.yml --tags "install,config"

Skip Instead of Select

The mirror option is --skip-tags. It runs everything except the tasks carrying the tags you name.

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

Skip Many Tags

Like --tags, --skip-tags also takes a comma-separated list, letting you exclude several groups of work in one go.

ansible-playbook site.yml --skip-tags "deploy,restart"

Untagged Tasks

When you use --tags, any task without a matching tag is skipped. Tag selection is exclusive by default.

The tagged Keyword

Use the special value tagged to run every task that has any tag at all, no matter which one.

ansible-playbook site.yml --tags tagged

The untagged Keyword

The opposite is untagged, which runs only tasks that carry no tags. Handy for catching the leftovers.

ansible-playbook site.yml --tags untagged

The all Keyword

all is the default behavior: every task runs. You rarely type it, but it pairs nicely with --skip-tags.

ansible-playbook site.yml --tags all

Combining Select and Skip

You can mix both options. Ansible first picks the --tags set, then removes anything matching --skip-tags from it.

ansible-playbook site.yml --tags web --skip-tags restart

A Real Iteration Loop

Tweaking just one config file? Run only its config tag to test fast, instead of rerunning the whole playbook. 🔁

ansible-playbook site.yml --tags config

Roles Respect Tags Too

Filtering with --tags reaches inside roles. Only the role tasks whose tags match will run, so reuse stays selective.

Quick Check

You run a playbook with --tags install. What runs?

Recap

You learned to target work with --tags, exclude it with --skip-tags, and use special selectors like tagged, untagged and all. ✅

Frequently asked questions

Is the “Filter Runs with --tags & --skip-tags” lesson free?

Yes — the full text of “Filter Runs with --tags & --skip-tags” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.

What will I learn in “Filter Runs with --tags & --skip-tags”?

Execute a subset of work. 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; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Filter Runs with --tags & --skip-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