Ansible
安装软件
yum install ansible -y
yum install libselinux-python -y
# ansible 需要 epel 源
# yum install epel-release -y
# 客户端需安装 libselinux-python常用参数说明
参数
说明
命令使用示例
ansible web_server --private-key ~/.ssh/id_cluster -m command -a "free -m"
# web_server 为主机列表配置文件里的模块名称主机列表配置
带密码验证信息的写法
主配置文件
使用 sed 命令一键完成
执行命令
使用密码
使用私钥
-m command 模块说明
模块使用
查看模块
查看指定模块的帮助信息
command 模块
shell 模块
copy 模块
script 模块
cron 模块
剧本
编写剧本
执行剧本
Last updated