你如何将 ansible ini 清单转换为 json 或 yaml

用户1717259

Ansible AWX 要求以 yaml 或 json 格式输入库存。

当您开始学习 ansible 时,您可以选择从 ini 格式的库存开始。

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html

可以在格式之间转换吗?

用户1717259

这里给出的例子

https://evrard.me/convert-ansible-inventories-with-ansible-inventory-cli

ansible-inventory -i inventory.ini -y --list > inventory.yaml

-y标志提供 yaml 输出。省略标志给出 json。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章