/etc/ansible/hosts

www.example.com
db.example.com
 
[www]
www.example.com
 
[db]
db.example.com