实战ansible批量安装定制好的rpm包
2015-07-22 20:35
639 查看
1、项目背景
公司最近在生产环境上线内网dns服务器,开源组件选的是powerdns。其中客户端要安装powerdns-recursor,那么疑问来了,线上有100多台server,如何高效快速安装,就得我们运维考虑啦。由于线上之前有部署ansible来批量管理服务器,于是我这的方案就是ansible+定制好的rmp包powerdns-recursor+ansible-doc yum模块。
2、构建本地yum仓库
因为我没找到ansible安装rpm包的模块,所有只能用yum模块,因此先要构造本地yum仓库,详细参考我的另外一篇博客/article/4223591.html
3、构建定制rpm包,后面找时间补上这块的内容
4、前3步准备好以后,接下来安装就很容易。
ansible ttp_www -m yum -a 'name=http://172.16.1.211:81/powerdns-recursor-3.7.3-0.el6.x86_64.rpm state=installed' --sudo
x.x.x.x | success >> {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Loaded plugins: downloadonly, fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.zju.edu.cn\n * epel: ftp.cuhk.edu.hk\n * extras: mirrors.163.com\n * updates: mirrors.zju.edu.cn\nSetting up Install Process\nExamining /var/tmp/yum-root-Chl1dY/powerdns-recursor-3.7.3-0.el6.x86_64.rpm: powerdns-recursor-3.7.3-0.el6.x86_64\nMarking /var/tmp/yum-root-Chl1dY/powerdns-recursor-3.7.3-0.el6.x86_64.rpm to be installed\nResolving Dependencies\n--> Running transaction check\n---> Package powerdns-recursor.x86_64 0:3.7.3-0.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n powerdns-recursor\n x86_64 3.7.3-0.el6 /powerdns-recursor-3.7.3-0.el6.x86_64 9.8 M\n\nTransaction Summary\n================================================================================\nInstall 1 Package(s)\n\nTotal size: 9.8 M\nInstalled size: 9.8 M\nDownloading Packages:\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n\r Installing : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\r Verifying : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\nInstalled:\n powerdns-recursor.x86_64 0:3.7.3-0.el6 \n\nComplete!\n"
]
}
x.x.x.x | success >> {
"changed": true,
"msg": "http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/x86_64/repodata/1391f50a2eef61cff2d1b2f05609edfb43368031e4a19ddf85bddda5847df910-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 7 - \"couldn't connect to host\"\nTrying other mirror.\n",
"rc": 0,
"results": [
"Loaded plugins: downloadonly, fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.pubyun.com\n * epel: ftp.cuhk.edu.hk\n * extras: mirrors.pubyun.com\n * updates: centos.ustc.edu.cn\nSetting up Install Process\nExamining /var/tmp/yum-root-4imk7e/powerdns-recursor-3.7.3-0.el6.x86_64.rpm: powerdns-recursor-3.7.3-0.el6.x86_64\nMarking /var/tmp/yum-root-4imk7e/powerdns-recursor-3.7.3-0.el6.x86_64.rpm to be installed\nResolving Dependencies\n--> Running transaction check\n---> Package powerdns-recursor.x86_64 0:3.7.3-0.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n powerdns-recursor\n x86_64 3.7.3-0.el6 /powerdns-recursor-3.7.3-0.el6.x86_64 9.8 M\n\nTransaction Summary\n================================================================================\nInstall 1 Package(s)\n\nTotal size: 9.8 M\nInstalled size: 9.8 M\nDownloading Packages:\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n\r Installing : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\r Verifying : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\nInstalled:\n powerdns-recursor.x86_64 0:3.7.3-0.el6 \n\nComplete!\n"
]
}
本文出自 “hanyun.fang” 博客,转载请与作者联系!
公司最近在生产环境上线内网dns服务器,开源组件选的是powerdns。其中客户端要安装powerdns-recursor,那么疑问来了,线上有100多台server,如何高效快速安装,就得我们运维考虑啦。由于线上之前有部署ansible来批量管理服务器,于是我这的方案就是ansible+定制好的rmp包powerdns-recursor+ansible-doc yum模块。
2、构建本地yum仓库
因为我没找到ansible安装rpm包的模块,所有只能用yum模块,因此先要构造本地yum仓库,详细参考我的另外一篇博客/article/4223591.html
3、构建定制rpm包,后面找时间补上这块的内容
4、前3步准备好以后,接下来安装就很容易。
ansible ttp_www -m yum -a 'name=http://172.16.1.211:81/powerdns-recursor-3.7.3-0.el6.x86_64.rpm state=installed' --sudo
x.x.x.x | success >> {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Loaded plugins: downloadonly, fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.zju.edu.cn\n * epel: ftp.cuhk.edu.hk\n * extras: mirrors.163.com\n * updates: mirrors.zju.edu.cn\nSetting up Install Process\nExamining /var/tmp/yum-root-Chl1dY/powerdns-recursor-3.7.3-0.el6.x86_64.rpm: powerdns-recursor-3.7.3-0.el6.x86_64\nMarking /var/tmp/yum-root-Chl1dY/powerdns-recursor-3.7.3-0.el6.x86_64.rpm to be installed\nResolving Dependencies\n--> Running transaction check\n---> Package powerdns-recursor.x86_64 0:3.7.3-0.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n powerdns-recursor\n x86_64 3.7.3-0.el6 /powerdns-recursor-3.7.3-0.el6.x86_64 9.8 M\n\nTransaction Summary\n================================================================================\nInstall 1 Package(s)\n\nTotal size: 9.8 M\nInstalled size: 9.8 M\nDownloading Packages:\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n\r Installing : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\r Verifying : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\nInstalled:\n powerdns-recursor.x86_64 0:3.7.3-0.el6 \n\nComplete!\n"
]
}
x.x.x.x | success >> {
"changed": true,
"msg": "http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/x86_64/repodata/1391f50a2eef61cff2d1b2f05609edfb43368031e4a19ddf85bddda5847df910-primary.sqlite.bz2: [Errno 14] PYCURL ERROR 7 - \"couldn't connect to host\"\nTrying other mirror.\n",
"rc": 0,
"results": [
"Loaded plugins: downloadonly, fastestmirror\nLoading mirror speeds from cached hostfile\n * base: mirrors.pubyun.com\n * epel: ftp.cuhk.edu.hk\n * extras: mirrors.pubyun.com\n * updates: centos.ustc.edu.cn\nSetting up Install Process\nExamining /var/tmp/yum-root-4imk7e/powerdns-recursor-3.7.3-0.el6.x86_64.rpm: powerdns-recursor-3.7.3-0.el6.x86_64\nMarking /var/tmp/yum-root-4imk7e/powerdns-recursor-3.7.3-0.el6.x86_64.rpm to be installed\nResolving Dependencies\n--> Running transaction check\n---> Package powerdns-recursor.x86_64 0:3.7.3-0.el6 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package Arch Version Repository Size\n================================================================================\nInstalling:\n powerdns-recursor\n x86_64 3.7.3-0.el6 /powerdns-recursor-3.7.3-0.el6.x86_64 9.8 M\n\nTransaction Summary\n================================================================================\nInstall 1 Package(s)\n\nTotal size: 9.8 M\nInstalled size: 9.8 M\nDownloading Packages:\nRunning rpm_check_debug\nRunning Transaction Test\nTransaction Test Succeeded\nRunning Transaction\n\r Installing : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\r Verifying : powerdns-recursor-3.7.3-0.el6.x86_64 1/1 \n\nInstalled:\n powerdns-recursor.x86_64 0:3.7.3-0.el6 \n\nComplete!\n"
]
}
本文出自 “hanyun.fang” 博客,转载请与作者联系!
相关文章推荐
- FPM CPU很高
- RedHat 5.8下以rpm方式安装Mysql
- 【飞控学习1】APM和PX4飞控源码下载及安装
- product_store_shipment_meth
- Zabbix,Nagios,OneAPM Servers 安装部署大比拼
- Ubuntu 14.04 RPM debian format
- 工具系列——npm对的包管理
- npm配置代理
- Zabbix Server和MPM(monitor for mysql)的快速部署
- 服务器状态监控之snmp&ipmi
- PSI/SI深入学习2——PSI信息解析(PAT,PMT,CAT)
- 关于DPM(Deformable Part Model)算法中模型可视化的解释
- 从TS流到PAT和PMT
- 如何查询是否通过pmp的考试
- DPM(Deformable Parts Model)--原理(一)
- 三种MPM介绍
- 软件包管理器之一――RPM介绍及应用
- 使用 ipmitool 实现远程管理Dell 系列服务器
- 想要应聘产品经理,从现在开始应该做些什么?
- 应届毕业生如何一步步成为产品经理?