'Wait for instance to respond to ansible ping.'

def wait(self):

    extra_vars = [('ansible_host=%s' % self.core_ci.connection.hostname), ('ansible_port=%s' % self.core_ci.connection.port), 'ansible_connection=local', ('ansible_ssh_private_key_file=%s' % self.core_ci.ssh_key.key)]
    name = ('%s-%s' % (self.core_ci.platform, self.core_ci.version.replace('.', '-')))
    env = ansible_environment(self.core_ci.args)
    cmd = ['ansible', '-m', ('%s_command' % self.core_ci.platform), '-a', 'commands=?', '-u', self.core_ci.connection.username, '-i', ('%s,' % name), '-e', '    '.join(extra_vars), name]
    for _ in range(1, 90):
        try:
            run_command(self.core_ci.args, cmd, env=env)
            return
        except SubprocessError:
            sleep(10)
            continue
    raise ApplicationError(('Timeout    waiting    for    %s/%s    instance    %s.' % (self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id)))
