Skip to content

Commit

Permalink
Solution0.95
Browse files Browse the repository at this point in the history
  • Loading branch information
Serveladik committed Sep 19, 2024
1 parent 95635d5 commit ee310b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions install-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ sudo apt-get update -yq
sudo apt-get install python3-pip -yq

# Create a directory for the app and download the files.
sudo mkdir /app
sudo mkdir /home/azureuser/app
# make sure to uncomment the line bellow and update the link with your GitHub username
# git clone https://github.com/<your-gh-username>/azure_task_12_deploy_app_with_vm_extention.git
sudo cp -r devops_todolist_terraform_task/app/* /app
sudo cp -r /home/azureuser/devops_todolist_terraform_task/app/* /home/azureuser/app

# create a service for the app via systemctl and start the app
sudo mv /app/todoapp.service /etc/systemd/system/
sudo mv /home/azureuser/app/todoapp.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start todoapp
sudo systemctl enable todoapp
4 changes: 2 additions & 2 deletions modules/compute/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ resource "azurerm_virtual_machine_extension" "custom_script" {
publisher = "Microsoft.Azure.Extensions"
type = "CustomScript"
type_handler_version = "2.1"

settings = jsonencode({
commandToExecute = "chmod +x /home/azureuser/devops_todolist_terraform_task/install-app.sh && bash /home/azureuser/devops_todolist_terraform_task/install-app.sh"
fileUris = ["https://raw.githubusercontent.com/Serveladik/devops_todolist_terraform_task/main/install-app.sh"]
commandToExecute = "bash install-app.sh"
})
}

0 comments on commit ee310b3

Please sign in to comment.