ansible
ansible 如何批量杀远程机器的tomcat进程
ansiblezhou-mshell-a"ps-ef|grepjava|grep-vgrep|awk'{print\$2}'|xargskill-9"注意\$这个,不加转移ansible会误会[详细]
2020-10-28 12:51 分类:Linux-
ansible生产环境使用场景(五):splunk客户端批量安装
生产上使用splunk进行日志搜集,服务端已经安装完成,客户端有几十台需要部署,本文介绍使用ansible进行客户端批量安装[详细]
2020-10-25 12:13 分类:Linux 批量修改主机名 ansible
修改cat/etc/ansible/hosts[test]10.27.235.108host_name=test_host_namehosts:testuser:rootgather_facts:truetasks:name:rsyncdirfilebeathostname:'name={{host_name}}'name:"addline"lineinfile[详细]
2020-10-08 12:47 分类:Linuxansible运行报错CryptographyDeprecationWarning解决
ansible运行报错:CryptographyDeprecationWarning,本文旨在解决该问题。[详细]
2020-09-12 13:01 分类:Linuxansible循环四
with_indexed_items示例:hosts:jack6_1remote_user:rootgather_facts:notasks:debug:msg:"{{item}}"with_indexed_items:[t1,t2][t3,[t4,t5]][t6]输出结果如下:[[email protected]]#ansible-playbook--syntax-checki[详细]
2020-09-08 14:10 分类:Linuxansible循环三
with_nested采用笛卡尔乘积方式,将多个嵌套列表中的元素交叉组合示例:创建多个目录及子目录mkdir-p/testdir/{a,b,c}/{1,2}ansible剧本如下:hosts:jack6_1remote_user:rootgather_facts:notasks:file:path:"/testdir"state:d...[详细]
2020-09-08 14:04 分类:Linuxansible的循环二
with_items遍历列表中每个元素,包括嵌套列表with_list将嵌套列表作为整体元素遍历with_together将多个列表中的子列表元素,一起输出,不成对则null补位示例:hosts:jack6_1remote_user:rootgather_facts:notasks:debug:msg:"{{item...[详细]
2020-09-08 14:00 分类:Linuxansible进阶循环
通过item和with_items对重复操作进行循环执行示例:hosts:jack6_1remote_user:rootgather_facts:notasks:name:touchfilefile:path:"{{item}}"state:touchwith_items:"a""b""c"在jack6_1主机上创...[详细]
2020-09-08 13:57 分类:Linuxansible模块set_fact
set_fact定义变量可以在同一主机组中play相互引用,但是vars定义的变量,只能在单独的play使用示例:[[email protected]]#catset_fact.ymlhosts:PAremote_user:rootvars:================>如果在下个play中引用会报错var2:"Iatest...[详细]
2020-09-08 13:40 分类:Linux