摘要: 第一种方式: 在play中定义 类似数组方式[root@m01 ansible]#cat vars.yml- hosts: web01 vars: packages: # 变量的名称 自定义 - wget # 变量的值 如果有多个则使用列表的方式 - lrzsz - tree tasks: - na 阅读全文
posted @ 2023-02-24 11:53 胡世涛 阅读(238) 评论(0) 推荐(0)
摘要: Ansible常用模块及使用案例第一个模块: command ansible web01 -m command -a '可执行命令'第二个模块: Shell 支持管道ansible web01 -m command -a '可执行命令'第三个模块: scriptansible web01 -m sc 阅读全文
posted @ 2023-02-24 11:48 胡世涛 阅读(262) 评论(0) 推荐(0)
摘要: 1 阅读全文
posted @ 2023-02-24 10:57 胡世涛 阅读(9) 评论(0) 推荐(0)