mis-using ansible_ssh_host= ?

Dear List,

We have more then one “test environment” (of our production environment) installed on 1 giant machine. Simply put, the program is installed multiple times, under a different user account inside different directories.
The thing is, we are trying to manage these different environments using ansible.

For instance, stopping and starting these giant environments takes about 10 minutes each, so going over each environment 1 by 1 takes hours. So therefore we thought of making ansible believen each environment is actually one host, but simply pointing to the same “actual” server, like so:

[testenv]
ept1 ansible_ssh_host=taixkaren
ept2 ansible_ssh_host=taixkaren
ept3 ansible_ssh_host=taixkaren
ept4 ansible_ssh_host=taixkaren
ept5 ansible_ssh_host=taixkaren
eptm ansible_ssh_host=taixkaren
ebt1 ansible_ssh_host=taixkitty
ebt2 ansible_ssh_host=taixkitty
ebt3 ansible_ssh_host=taixkitty
ebt4 ansible_ssh_host=taixkitty

But alas, what happens is, is this:

https://dl.dropboxusercontent.com/u/7875588/console.txt

with the import bit being:

ssh connection closed waiting for sudo password prompt

You see, ansible tries to open multiple connections to the different “hosts” ending up, ofcourse, on the same physical one.

So when ansible opens up the same connection on the same server multiple times… Sudo goes awry

Any suggestions would ba greatly appreciated.

Thanks,
Mark

This may be related to the MaxAuthTries setting in your sshd_config file (coincidentally, I just learned about that setting myself from Jesse Keatings AnsibleFest presentation). Try upping that from the default (6 on my CentOS system) and see if it helps.

Hi James,

Unfortunately, that did not work… ;-( We have a support subscription. Could I use a support ticket on this? But keep the answers for the world to read here?
Mark Maas, Binckbank

Thanks,
Mark

Yes, absolutely. Just send an email to support@ansibleworks.com and we can cross-post here.

This may be related to the MaxAuthTries setting in your sshd_config file (coincidentally, I just learned about that setting myself from Jesse Keatings AnsibleFest presentation). Try upping that from the default (6 on my CentOS system) and see if it helps.

Hi James,

Unfortunately, that did not work… ;-( We have a support subscription. Could I use a support ticket on this? But keep the answers for the world to read here?

Wel when I add my public key to the root user of the server. and change my playbook a little like so:


  • name: Europort omgevingen
    hosts: epenvironments
    sudo: false
    user: root

Everything runs fine!

Leading me to think this is a sudo issue we need to track down?
Normally we connect to all servers under our own name and key, and use sudo: true everywhere.

We think / assume that is the most logical en secure way of handling this?

Thanks,
Mark