打包程序脚本错误必须指定脚本文件或内联脚本

packer script error Either a script file or inline script must be specified

我的打包程序脚本出错

  {
"variables":
{
"aws_access_key": "",
"aws_secret_key": "",
"revision": "0",
"ansible_host":""
},
"builders":[{
    "type": "amazon-ebs",
    "access_key": "{{user `aws_access_key`}}",
    "secret_key": "{{user `aws_secret_key`}}",
    "region": "us-east-2",
    "instance_type": "t2.micro",
    "source_ami": "ami-09e1c6dd3bd60cf2e",
    "source_ami_filter": {
        "filters": {
          "virtualization-type": "hvm",
          "name": "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*",
          "root-device-type": "ebs"
  }},
    "ssh_username": "ubuntu",
    "ami_name":"honebackend {{ isotime | clean_ami_name }}"
}],
"provisioners":[
    {
    "type":"shell",
    "script":"scripts/ssh_agent.sh"
    },
    {
    "type": "shell",
    "execute_command": "mkdir /var/apps"
    },
    {
    "type":"ansible",
    "extra_arguments": [ "-vvv --extra-vars 'ansible_host={{user `host`}} ../ansible/hosts.ini ansible_python_interpreter=/usr/bin/python3"],
    "inventory_file": "../ansible/hosts.ini",
    "playbook_file":"../ansible/nodejs.yml"
    }

]

}

在 运行 以下命令之后:

  packer build -debug -var 'aws_access_key=XXXXXXXXXXXXXXXXXXXXXXX' -var
    'aws_secret_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'      packer.json

实际结果是: 启用调试模式。构建不会被并行化。 amazon-ebs 输出将采用这种颜色。

1 error(s) occurred:

* Either a script file or inline script must be specified.

我做错了什么?

如错误所述:

{
  "type": "shell",
  "execute_command": "mkdir /var/apps"
 },

应该是:

{
  "type": "shell",
  "inline": "mkdir /var/apps"
 },