Wednesday, March 4, 2015

Changing SSH port for dynamic inventory script in Ansible

If you have to write dynamic inventory script in Ansible, but need to use SSH port which is not 22, there is example output of the script output:


{"databases":{
    "hosts":["127.0.0.1"],
    "vars":{
        "ansible_ssh_port":2222
        }
    }
}



1 comment:

  1. Thank you, this was just was I was looking for. I was surprised you couldn't use IP:PORT

    ReplyDelete