Daily challenges →
🌊 Ansible medium ⚡ 65 XP

How do host_vars and group_vars work in Ansible?

Variable precedence (low → high): role defaults, inventory group_vars/all, group_vars/<group>, host_vars/<host>, play vars, task vars. host_vars beat group_vars for the same variable name.

🌊 This is a free sample — 507+ more questions on DevOps Ocean

Sign in free to practice the full question bank with daily challenges, XP, streaks, duels and a global leaderboard.

Practice the full bank — free →