using custom vars in group_by

Hi,
I want to be able to execute tasks on a subgroup of servers. It can be done via groups ([dbservers_cannary]) in the inventory file, but after checking out group_by funcionality, I thought of just adding a variable to the host in order to identify its pertenence to the subgroup.
This is for the cannary release before full deploy.
The code below doesn’t work as originally intented. Any idea what I am missing?
Regards,
Osvaldo

$ cat inventory
[dbservers]
db1 ansible_connection=local deploy=release
db2 ansible_connection=local deploy=cannary
db3 ansible_connection=local deploy=release
[wwwservers]
web1 ansible_connection=local deploy=cannary
web2 ansible_connection=local deploy=release
web3 ansible_connection=local deploy=release
$ cat vars.yml