AMI イメージを生成し、それを vmware_fusion vagrant.box ポスト プロセッサに渡します。これは正常に完了し、vagrant ボックス ページは、ボックスがアクセス可能で利用可能であると主張します。ボックス ファイル ページに記載されている手順を使用して、ボックスを使用して新しいプロジェクトを開始すると、次の結果が得られます。
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
The requested URL returned error: 404 Not Found
404 の URL をコピーしてブラウザーに貼り付けると、Atlas 404 ページも表示されます。
コンソール経由vagrant login
でログインしていることと、Atlas サイトにログインしていることを確認したので、404 は、ボックスが非公開であり、自分自身がログインしていないという結果ではありません。
他のボックス ビルドを実行しましたが、この段階で正常にダウンロードされました。現在、Packer/Atlas にバグがあるようですが、それを確認する方法はありません。
私のPacker構成は次のようになります。
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS`}}",
"aws_secret_key": "{{env `AWS_SECRET`}}"
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"ami_name": "ami_name_here {{timestamp}}",
"instance_type": "t2.medium",
"region": "us-east-1",
"source_ami": "ami-df38e6b4",
"user_data_file": "ec2-setup.sh"
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'",
"script": "packer_scripts/setup.sh"
},
{
"type": "shell",
"inline": [
"sleep 30",
"cd /tmp && sudo wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb",
"sudo dpkg -i /tmp/puppetlabs-release-pc1-trusty.deb",
"sudo apt-get update && sudo apt-get upgrade -y",
"sudo apt-get install puppet -y"
]
},
{
"type": "puppet-masterless",
"manifest_file": "manifests/default.pp",
"module_paths": [
"modules/"
]
}
],
"post-processors": [
[
{
"type": "atlas",
"artifact": "my/artifact",
"artifact_type": "amazon.ami",
"metadata": {
"created_at": "{{timestamp}}"
}
},
{
"type": "atlas",
"artifact": "my/artifact",
"artifact_type": "vagrant.box",
"metadata": {
"created_at": "{{timestamp}}",
"provider": "vmware_fusion"
}
}
]
],
"push": {
"name": "my/artifact",
"vcs": true
}
}