def METHOD_NAME(inventory, image, image_type, server_type, verbose):
    if not image:
        image_name = 'Fedora-Cloud-Base-32'
    else:
        image_name = image
    if verbose:
        openstack.enable_logging(True, stream=sys.stdout)
    conn = create_connection(OS_AUTH_URL, OS_REGION_NAME,
                             OS_PROJECT_NAME, OS_USERNAME,
                             OS_PASSWORD)
    print(image)
    image_list = list_images(conn, image)
    network = None
    if image_name not in image_list:
        print("ERROR: No image found.")
        sys.exit(1)
    print("Using Image: {}".format(image_name))
    server = spawn_server(conn, image_name, server_type=server_type)
    if not server:
        print("ERROR: Unable to provision machine")
        sys.exit(1)
    for key in server.addresses.keys():
        network = server.addresses[key][0]
        print("OSP Machine name: {}".format(server.name))
        print("Server ip: {}".format(network['addr']))
    data = ["[all]\n"]
    if os.path.isfile(inventory):
        with open(inventory, 'r') as f:
            data = f.readlines()
    data = [i.strip() for i in data]
    index = data.index("[all]")
    data.insert(index + 1, "{} hostname={}".format(network['addr'], network['addr']))
    if "[{}]".format(server_type) in data:
        index = data.index("[{}]".format(server_type))
        data.insert(index + 1, "{} hostname={}".format(network['addr'], network['addr']))
    else:
        data.extend(["\n[{}]".format(server_type),
                     "{} hostname={}".format(network['addr'], network['addr'])])
    with open(inventory, 'w') as f:
        print(data)
        file_data = "\n".join(data)
        f.write(file_data)