def mco_ping(): """ Run mcollective ping on the broker """ node = aws.provision_with_boto('broker') with connection_to_node(node): run('mco ping')
def start(node_name): """ Create and/or connect to a named node """ node = aws.provision_with_boto(node_name) wait_for_ssh_connection(node) connect_script(node_name, node)
def provision_broker(): """ Setup an activemq connection broker """ node = aws.provision_with_boto('broker') with connection_to_node(node): setup_puppet_standalone() apply_manifest("broker-activemq", node.hostname) connect_script('broker', node)
def provision(node_name): """ Create named node that talks to activemq """ stomp_host = aws.get_node('broker').hostname node = aws.provision_with_boto(node_name) with connection_to_node(node): setup_puppet_standalone() apply_manifest("mcollective-node", stomp_host) connect_script(node_name, node)
def staging(): "Setup staging settings" env.node = aws.provision_with_boto('staging-appserver') env.hosts = [env.node.hostname] env.repo = ("env.example.com", "origin", "stage") env.base = "/server" env.virtualenv, env.parent, env.branch = env.repo env.user = "******" env.git_origin = GIT_ORIGIN env.git_repo = GIT_REPO env.dev_mode = False env.key_filename = AWS_KEY
def production(): """ Setup production settings You should really not use this for a production setup. Build out your own that suites your needs and use that. This works, but the produciton label may make you think it will be right for your use. I guarantee it isn't. :) This deploys a EC2 instance. """ env.node = aws.provision_with_boto('production-appserver') env.hosts = [env.node.hostname] env.repo = ("env.example.com", "origin", "master") env.virtualenv, env.parent, env.branch = env.repo env.base = "/server" env.user = "******" env.git_origin = GIT_ORIGIN env.git_repo = GIT_REPO env.dev_mode = False env.key_filename = AWS_KEY
def provision_activemq(): node = aws.provision_with_boto('broker') with connection_to_node(node): setup_puppet_standalone() apply_manifest("broker-activemq", node.hostname)
def shell(node_name): node = aws.provision_with_boto(node_name) wait_for_ssh_connection(node) command = "ssh -i %s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no %s@%s" print command % (node.ssh_key_file, node.ssh_user, node.hostname)
def mco_ping(): node = aws.provision_with_boto('broker') with connection_to_node(node): run('mco ping')
def provision_node(node_name): stomp_host = aws.public_dns('broker') node = aws.provision_with_boto(node_name) with connection_to_node(node): setup_puppet_standalone() apply_manifest("mcollective-node", stomp_host)