Ansible模块

本地主机:132

远程主机1:133

远程主机2:134

Shell模块

132远程执行在133,134执行自己本地的脚本

Script模块

Copy模块

dest必须是一个文件,如果需要备份使用backup=yes

132

134(默认覆盖文件)

复制文件夹及其目录

fetch模块

file模块

如果之前文件存在则创建不了空文件

创建软连接是src必须是远程主机上有的文件

unarchive模块

Copy=yes 将源主机里的压缩包解压至远程主机上指定目录

Copy=no 将远程主机自己的压缩包解压至远程主机上指定目录

archive模块

path写的是远程主机目录

dest写的是打包到源主机

hostname模块

Playbook

主控机

重启nginx服务必须是被控机里的nginx配置变化,触发handlers触发器

我配置的游戏

Role

Http.conf用/etc/httpd/conf/httpd.conf

File.yml

我的是Copy: src=/root/httpd/files/index.html

相关推荐
让美好继续发生16 小时前
ansible学习
学习·ansible
有谁看见我的剑了?1 天前
ansible学习之 Facts
ansible
peanutfish1 天前
Chapter 4 RH294 RHEL Automation with Ansible
linux·ansible·yaml
henan程序媛2 天前
jenkins项目发布基础
运维·gitlab·ansible·jenkins
pyliumy3 天前
ansible 配置
大数据·ansible
运维小白。。3 天前
自动化运维工具 Ansible
运维·自动化·ansible
weixin_438197384 天前
ansible之playbook\shell\script模块远程自动安装nginx
linux·服务器·ansible
peanutfish4 天前
Chapter 5 RH294 RHEL Automation with Ansible
linux·ansible·yaml
人类群星闪耀时4 天前
自动化运维的利器:Ansible、Puppet和Chef详解
运维·自动化·ansible
企鹅侠客4 天前
ansible实用模块
ansible