- name: Print debug infomation eg hosts: test2 gather_facts: F tasks: - name: Command run line shell: date register: result - name: Show debug info debug: var=result.stdout verbosity= ansible playbook可以将多个命令组合来执行,但是很多时候我们需要接收服务器的反馈,所以debug模块就非常重要了. 模…
示例: # Example that prints the loopback address and gateway for each host - debug: msg="System {{ inventory_hostname }} has uuid {{ ansible_product_uuid }}" - debug: msg="System {{ inventory_hostname }} has gateway {{ ansible_default_ipv4.ga…
This article includes some useful Ansible commands. I will try to write blogs by English. You may want to add my wechat public account or add my technical blogs's rss feed How ansible works Ansible works by connecting to your nodes and pushing out sm…
七.Playbook1.语法特性如下:(1)"---"首行顶格开始(2)#号注释(3)缩进统一,不同的缩进代表不同的级别,缩进要对齐,空格和tab不能混用(4)区别大小写,键值对k/v的值也大小写敏感(5)k/v的值同行使用":"分开,换行写需以"-"分隔2.格式---- name: test hosts: test gather_facts: no vars: http: 8080 https: 1443 vars_file…