gpt4 book ai didi

安西 bool 。快速检查语法的方法?

转载 作者:行者123 更新时间:2023-12-01 22:50:59 24 4
gpt4 key购买 nike

有没有办法检查剧本语法和变量?

我正在尝试试运行(--check),但由于某些原因它运行速度非常慢。看起来它试图执行一个操作,而不仅仅是检查语法

我想省略这样的错误:

..."msg": "AnsibleUndefinedVariable: ERROR! 'application_name' is undefined"}

最佳答案

根据文档,这是预期的行为:

When ansible-playbook is executed with --check it will not make anychanges on remote systems. Instead, any module instrumented to support‘check mode’ (which contains most of the primary core modules, but itis not required that all modules do this) will report what changesthey would have made rather than making them. Other modules that donot support check mode will also take no action, but just will notreport what changes they might have made.

旧链接(不再有效):http://docs.ansible.com/ansible/playbooks_checkmode.html

新链接:https://docs.ansible.com/ansible/latest/user_guide/playbooks_checkmode.html#using-check-mode

如果您想检查 YAML 语法,可以使用语法检查。

ansible-playbook rds_prod.yml  --syntax-check
playbook: rds_prod.yml

关于安西 bool 。快速检查语法的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35339512/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com