Ejemplo n.º 1
0
def install_nginx():
    print('\n Proceedng with installation of nginx now using ssh...\n')
    cmd = " ssh -t -o StrictHostKeyChecking=no -i " + key + " " + full_remote_host + " 'sudo yum install -y nginx' "
    while run_remote_command(
            instance,
            cmd) == bool(0):  #ssh remote function from ssh helper class
        run_remote_command(instance, cmd)
Ejemplo n.º 2
0
def install_python():
 cmd = "ssh -t -i " + key + " " + full_remote_host + " 'sudo yum install -y python34'"
 run_remote_command(instance, cmd)
Ejemplo n.º 3
0
def make_executable():
 cmd = "ssh -t -i " + key + " " + full_remote_host +" 'chmod 700 start_webserver.py'"
 run_remote_command(instance, cmd)
Ejemplo n.º 4
0
def copy_webserver_script():
 cmd = "scp -i " + key + " start_webserver.py " + full_remote_host +":."  
 run_remote_command(instance,cmd)
Ejemplo n.º 5
0
def install_nginx():
 print('\n Proceedng with installation of nginx now using ssh...\n')
 cmd = " ssh -t -o StrictHostKeyChecking=no -i " + key + " " + full_remote_host + " 'sudo yum install -y nginx' "
 while run_remote_command(instance, cmd) == bool(0): #ssh remote function from ssh helper class
     run_remote_command(instance, cmd)
Ejemplo n.º 6
0
def nginx_log():
 chown_cmd = "ssh -t -i " + key + " " + full_remote_host +" sudo chown ec2-user /var/log/nginx/"
 access_log_cmd = "ssh -t -i " + key + " " + full_remote_host +" cat /var/log/nginx/access.log"
 run_remote_command(instance, chown_cmd)
 run_remote_command(instance, access_log_cmd)
Ejemplo n.º 7
0
def run_webserver_script():
 cmd = "ssh -t -i " + key + " " + full_remote_host +" python3 start_webserver.py"
 run_remote_command(instance, cmd)
Ejemplo n.º 8
0
def nginx_log():
    chown_cmd = "ssh -t -i " + key + " " + full_remote_host + " sudo chown ec2-user /var/log/nginx/"
    access_log_cmd = "ssh -t -i " + key + " " + full_remote_host + " cat /var/log/nginx/access.log"
    run_remote_command(instance, chown_cmd)
    run_remote_command(instance, access_log_cmd)
Ejemplo n.º 9
0
def run_webserver_script():
    cmd = "ssh -t -i " + key + " " + full_remote_host + " python3 start_webserver.py"
    run_remote_command(instance, cmd)
Ejemplo n.º 10
0
def install_python():
    cmd = "ssh -t -i " + key + " " + full_remote_host + " 'sudo yum install -y python34'"
    run_remote_command(instance, cmd)
Ejemplo n.º 11
0
def make_executable():
    cmd = "ssh -t -i " + key + " " + full_remote_host + " 'chmod 700 start_webserver.py'"
    run_remote_command(instance, cmd)
Ejemplo n.º 12
0
def copy_webserver_script():
    cmd = "scp -i " + key + " start_webserver.py " + full_remote_host + ":."
    run_remote_command(instance, cmd)