我正在使用anisble资源调配器..在执行ansible资源调配器时,它说没有这种选择
{
"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":"ansible",
"playbook_file":".././ansible/nodejs.yml",
"extra_arguments": [ "-vvv --extra-vars 'ansible_host={{user `host`}} ansible_python_interpreter=/usr/bin/python3'"]
}
]
}
运行此命令后: packer build -var'aws_access_key = ...'-var'aws_secret_key = ...'packer.json
出现以下错误:
==> amazon-ebs: Provisioning with Ansible...
==> amazon-ebs: Executing Ansible: ansible-playbook --extra-vars packer_build_name=amazon-ebs packer_builder_type=amazon-ebs -i /tmp/packer-provisioner-ansible845262359 /var/honmanagement/ansible/nodejs.yml -e ansible_ssh_private_key_file=/tmp/ansible-key022072728 -vvv --extra-vars 'ansible_host= ansible_python_interpreter=/usr/bin/python3'
amazon-ebs: Usage: ansible-playbook [options] playbook.yml [playbook2 ...]
amazon-ebs:
amazon-ebs: ansible-playbook: error: no such option: -
答案 0 :(得分:2)
您的extra_arguments
是错误的。应该是:
id st value
243 1 2.4
243 2 2.4
243 3 3.8
243 4 3.8
243 5 3.7
243 6 3.7
243 7 3.7
243 8 3.7
243 9 5.6
243 10 5.6
243 11 5.6
443 12 1.2
443 13 1.2