NOTE:
whenver we start provisioner we have to define ami_name always other it will give error
example we have already defined to install git .
later i need to install tree also once i define my command and
try to buid it it give give error ami_name exist
so the solution is timestamp that we need to define in
ami_name: "dev-team-{{timestamp}}"
{
"builders": [
{
"type": "amazon-ebs",
"access_key": "AVUGQ",
"secret_key": "KfVkt1aurid",
"region": "us-east-1",
"instance_type": "t2.micro",
"source_ami": "ami-02e136e904f3da870",
"ssh_username": "ec2-user",
"ami_name": "moonu-amiii-{{timestamp}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"yum remove -y PackageKit*",
"sudo yum install httpd -y",
"sudo yum install tree",
"sudo service httpd start",
"sudo chkconfig httpd on"
]
}
]
}
Comments
Post a Comment