-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a lamp stack ami creation and shell provisioer
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |||
} | |||
] | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |