ansible-playbook语法检查

列出主机

[root@ops-test-01 nginx_v2]# ansible-playbook -i hosts --list-hosts web-tls.yml

playbook: web-tls.yml

  play #1 (Configure webserver with nginx and tls): host count=1

    web_test01

[root@ops-test-01 nginx_v2]#

语法检查

[root@ops-test-01 nginx_v2]# ansible-playbook --syntax-check  web-tls.yml

playbook: web-tls.yml

[root@ops-test-01 nginx_v2]#

列出task

[root@ops-test-01 nginx_v2]# ansible-playbook -i hosts --list-tasks web-tls.yml

playbook: web-tls.yml

  play #1 (Configure webserver with nginx and tls):    TAGS: []

    Install Nginx server    TAGS: []

    create directories for ssl certificates    TAGS: []

    copy TLS key    TAGS: []

    copy TLS certificate    TAGS: []

    copy nginx config file    TAGS: []

    copy index.html    TAGS: []

[root@ops-test-01 nginx_v2]#    

检查语法是不是正确

[root@ops-test-01 nginx_v2]# ansible-playbook --check web-tls.yml
OpsNotes wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
坚持原创技术分享,您的支持将鼓励我继续创作!