Example #1
0
def configure_zfs(node, variants):
    """
    Configure ZFS for use as a Flocker backend.

    :param INode node: The node to configure ZFS on.
    :param set variants: The set of variant configurations to use when

    :return Effect:
    """
    return sequence([
        run_remotely(
            username='******',
            address=node.address,
            commands=task_upgrade_kernel(
                distribution=node.distribution),
        ),
        node.reboot(),
        run_remotely(
            username='******',
            address=node.address,
            commands=sequence([
                task_install_zfs(
                    distribution=node.distribution,
                    variants=variants),
                task_create_flocker_pool_file(),
            ]),
        ),
        Effect(
            Func(lambda: configure_ssh(node.address, 22))),
    ])
Example #2
0
def configure_zfs(node, variants):
    """
    Configure ZFS for use as a Flocker backend.

    :param INode node: The node to configure ZFS on.
    :param set variants: The set of variant configurations to use when

    :return Effect:
    """
    return sequence([
        run_remotely(
            username='******',
            address=node.address,
            commands=task_upgrade_kernel(
                distribution=node.distribution),
        ),
        node.reboot(),
        run_remotely(
            username='******',
            address=node.address,
            commands=sequence([
                task_install_zfs(
                    distribution=node.distribution,
                    variants=variants),
                task_create_flocker_pool_file(),
            ]),
        ),
        Effect(
            Func(lambda: configure_ssh(node.address, 22))),
    ])
Example #3
0
def configure_cluster(control_node, agent_nodes):
    """
    Configure flocker-control, flocker-agent and flocker-container-agent
    on a collection of nodes.

    :param INode control_node: The control node.
    :param INode agent_nodes: List of agent nodes.
    """
    return sequence([
        run_remotely(
            username='******',
            address=control_node.address,
            commands=task_enable_flocker_control(control_node.distribution),
        ),
        sequence([
            sequence([
                Effect(
                    Func(lambda node=node: configure_ssh(node.address, 22))),
                run_remotely(
                    username='******',
                    address=node.address,
                    commands=task_enable_flocker_agent(
                        distribution=node.distribution,
                        control_node=control_node.address,
                    ),
                ),
            ]) for node in agent_nodes
        ])
    ])
Example #4
0
def configure_cluster(control_node, agent_nodes):
    """
    Configure flocker-control and flocker-agent on a collection of nodes.

    :param bytes control_node: The address of the control node.
    :param list agent_nodes: List of addresses of agent nodes.
    """
    return sequence([
        run_remotely(
            username='******',
            address=control_node,
            commands=task_enable_flocker_control(),
        ),
        sequence([
            sequence([
                Effect(Func(lambda node=node: configure_ssh(node, 22))),
                run_remotely(
                    username='******',
                    address=node,
                    commands=task_enable_flocker_agent(
                        node_name=node,
                        control_node=control_node,
                    ),
                ),
            ]) for node in agent_nodes
        ])
    ])
Example #5
0
def configure_cluster(control_node, agent_nodes):
    """
    Configure flocker-control and flocker-agent on a collection of nodes.

    :param bytes control_node: The address of the control node.
    :param list agent_nodes: List of addresses of agent nodes.
    """
    run(
        username='******',
        address=control_node,
        commands=task_enable_flocker_control(),
    )
    for node in agent_nodes:
        configure_ssh(node, 22)
        run(
            username='******',
            address=node,
            commands=task_enable_flocker_agent(
                node_name=node,
                control_node=control_node,
            ),
        )
Example #6
0
def configure_cluster(control_node, agent_nodes):
    """
    Configure flocker-control and flocker-agent on a collection of nodes.

    :param bytes control_node: The address of the control node.
    :param list agent_nodes: List of addresses of agent nodes.
    """
    run(
        username='******',
        address=control_node,
        commands=task_enable_flocker_control(),
    )
    for node in agent_nodes:
        configure_ssh(node, 22)
        run(
            username='******',
            address=node,
            commands=task_enable_flocker_agent(
                node_name=node,
                control_node=control_node,
            ),
        )