一千萬個為什麽

搜索

在Docker容器中使用'ansible-local'provisioner時出錯



在Hashicorps Packer中使用docker生成器運行 ansible-local 預配置時出現錯誤。

我的模板(template.json):

{
  "builders": [
        {
            "type": "docker",
            "image": "ubuntu",
            "commit": "true"
        }
    ],
   "provisioners": [
        {
            "type": "shell",
            "inline": ["sudo apt-get update"]
        },
        {
            "type": "shell",
            "script": "setup_ansible.sh"
        },
        {
            "type": "ansible-local",
            "playbook_file": "./kubeadm.yml"
        }
   ]
}

錯誤:

docker: Executing Ansible: cd /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3 && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3/kubeadm.yml --extra-vars \"packer_build_name=docker packer_builder_type=docker packer_http_addr=\"  -c local -i /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3/packer-provisioner-ansible-local135505282
docker: ERROR! the playbook: packer_builder_type=docker could not be found

轉載註明原文: 在Docker容器中使用'ansible-local'provisioner時出錯

一共有 1 個回答:

看起來Hashicorps Packer 1.2.0中有一些 bug ,請考慮降級或升級到v1.2.1,GH問題頁面中的註釋確認已部署的修復程序正在運行。