Skip to content

Commit

Permalink
Added a lamp stack ami creation and shell provisioer
Browse files Browse the repository at this point in the history
  • Loading branch information
qtsathish committed Mar 14, 2021
1 parent 429c070 commit 09b135b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Mar21/lamp-ami/lamp.json
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"builders": [
{
"type": "amazon-ebs",
"ami_name": "lampfrompacker-{{isotime | clean_resource_name}}",
"ami_description": "This is lamp stack",
"region": "us-west-2",
"instance_type": "t2.micro",
"source_ami" : "ami-02701bcdc5509e57b",
"ssh_username": "ubuntu",
"communicator": "ssh"

}
],
"description": "Create a lamp stack",
"provisioners": [
{
"type": "shell",
"script": "lamp.sh"
}
]
}
9 changes: 9 additions & 0 deletions Mar21/lamp-ami/lamp.sh
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
sudo apt update
sleep 30s
sudo apt install apache2 -y
sleep 30s
sudo apt install php libapache2-mod-php php-cli -y
echo '<?php phpinfo(); ?>' | sudo tee /var/www/html/info.php
sudo systemctl enable apache2
sudo systemctl restart apache2

0 comments on commit 09b135b

Please sign in to comment.