一、安装 yum install -y ansible 二、密钥授权 ssh-keygen -t rsa注释:-t type指定要创建的密钥类型。 rsa 加密算法 三、模块介绍(https://www.cnblogs.com/mcsiberiawolf/articles/10056777.html ...
分类:
其他好文 时间:
2020-09-18 02:00:30
阅读次数:
37
这里学习了ssl证书的安装,这里备份一下以免丢失。原文地址:https://ubock.com/article/25Let's Encrypt是一个公共且免费SSL的项目,由Mozilla、Cisco、Akamai、IdenTrust、EFF等组织发起,主要的目的是为了推进网站从HTTP向HTTPS ...
分类:
Web程序 时间:
2020-09-18 01:51:49
阅读次数:
50
将管理节点的脚本上传至被管理节点执行,理论上此模块不许需要被管理服务器上有python [root@ceph1 ~]# cat a.sh touch /tmp/ansible-script [root@ceph1 ~]# ansible webservers -m script -a "a.sh" ...
分类:
其他好文 时间:
2020-09-18 01:10:39
阅读次数:
31
官网 [root@ceph1 ~]# cat a.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$bas ...
分类:
其他好文 时间:
2020-09-18 01:09:51
阅读次数:
28
ansible运行报错:CryptographyDeprecationWarning,本文旨在解决该问题。
分类:
其他好文 时间:
2020-09-17 22:44:47
阅读次数:
58
日常维护操作查看VLAN信息showrun-configinterfacevlan1showipinterfacevlan1查看接口信息showrun-configinterface1/0/1查看日志信息showlog查看路由表showiproute查看VLAN中已分配并使用的ip和对应的物理地址showiparpvlan1查看相邻路由器或者三层交换机信息及其ip信息showcdpneighbor
分类:
系统相关 时间:
2020-09-17 19:54:41
阅读次数:
124
日常维护操作查看VLAN信息showrun-configinterfacevlan1showipinterfacevlan1查看接口信息showrun-configinterface1/0/1查看日志信息showlog查看路由表showiproute查看VLAN中已分配并使用的ip和对应的物理地址showiparpvlan1查看相邻路由器或者三层交换机信息及其ip信息showcdpneighbor
分类:
系统相关 时间:
2020-09-17 19:54:29
阅读次数:
42
内置变量ansible_version获取到ansible的版本号ansibletest70-mdebug-a"msg={{ansible_version}}"内置变量hostvars操作当前主机时获取到其他主机中的信息name:"play1:Gatherfactsoftest71"hosts:test71remote_user:rootname:"
分类:
其他好文 时间:
2020-09-17 17:20:47
阅读次数:
79
通过item和with_items对重复操作进行循环执行示例:hosts:jack6_1remote_user:rootgather_facts:notasks:name:touchfilefile:path:"{{item}}"state:touchwith_items:"a""b""c"在jack6_1主机上创建三
分类:
其他好文 时间:
2020-09-17 17:20:16
阅读次数:
39
with_items遍历列表中每个元素,包括嵌套列表with_list将嵌套列表作为整体元素遍历with_together将多个列表中的子列表元素,一起输出,不成对则null补位示例:hosts:jack6_1remote_user:rootgather_facts:notasks:debug:msg:"{{item}}"with_items:[1,2,3][a,b]debug
分类:
其他好文 时间:
2020-09-17 17:19:57
阅读次数:
31