In inventory:
[centos] centos1 ansible_port=2222 centos[2:3] [centos:vars] ansible_user=root [ubuntu] ubuntu[1:3] [ubuntu:vars] ansible_become=true ansible_become_password=password