I found the problem, I wasn't putting the priority inside "vars". The inventory 
that works is this one:
______________
#!/bin/bash
cat << EOF
{
  "cluster_1": {
    "hosts": [
      "host1"
    ],
    "vars": {
      "ansible_group_priority": 10
    }
  },
  "role_1": {
    "hosts": [
      "host1",
      "host2",
      "host3",
    ],
    "vars": {
      "ansible_group_priority": 1
    }
  }
}
EOF
______________

This returns "role" when running the playbook, as I was expecting.

Thanks a lot!!!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/698a68dd-07f8-4962-b514-c1a44fa3c7aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to