准备主机
模拟多台主机ansible部署
主机 | 功能 |
---|---|
ansible-server | 172.25.65.10 |
agent1 | 172.25.65.11 |
agent2 | 172.25.65.12 |
部署准备
- 保证虚拟机能正常上网(三台主机都做)
可以参照Linux系统下让虚拟机具备上网功能和访问外网优先级及DHCP的搭建 - 配置yum源
[root@server10 ~]# vim yum.repo ##添加镜像文件
[ansible]
name=ansible
baseurl=https://mirror.tuna.tsinghua.edu.cn/epel/7/x86_64/
gpgcheck=0
[root@server10 yum.repos.d]# yum clean all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: ansible rhel7.5
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
[root@server10 yum.repos.d]# yum repolist
Loaded plugins: product-id, search-di