{"id":20328749,"url":"https://github.com/allwelldotdev/altschool-cloud-sem2-project_exam","last_synced_at":"2026-05-11T09:54:32.244Z","repository":{"id":234750665,"uuid":"789427805","full_name":"allwelldotdev/altschool-cloud-sem2-project_exam","owner":"allwelldotdev","description":"This repo contains code file during assignment for AltSchool Cloud Semester 2 - Project Exam.","archived":false,"fork":false,"pushed_at":"2024-04-26T18:33:30.000Z","size":4522,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T11:46:30.659Z","etag":null,"topics":["altschool","bash-scripting","vagrant"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/allwelldotdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-20T14:18:53.000Z","updated_at":"2024-10-30T10:43:31.000Z","dependencies_parsed_at":"2024-04-24T17:43:29.810Z","dependency_job_id":null,"html_url":"https://github.com/allwelldotdev/altschool-cloud-sem2-project_exam","commit_stats":null,"previous_names":["allwelldotdev/altschool-cloud-sem2-project_exam"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/allwelldotdev/altschool-cloud-sem2-project_exam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allwelldotdev%2Faltschool-cloud-sem2-project_exam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allwelldotdev%2Faltschool-cloud-sem2-project_exam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allwelldotdev%2Faltschool-cloud-sem2-project_exam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allwelldotdev%2Faltschool-cloud-sem2-project_exam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allwelldotdev","download_url":"https://codeload.github.com/allwelldotdev/altschool-cloud-sem2-project_exam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allwelldotdev%2Faltschool-cloud-sem2-project_exam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32889971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altschool","bash-scripting","vagrant"],"created_at":"2024-11-14T20:07:49.389Z","updated_at":"2026-05-11T09:54:32.210Z","avatar_url":"https://github.com/allwelldotdev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AltSchool Cloud 2nd Semester Project Exam\nProject Exam Summary: Automatically provision multiVMs (2 - master \u0026 slave), create bash script to deploy LAMP Stack on master vm/node, use Ansible to execute the bash script on slave vm/node.\n\n## Extended Project Exam Questions\n1. Automate the provisioning of two Ubuntu-based servers, named “Master” and “Slave”, using Vagrant.\n2. On the Master node, create a bash script to automate the deployment of a LAMP (Linux, Apache, MySQL, PHP) stack.\n    - This script should clone a [Laravel PHP application from GitHub](https://github.com/laravel/laravel), install all necessary packages, and configure Apache web server and MySQL. \n    - Ensure the bash script is reusable and readable.\n3. Using an Ansible playbook:\n    - Execute the bash script on the Slave node and verify that the PHP application is accessible through the VM’s IP address (take screenshot of this as evidence).\n    - Create a cron job to check the server’s uptime every 12 am.\n\n## Demonstration/Documentation of Project Solution\n\n### For Question 1\n\nDefined two VMs in [Vagrantfile](/Vagrantfile), namely 'master' and 'slave', and assigned two static IPs to them; master - 192.168.56.10, slave - 192.168.56.11.\n\nVagrant up both VMs and checked the IP address for proof.\n\n`Master VM - 192.168.56.10`\n\n![Master VM](/assets/media/img-1.png)\n\n`Slave VM - 192.168.56.11`\n\n![Slave VM](/assets/media/img-2.png)\n\n### For Question 2\n\nWrote the **bash script** to be completely automated without ANY interactions (I stress 'ANY interactions', which means, once started, the bash script will run uninterrupted till completion). See [bash script](/scripts/deploy-LAMP-stack.sh).\n\nTo make the bash script more reusable, I created a **config file** that stores the database variables needed to run the bash script. See [config file](/assets/config/deploy-LAMP-stack.cfg).\n\nThe bash script sources/calls the variables from the config file into itself and temporarily stores them for use.\n\n### For Question 3\n\nCreated [Ansible playbook](/scripts/ansible/playbook.yaml) to execute bash script on Slave node, ran it, and it ran successfully. See the images below for proof.\n\n**UPDATE:** I discovered, when I tried cloning my project repo from GitHub and executing my Ansible playbook, that my bash script wouldn't run. I found that the problem was Windows line endings [or carriage returns (CR)] not working on Unix-like systems. So, I updated the Master VM provisioning and Ansible playbook to solve this problem and eliminate the bug.\nNow, if you clone my repo into your local machine and run my code it would work 'on your machine'.\nSee new Ansible playbook execution result below.\n\n`Ansible playbook ran successfully`\n\n![Ansible playbook run](/assets/media/ansible-playbook-run-2.png)\n\nVerified that PHP Laravel application is accessible through Slave VM's IP address: 192.168.56.11\n\n`LAMP stack proof: Slave VM - 192.168.56.11`\n\n![LAMP stack proof: Slave VM - 192.168.56.11](/assets/media/lamp-stack-proof-slavevm.png)\n\nCreated a cron job with Ansible playbook to check server’s (Slave VM) uptime every 12 am. Then ran `crontab -l` in shell to check cron job list. See image below.\n\n`Cron job to check server's uptime every 12 am`\n\n![Cron job checked through crontab list](/assets/media/crontab.png)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallwelldotdev%2Faltschool-cloud-sem2-project_exam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallwelldotdev%2Faltschool-cloud-sem2-project_exam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallwelldotdev%2Faltschool-cloud-sem2-project_exam/lists"}