vagrant/libvirt/dcos/provisioning/inventory.py [38:113]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        sys.exit(1)

    return "config/cluster-" + ret + ".yaml"


def get_cluster_config_yml():
    '''Returns a list with hostname and IP'''
    with open(get_cluster_config_file(), 'r') as f:
        ret = yaml.load(f)

    return ret


def check_ssh(ip, user, key_file, initial_wait=0, interval=0, retries=1):
    logging.debug("[Ansible] checking SSH availability for %s", ip)
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    time.sleep(initial_wait)

    for x in range(retries):
        try:
            ssh.connect(ip, username=user, key_filename=key_file)
            return True
        except (paramiko.BadHostKeyException,
                paramiko.AuthenticationException,
                paramiko.SSHException,
                socket.error) as e:
            logging.debug(e)
            time.sleep(interval)

    return False


def check_ssh_available(cluster_yml):
    ssh_key_path = os.environ["HOME"] + "/.vagrant.d/insecure_private_key"

    # check if the hosts are ssh accesibles
    for item in cluster_yml:
        if check_ssh(item.get('ip'),
                     "vagrant",
                     ssh_key_path,
                     2, 2, 3):
            logging.debug(
                "[Ansible] %s: SSH is OK for provisioning", item)
        else:
            logging.debug("[Ansible] %s: SSH not ready", item)
            return False

    return True


logging.basicConfig(filename='.vagrant/inventory.log', level=logging.DEBUG)

all_vm_accesibles = False
logging.debug('[Ansible] getting host list from configuration')
cluster_yml = get_cluster_config_yml()


logging.debug("[Ansible] Sanity check loop for Ansible hosts")
while not all_vm_accesibles:
    logging.debug("[Ansible] Waiting for SSH to become available in all hosts")
    if check_ssh_available(cluster_yml):
        all_vm_accesibles = True


class InventoryTemplate:
    '''
    {
    "all": {
        "hosts": ["bt","a1","a2","p1","m1","m2","m3"],
        "vars": {
                    "ansible_user": "vagrant",
                    "ansible_become": "true"
                }
    },
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



vagrant/libvirt/mesos/provisioning/inventory.py [38:113]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        sys.exit(1)

    return "config/cluster-" + ret + ".yaml"


def get_cluster_config_yml():
    '''Returns a list with hostname and IP'''
    with open(get_cluster_config_file(), 'r') as f:
        ret = yaml.load(f)

    return ret


def check_ssh(ip, user, key_file, initial_wait=0, interval=0, retries=1):
    logging.debug("[Ansible] checking SSH availability for %s", ip)
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    time.sleep(initial_wait)

    for x in range(retries):
        try:
            ssh.connect(ip, username=user, key_filename=key_file)
            return True
        except (paramiko.BadHostKeyException,
                paramiko.AuthenticationException,
                paramiko.SSHException,
                socket.error) as e:
            logging.debug(e)
            time.sleep(interval)

    return False


def check_ssh_available(cluster_yml):
    ssh_key_path = os.environ["HOME"] + "/.vagrant.d/insecure_private_key"

    # check if the hosts are ssh accesibles
    for item in cluster_yml:
        if check_ssh(item.get('ip'),
                     "vagrant",
                     ssh_key_path,
                     2, 2, 3):
            logging.debug(
                "[Ansible] %s: SSH is OK for provisioning", item)
        else:
            logging.debug("[Ansible] %s: SSH not ready", item)
            return False

    return True


logging.basicConfig(filename='.vagrant/inventory.log', level=logging.DEBUG)

all_vm_accesibles = False
logging.debug('[Ansible] getting host list from configuration')
cluster_yml = get_cluster_config_yml()


logging.debug("[Ansible] Sanity check loop for Ansible hosts")
while not all_vm_accesibles:
    logging.debug("[Ansible] Waiting for SSH to become available in all hosts")
    if check_ssh_available(cluster_yml):
        all_vm_accesibles = True


class InventoryTemplate:
    '''
    {
    "all": {
        "hosts": ["bt","a1","a2","p1","m1","m2","m3"],
        "vars": {
                    "ansible_user": "vagrant",
                    "ansible_become": "true"
                }
    },
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



