amazon-web-services - 为什么在尝试构建镜像时,packer build 没有显示这样的文件或目录?

标签 amazon-web-services ansible devops packer

我有以下用于构建图像的打包脚本:

 {
            "variables":
            {
            "aws_access_key": "",
            "aws_secret_key": "",
            "aws_region": "us-east-2",
            "version": "",
            "revision": "0",
            "instance_type": "t3.xlarge",
            "image_name" : "{{ env `IMAGE_NAME` }}"
            },
            "builders":{
                "type": "amazon-ebs",
                "access_key": "{{user `aws_access_key`}}",
                "secret_key": "{{user `aws_secret_key`}}",
                "region": "{{user `aws_region`}}",
                "instance_type": "{{user `instance_type`}}",
                "source_ami": "ami-09e1c6dd3bd60cf2e",
                "ssh_username": "ubuntu",
                "ami_name":"honebuild {{ isotime | clean_ami_name }"
            },
            "Provioners":[
                {
                "type":"shell",
                "script":"scripts/ssh_agent.sh"
                },
                {
                "type":"ansible",
                "playbook_dir":"./ansible",
                "playbook_file":"honeygram.yml"

                }

            ]



        }

运行命令 packer build image.json 后。它给出以下错误:

Failed to parse template: open packer.json: no such file or directory. 

我在脚本目录中。

需要帮助

最佳答案

从您发布的内容来看,您的问题出在您的配置者部分。

你有:

"Provioners"

应该是:

"provisioners"

关于amazon-web-services - 为什么在尝试构建镜像时,packer build 没有显示这样的文件或目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53299839/

相关文章:

ansible - 使用变量名而不是字符串引用 ansible 的 hostvars 字典中的键

json - 使用 Ansible 查找 JSON 中的值,而无需知道它在哪里

database - 如果我们在共享位置安装了 redgate 工具 "Schema Compare of Oracle"

ubuntu - 从nginx中的url中提取第一个点之前的单词

amazon-web-services - 由于类似 catch22 的情况,AWS 自定义资源 ROLLBACK_FAILED

amazon-web-services - Presto SQL : TO_UNIXTIME

ansible - ansible 中操作系统特定的 pre_task

ansible - 使用 if 条件将 True 或 False 分配给 Ansible 中的 gather_facts 不起作用

javascript - AWS javascript SDK多文件上传进度条

amazon-web-services - Windows 10 - vagrant 插件安装 vagrant-aws - "libxml2"软件包不可用。 (运行时错误)