Sources ansible configuration data source 163

1, basic information

repos storage location: /etc/yum.repos.d/  
data download Source:
CentOS7
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo  

CentOS6
wget http://mirrors.163.com /.help/CentOS6-Base-163.repo  

CentOS5
wget http://mirrors.163.com/.help/CentOS5-Base-163.repo  

2, using ansible download repo

ansible webservers -m get_url -a "url=http://mirrors.163.com/.help/CentOS6-Base-163.repo dest=/etc/yum.repos.d"

 

3, run yum generate cache

ansible webservers -m command -a 'yum makecache'

'

4, update the information system will be able to see mirrors.163.com

 

用阿里云,只要下载aliyun的yum配置文件到/etc/yum.repos.d/,其它步骤一致
CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo  

CentOS6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo  

CentOS5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo 

Guess you like

Origin www.cnblogs.com/zxw-xxcsl/p/11199486.html