Failed to initialize build 'amazon-ebs': builder type not found:

467 views
Skip to first unread message

Sabitha M

unread,
Nov 2, 2017, 5:04:47 PM11/2/17
to Packer
Hi ,

Here is my packer template. I am trying to pass command line arguments for packer build of type cloud. But I am getting error

Failed to initialize build '': builder type not found: {{user `cloud_provider`}}
Failed to initialize build 'amazon-ebs': builder type not found: {{user `cloud_provider`}}
 [1;32mamazon-ebs output will be in this color. [0m


==> Builds finished but no artifacts were created.

{
  "variables": {
    "cloud_provider": "",
    "image_id": ""
  },
  "builders": [{
    "type": "{{user `cloud_provider`}}",
    "region": "us-west-2",
    "source_ami": "{{user `image_id`}}",
    "instance_type": "t2.micro",
    "vpc_id":"xxxx-80d4",
    "ssh_username": "ec2-user",
    "subnet_id": "xxxx-4d",
    "security_group_id": "xxx-14f5",
    "ami_name": "JENKINS_PACKER_{{timestamp}}",
    "tags": {
    "Key": "Name",
    "Value": "JENKINS_PACKER_{{timestamp}}"
    }
  }],
 "provisioners": [
  {
  "type": "shell",
  "inline": [
    "sleep 10",
    "sudo yum -y update",
    "sudo yum -y install java-1.8.0-openjdk.x86_64",
    "sudo python get-pip.py",
    "sudo pip install --upgrade awscli"
  ]
  }
  ]

Rickard von Essen

unread,
Nov 3, 2017, 1:30:12 AM11/3/17
to packe...@googlegroups.com
You can't interpolate type and it wouldn't help much since they generally will have different options. If you really want to template type you can preprocess your template (with sed etc.).

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/815b3eba-63dc-4cee-b32c-d9e097bab8ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages