cobbler 自動部署安裝配置

 

  1. Installing: 
  2.  PyYAML         i386   3.08-4.el5      /PyYAML-3.08-4.el5.i386            721 k 
  3.  PyYAML         x86_64 3.08-4.el5      /PyYAML-3.08-4.el5.x86_64          741 k 
  4.  cobbler        noarch 2.0.11-2.el5    /cobbler-2.0.11-2.el5.noarch       2.2 M 
  5.  createrepo     noarch 0.4.11-3.el5    /createrepo-0.4.11-3.el5.noarch    216 k 
  6.  libyaml        i386   0.1.2-3.el5     /libyaml-0.1.2-3.el5.i386          115 k 
  7.  libyaml        x86_64 0.1.2-3.el5     /libyaml-0.1.2-3.el5.x86_64        123 k 
  8.  mod_python     x86_64 3.2.8-3.1       /mod_python-3.2.8-3.1.x86_64       1.2 M 
  9.  python-cheetah i386   2.0.1-2.el5     /python-cheetah-2.0.1-2.el5.i386   2.0 M 
  10.  python-cheetah x86_64 2.0.1-2.el5     /python-cheetah-2.0.1-2.el5.x86_64 2.0 M 
  11.  python-netaddr noarch 0.5.2-1.el5     /python-netaddr-0.5.2-1.el5.noarch 1.6 M 
  12.  
  13. [root@rhel57 cobberrpm]# yum -y install dhcp httpd xinetd tftp-server  
  14.  
  15. [root@rhel57 cobberrpm]# cobbler check 
  16. cobblerd does not appear to be running/accessible 
  17. [root@rhel57 cobberrpm]# service cobblerd status 
  18. cobblerd is stopped 
  19. [root@rhel57 cobberrpm]# service cobblerd start 
  20. Starting cobbler daemon:                                   [  OK  ] 
  21. [root@rhel57 cobberrpm]# cobbler check 
  22. httpd does not appear to be running and proxying cobbler 
  23. [root@rhel57 cobberrpm]# service httpd restart 
  24. Stopping httpd:                                            [FAILED] 
  25. Starting httpd:                                            [  OK  ] 
  26. [root@rhel57 cobberrpm]# cobbler check 
  27. httpd does not appear to be running and proxying cobbler 
  28.  
  29. [root@rhel57 cobberrpm]# getenforce  
  30. Enforcing 
  31. [root@rhel57 cobberrpm]# setenforce 0 
  32. [root@rhel57 cobberrpm]# getenforce  
  33. Permissive 
  34. [root@rhel57 cobberrpm]# cobbler check 
  35. The following are potential configuration items that you may want to fix: 
  36.  
  37. 1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it. 
  38. 2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1and should match the IP of the boot server on the PXE network. 
  39. 3 : Must enable a selinux boolean to enable vital web services components, run: setsebool -P httpd_can_network_connect true 
  40. 4 : you need to set some SELinux content rules to ensure cobbler serves content correctly in your SELinux environment, run the following: /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/.*" && /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*" 
  41. 5 : you need to set some SELinux rules if you want to use cobbler-web (an optional package), run the following: /usr/sbin/semanage fcontext -a -t httpd_sys_content_rw_t "/var/lib/cobbler/webui_sessions/.*" 
  42. 6 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, orif you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements. 
  43. 7 : change 'disable' to 'no' in /etc/xinetd.d/tftp 
  44. 8 : change 'disable' to 'no' in /etc/xinetd.d/rsync 
  45. 9 : debmirror package is not installed, it will be required to manage debian deployments and repositories 
  46. 10 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try"openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one 
  47.  
  48. Restart cobblerd and then run 'cobbler sync' to apply changes. 
  49.  
  50.  
  51. [root@rhel57 cobberrpm]# setsebool -P httpd_can_network_connect=1 
  52.  
  53. [root@rhel57 cobberrpm]# setenforce 1 
  54. [root@rhel57 cobberrpm]# cobbler check 
  55. The following are potential configuration items that you may want to fix: 
  56.  
  57. 1 : The 'server' field in /etc/cobbler/settings must be set to something other than localhost, or kickstarting features will not work.  This should be a resolvable hostname or IP for the boot server as reachable by all machines that will use it. 
  58. 2 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1and should match the IP of the boot server on the PXE network. 
  59. 3 : you need to set some SELinux content rules to ensure cobbler serves content correctly in your SELinux environment, run the following: /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/.*" && /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*" 
  60. 4 : you need to set some SELinux rules if you want to use cobbler-web (an optional package), run the following: /usr/sbin/semanage fcontext -a -t httpd_sys_content_rw_t "/var/lib/cobbler/webui_sessions/.*" 
  61. 5 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, orif you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements. 
  62. 6 : change 'disable' to 'no' in /etc/xinetd.d/tftp 
  63. 7 : change 'disable' to 'no' in /etc/xinetd.d/rsync 
  64. 8 : debmirror package is not installed, it will be required to manage debian deployments and repositories 
  65. 9 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try"openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one 
  66.  
  67. Restart cobblerd and then run 'cobbler sync' to apply changes. 
  68.  
  69. [root@rhel57 cobberrpm]# cat /etc/cobbler/settings |grep -v ^.*# |grep server 
  70. build_reporting_smtp_server: "localhost" 
  71. default_name_servers: [] 
  72. ldap_server: "ldap.example.com" 
  73. next_server: 192.168.0.7 
  74. redhat_management_server: "xmlrpc.rhn.redhat.com" 
  75. server: 192.168.0.7 
  76. [root@rhel57 cobberrpm]# service cobblerd restart 
  77.  
  78. [root@rhel57 cobberrpm]# vim /etc/xinetd.d/tftp 
  79. [root@rhel57 cobberrpm]# vim /etc/xinetd.d/rsync 
  80. [root@rhel57 cobberrpm]# openssl passwd -1 -salt 'random' 'redhat' 
  81. $1$random$ARddkLOcxeu5GR/EqWdQK1 
  82. [root@rhel57 cobberrpm]# cat /etc/cobbler/settings |grep -v ^.*# |grep pass 
  83. default_password_crypted: "$1$mF86/UHC$WvcIcX2t6crBz2onWxyac." 
  84. ldap_search_passwd: '' 
  85. [root@rhel57 cobberrpm]# vim /etc/cobbler/settings  
  86. [root@rhel57 cobberrpm]# vim /etc/cobbler/settings  
  87. [root@rhel57 cobberrpm]# service cobblerd restart 
  88. Stopping cobbler daemon:                                   [  OK  ] 
  89. Starting cobbler daemon:                                   [  OK  ] 
  90. [root@rhel57 cobberrpm]# vim /etc/selinux/config  
  91. [root@rhel57 cobberrpm]# setenforce 0 
  92. [root@rhel57 cobberrpm]# service cobblerd restart 
  93. Stopping cobbler daemon:                                   [  OK  ] 
  94. Starting cobbler daemon:                                   [  OK  ] 
  95. [root@rhel57 cobberrpm]#  /usr/sbin/semanage fcontext -a -t public_content_t "/tftpboot/.*" && /usr/sbin/semanage fcontext -a -t public_content_t "/var/www/cobbler/images/.*" 
  96. /usr/sbin/semanage: File context for /tftpboot/.* already defined 
  97. [root@rhel57 cobberrpm]# cobbler sync 
  98. task started: 2011-12-08_002820_sync 
  99. task started (id=Sync, time=Thu Dec  8 00:28:20 2011
  100. running pre-sync triggers 
  101. cleaning trees 
  102. mkdir: /tftpboot/pxelinux.cfg 
  103. mkdir: /tftpboot/grub 
  104. mkdir: /tftpboot/images 
  105. mkdir: /tftpboot/s390x 
  106. mkdir: /tftpboot/ppc 
  107. mkdir: /tftpboot/etc 
  108. removing: /tftpboot/grub/images 
  109. copying bootloaders 
  110. copying: /usr/lib/syslinux/pxelinux.0 -> /tftpboot/pxelinux.0 
  111. copying: /usr/lib/syslinux/menu.c32 -> /tftpboot/menu.c32 
  112. copying: /usr/lib/syslinux/memdisk -> /tftpboot/memdisk 
  113. copying distros 
  114. copying images 
  115. generating PXE configuration files 
  116. cleaning link caches 
  117. generating PXE menu structure 
  118. running post-sync triggers 
  119. running python triggers from /var/lib/cobbler/triggers/sync/post/* 
  120. running python trigger cobbler.modules.sync_post_restart_services 
  121. running shell triggers from /var/lib/cobbler/triggers/sync/post/* 
  122. running python triggers from /var/lib/cobbler/triggers/change/* 
  123. running python trigger cobbler.modules.scm_track 
  124. running shell triggers from / 
  125.  
  126.   
  127.  
  128. [root@rhel57 cobberrpm]# mount -oloop -r /mnt/hgfs/ISO/rhel-server-5.7-x86_64-dvd.iso  /cdrom 
  129.  
  130. cobbler import --path=/cdrom/  --name=rhel5764 --arch=x86_64 
  131.  
  132. [root@rhel57 ks_mirror]# cobbler report 
  133. distros: 
  134. ========== 
  135. Name                           : rhel5764-x86_64 
  136. Architecture                   : x86_64 
  137. Breed                          : redhat 
  138. Comment                        : rhel5.7 
  139. Initrd                         : /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/pxeboot/initrd.img 
  140. Kernel                         : /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/pxeboot/vmlinuz 
  141. Kernel Options                 : {} 
  142. Kernel Options (Post Install)  : {} 
  143. Kickstart Metadata             : {'tree''http://@@http_server@@/cblr/links/rhel5764-x86_64'
  144. Management Classes             : [] 
  145. OS Version                     : rhel5 
  146. Owners                         : ['admin'
  147. Red Hat Management Key         : <<inherit>> 
  148. Red Hat Management Server      : <<inherit>> 
  149. Template Files                 : {} 
  150.  
  151. Name                           : rhel5764-xen-x86_64 
  152. Architecture                   : x86_64 
  153. Breed                          : redhat 
  154. Comment                        : rhel5.7 
  155. Initrd                         : /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/xen/initrd.img 
  156. Kernel                         : /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/xen/vmlinuz 
  157. Kernel Options                 : {} 
  158. Kernel Options (Post Install)  : {} 
  159. Kickstart Metadata             : {'tree''http://@@http_server@@/cblr/links/rhel5764-xen-x86_64'
  160. Management Classes             : [] 
  161. OS Version                     : rhel5 
  162. Owners                         : ['admin'
  163. Red Hat Management Key         : <<inherit>> 
  164. Red Hat Management Server      : <<inherit>> 
  165. Template Files                 : {} 
  166.  
  167. profiles: 
  168. ========== 
  169. Name                           : rhel5764-x86_64 
  170. Comment                        :  
  171. DHCP Tag                       : default 
  172. Distribution                   : rhel5764-x86_64 
  173. Enable PXE Menu?               : 1 
  174. Kernel Options                 : {} 
  175. Kernel Options (Post Install)  : {} 
  176. Kickstart                      : /var/lib/cobbler/kickstarts/sample.ks 
  177. Kickstart Metadata             : {} 
  178. Management Classes             : [] 
  179. Name Servers                   : [] 
  180. Name Servers Search Path       : [] 
  181. Owners                         : ['admin'
  182. Parent Profile                 :  
  183. Red Hat Management Key         : <<inherit>> 
  184. Red Hat Management Server      : <<inherit>> 
  185. Repos                          : [] 
  186. Server Override                : <<inherit>> 
  187. Template Files                 : {} 
  188. Virt Auto Boot                 : 1 
  189. Virt Bridge                    : xenbr0 
  190. Virt CPUs                      : 1 
  191. Virt File Size(GB)             : 5 
  192. Virt Path                      :  
  193. Virt RAM (MB)                  : 512 
  194. Virt Type                      : qemu 
  195.  
  196. Name                           : rhel5764-xen-x86_64 
  197. Comment                        :  
  198. DHCP Tag                       : default 
  199. Distribution                   : rhel5764-xen-x86_64 
  200. Enable PXE Menu?               : 1 
  201. Kernel Options                 : {} 
  202. Kernel Options (Post Install)  : {} 
  203.  
  204. Kernel Options (Post Install)  : {} 
  205. Kickstart                      : /var/lib/cobbler/kickstarts/sample.ks 
  206. Kickstart Metadata             : {} 
  207. Management Classes             : [] 
  208. Name Servers                   : [] 
  209. Name Servers Search Path       : [] 
  210. Owners                         : ['admin'
  211. Parent Profile                 :  
  212. Red Hat Management Key         : <<inherit>> 
  213. Red Hat Management Server      : <<inherit>> 
  214. Repos                          : [] 
  215. Server Override                : <<inherit>> 
  216. Template Files                 : {} 
  217. Virt Auto Boot                 : 1 
  218. Virt Bridge                    : xenbr0 
  219. Virt CPUs                      : 1 
  220. Virt File Size(GB)             : 5 
  221. Virt Path                      :  
  222. Virt RAM (MB)                  : 512 
  223. Virt Type                      : xenpv 
  224.  
  225.  
  226. systems: 
  227. ========== 
  228.  
  229. repos: 
  230. ========== 
  231.  
  232. images: 
  233. ========== 
  234.  
  235.  vi /etc/cobbler/dhcp.template 
  236.  
  237. [root@rhel57 ks_mirror]# cobbler sync 
  238. task started: 2011-12-08_013212_sync 
  239. task started (id=Sync, time=Thu Dec  8 01:32:12 2011
  240. running pre-sync triggers 
  241. cleaning trees 
  242. removing: /var/www/cobbler/images/rhel5764-x86_64 
  243. removing: /var/www/cobbler/images/rhel5764-xen-x86_64 
  244. removing: /tftpboot/pxelinux.cfg/default 
  245. removing: /tftpboot/grub/images 
  246. removing: /tftpboot/grub/efidefault 
  247. removing: /tftpboot/s390x/profile_list 
  248. copying bootloaders 
  249. copying: /usr/lib/syslinux/pxelinux.0 -> /tftpboot/pxelinux.0 
  250. copying: /usr/lib/syslinux/menu.c32 -> /tftpboot/menu.c32 
  251. copying: /usr/lib/syslinux/memdisk -> /tftpboot/memdisk 
  252. copying distros 
  253. copying files for distro: rhel5764-x86_64 
  254. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/pxeboot/vmlinuz -> /tftpboot/images/rhel5764-x86_64/vmlinuz 
  255. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/pxeboot/initrd.img -> /tftpboot/images/rhel5764-x86_64/initrd.img 
  256. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/pxeboot/vmlinuz -> /var/www/cobbler/images/rhel5764-x86_64/vmlinuz 
  257. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/pxeboot/initrd.img -> /var/www/cobbler/images/rhel5764-x86_64/initrd.img 
  258. copying files for distro: rhel5764-xen-x86_64 
  259. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/xen/vmlinuz -> /tftpboot/images/rhel5764-xen-x86_64/vmlinuz 
  260. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/xen/initrd.img -> /tftpboot/images/rhel5764-xen-x86_64/initrd.img 
  261. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/xen/vmlinuz -> /var/www/cobbler/images/rhel5764-xen-x86_64/vmlinuz 
  262. trying hardlink /var/www/cobbler/ks_mirror/rhel5764-x86_64/images/xen/initrd.img -> /var/www/cobbler/images/rhel5764-xen-x86_64/initrd.img 
  263. copying images 
  264. generating PXE configuration files 
  265.  
  266. generating PXE configuration files 
  267. cleaning link caches 
  268. generating PXE menu structure 
  269. running post-sync triggers 
  270. running python triggers from /var/lib/cobbler/triggers/sync/post/* 
  271. running python trigger cobbler.modules.sync_post_restart_services 
  272. running shell triggers from /var/lib/cobbler/triggers/sync/post/* 
  273. running python triggers from /var/lib/cobbler/triggers/change/* 
  274. running python trigger cobbler.modules.scm_track 
  275. running shell triggers from /var/lib/cobbler/triggers/change/* 
  276. *** TASK COMPLETE *** 
  277.  
  278. service xinetd start 
  279. service dhcpd start 
  280. service cobblerd start 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章