fj1*_*23x 5 packer vagrant ansible digital-ocean
当我使用vagrant时,我可以在Vagrantfile中指定库存文件.
例:
config.vm.provision "ansible" do |ansible|
ansible.playbook = "my_folder/playbook.yml"
ansible.inventory_path = "my_folder/inventory_file"
end
Run Code Online (Sandbox Code Playgroud)
使用打包程序时如何配置inventory_file?
我在封隔器的官方文档中看不到任何相关信息:
http://www.packer.io/docs/provisioners/ansible-local.html
我需要指定库存文件,因为当我运行我的packer.json时,这是输出:
digitalocean: Executing Ansible: ansible-playbook /tmp/my_folder/playbook.yml -c local -i "127.0.0.1,"
digitalocean:
digitalocean: PLAY [foo] ******************************************************************
digitalocean: skipping: no hosts matched
Run Code Online (Sandbox Code Playgroud)
Packer似乎使用名为"127.0.0.1"的库存文件,我不知道为什么.
如何指定库存文件?
谢谢!
好吧,我的猜测是,由于ansible with packer使用本地连接(-c local),因此不需要提供清单文件。
您只需要确保您的剧本中的-hosts行包含all或127.0.0.1且应该可以正常运行。
| 归档时间: |
|
| 查看次数: |
3874 次 |
| 最近记录: |