{"id":5913,"date":"2016-05-08T20:57:55","date_gmt":"2016-05-08T12:57:55","guid":{"rendered":"http:\/\/rmohan.com\/?p=5913"},"modified":"2016-05-08T20:57:55","modified_gmt":"2016-05-08T12:57:55","slug":"linux-operation-and-maintenance-of-automated-tools-cobbler","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=5913","title":{"rendered":"Linux operation and maintenance of automated tools Cobbler"},"content":{"rendered":"<p>Linux operation and maintenance of automated tools Cobbler<\/p>\n<p>About operating system installation automation, the earlier we use RedHat launched Kickstart to batch install the operating system, in recent years, RedHat has introduced a Cobbler.<\/p>\n<p>Cobbler development using Python, compact and lightweight, able to complete the installation of the system, and even manage some services. (Known as a tool cobbler can learn)<\/p>\n<p>Cobbler supports command line management, web interface management, but also provides an API interface to open the second method.<\/p>\n<p>## Close SELinux, iptables! ! !<\/p>\n<p>A supporting environment installation<\/p>\n<p>yum -y install epel-release <\/p>\n<p>yum -y install cobbler httpd rsync tftp-server xinetd dhcp pykickstart fence-agents<\/p>\n<p>vim \/etc\/xinetd.d\/tftp<\/p>\n<p>service tftp<br \/>\n{<br \/>\nsocket_type = dgram<br \/>\nprotocol = udp<br \/>\nwait = yes<br \/>\nuser = root<br \/>\nserver = \/usr\/sbin\/in.tftpd<br \/>\nserver_args = -s \/var\/lib\/tftpboot<br \/>\ndisable = no<br \/>\nper_source = 11<br \/>\ncps = 100 2<br \/>\nflags = IPv4<br \/>\n}<\/p>\n<p>vim \/etc\/xinetd.d\/rsync<\/p>\n<p>service rsync<br \/>\n{<br \/>\ndisable = no<br \/>\nflags = IPv6<br \/>\nsocket_type = stream<br \/>\nwait = no<br \/>\nuser = root<br \/>\nserver = \/usr\/bin\/rsync<br \/>\nserver_args = &#8211;daemon<br \/>\nlog_on_failure += USERID<br \/>\n}<\/p>\n<p>vim \/etc\/httpd\/conf<\/p>\n<p>ServerName 127.0.0.1:80<\/p>\n<p>openssl passwd -1 -salt &#8216;random-phrase-here&#8217; &#8216;test123&#8217;<br \/>\n$1$random-p$mzxQ\/Sx848sXgvfwJCoZM0<\/p>\n<p>vim \/etc\/cobbler\/settings<\/p>\n<p>manage_dhcp: 1 <\/p>\n<p>manage_tftpd: 1<\/p>\n<p>manage_rsync: 1 <\/p>\n<p>next_server: 192.168.1.10 <\/p>\n<p>server: 192.168.1.10 <\/p>\n<p>default_password_crypted: &#8220;$1$random-p$mzxQ\/Sx848sXgvfwJCoZM0&#8243; <\/p>\n<p> vim \/etc\/cobbler\/dhcp.template <\/p>\n<p>subnet 192.168.1.0 netmask 255.255.255.0 {<br \/>\noption routers 192.168.1.2;<br \/>\noption subnet-mask 255.255.255.0;<br \/>\nrange dynamic-bootp 192.168.1.100 192.168.1.120;<br \/>\ndefault-lease-time 21600;<br \/>\nmax-lease-time 43200;<br \/>\nnext-server $next_server;<\/p>\n<p>chkconfig &#8211;add httpd<br \/>\nchkconfig &#8211;add xinetd<br \/>\nchkconfig &#8211;add dhcpd<br \/>\nchkconfig &#8211;add cobblerd<br \/>\nservice httpd start<br \/>\nservice xinetd start<br \/>\nservice dhcpd start<br \/>\nservice cobblerd start<\/p>\n<p> cobbler check <\/p>\n<p> The following are potential configuration items that you may want to fix:<\/p>\n<p>1 : service dhcpd is not running<br \/>\n2 : debmirror package is not installed, it will be required to manage debian deployments and repositories<\/p>\n<p>Restart cobblerd and then run &#8216;cobbler sync&#8217; to apply changes.<\/p>\n<p>cobbler sync<br \/>\ntask started: 2015-05-27_010456_sync<br \/>\ntask started (id=Sync, time=Wed May 27 01:04:56 2015)<br \/>\nrunning pre-sync triggers<br \/>\ncleaning trees<br \/>\nmkdir: \/var\/lib\/tftpboot\/pxelinux.cfg<br \/>\nmkdir: \/var\/lib\/tftpboot\/grub<br \/>\nmkdir: \/var\/lib\/tftpboot\/s390x<br \/>\nmkdir: \/var\/lib\/tftpboot\/ppc<br \/>\nmkdir: \/var\/lib\/tftpboot\/etc<br \/>\nremoving: \/var\/lib\/tftpboot\/grub\/images<br \/>\ncopying bootloaders<br \/>\ntrying hardlink \/var\/lib\/cobbler\/loaders\/pxelinux.0 -> \/var\/lib\/tftpboot\/pxelinux.0<br \/>\ntrying hardlink \/var\/lib\/cobbler\/loaders\/menu.c32 -> \/var\/lib\/tftpboot\/menu.c32<br \/>\ntrying hardlink \/var\/lib\/cobbler\/loaders\/yaboot -> \/var\/lib\/tftpboot\/yaboot<br \/>\ntrying hardlink \/var\/lib\/cobbler\/loaders\/grub-x86.efi -> \/var\/lib\/tftpboot\/grub\/grub-x86.efi<br \/>\ntrying hardlink \/var\/lib\/cobbler\/loaders\/grub-x86_64.efi -> \/var\/lib\/tftpboot\/grub\/grub-x86_64.efi<br \/>\ncopying distros to tftpboot<br \/>\ncopying images<br \/>\ngenerating PXE configuration files<br \/>\ngenerating PXE menu structure<br \/>\nrendering DHCP files<br \/>\ngenerating \/etc\/dhcp\/dhcpd.conf<br \/>\nrendering TFTPD files<br \/>\ngenerating \/etc\/xinetd.d\/tftp<br \/>\ncleaning link caches<br \/>\nrendering Rsync files<br \/>\nrunning post-sync triggers<br \/>\nrunning python triggers from \/var\/lib\/cobbler\/triggers\/sync\/post\/*<br \/>\nrunning python trigger cobbler.modules.sync_post_restart_services<br \/>\nrunning: dhcpd -t -q<br \/>\nreceived on stdout:<br \/>\nreceived on stderr:<br \/>\nrunning: service dhcpd restart<br \/>\nreceived on stdout: dhcpd?<\/p>\n<p>received on stderr:<br \/>\nrunning shell triggers from \/var\/lib\/cobbler\/triggers\/sync\/post\/*<br \/>\nrunning python triggers from \/var\/lib\/cobbler\/triggers\/change\/*<br \/>\nrunning python trigger cobbler.modules.scm_track<br \/>\nrunning shell triggers from \/var\/lib\/cobbler\/triggers\/change\/*<br \/>\n*** TASK COMPLETE ***<\/p>\n<p>service xinetd restart<br \/>\nservice cobblerd restart<\/p>\n<p> mount \/dev\/cdrom \/mnt\/<br \/>\n cobbler import &#8211;path=\/mnt\/ &#8211;arch=x86_64 &#8211;name=CentOS-6.6-minimal<\/p>\n<p>cobbler list<br \/>\ndistros:<br \/>\nCentos-6.6-minimal-x86_64<\/p>\n<p>profiles:<br \/>\nCentos-6.6-minimal-x86_64<\/p>\n<p>systems:<\/p>\n<p>repos:<\/p>\n<p>images:<\/p>\n<p>mgmtclasses:<\/p>\n<p>packages:<\/p>\n<p>files:<\/p>\n<p>ks<\/p>\n<p>shell > vim \/var\/lib\/cobbler\/kickstarts\/Centos-6.6_minimal-x86_64.ks<\/p>\n<p># platform=x86, AMD64,  Intel EM64T<br \/>\n# version=DEVEL<br \/>\n# Firewall configuration<br \/>\nfirewall &#8211;disabled<br \/>\n# Install OS instead of upgrade<br \/>\ninstall<br \/>\n# Use network installation<br \/>\nurl &#8211;url=&#8221;http:\/\/192.168.214.10\/cobbler\/ks_mirror\/Centos-6.6-minimal-x84_64\/&#8221;<br \/>\n# Root password<br \/>\nrootpw &#8211;iscrypted $1$hk0MvN4A$Dz.sYvyDjac1.cMVTk9270<br \/>\n# System authorization information<br \/>\nauth &#8211;useshadow &#8211;passalgo=sha512<br \/>\n# Use text mode install<br \/>\ntext<br \/>\n# System keyboard<br \/>\nkeyboard us<br \/>\n# System language<br \/>\nlang eng_US<br \/>\n# SELinux configuration<br \/>\nselinux &#8211;disabled<br \/>\n# Do not configure the X Window System<br \/>\nskipx<br \/>\n# Installation logging level<br \/>\nlogging &#8211;level=info<br \/>\n# Reboot after installation<br \/>\nreboot<br \/>\n# System timezone<br \/>\ntimezone &#8211;isUtc Asia\/Singapore<br \/>\n# Network information<br \/>\nnetwork &#8211;bootproto=dhcp &#8211;device=eth0 &#8211;onboot=on<br \/>\n# System bootloader configuration<br \/>\nbootloader &#8211;location=mbr<br \/>\n# Clear the Master Boot Record<br \/>\nzerombr<br \/>\n# Partition clearing information<br \/>\nclearpart &#8211;all &#8211;initlabel<br \/>\n# Disk partitioning information<br \/>\npart \/boot &#8211;fstype=&#8221;ext4&#8243; &#8211;size=200<br \/>\npart swap &#8211;fstype=&#8221;swap&#8221; &#8211;size=1024<br \/>\npart \/ &#8211;fstype=&#8221;ext4&#8243; &#8211;grow &#8211;size=1<\/p>\n<p>system-config-kickstart ks<\/p>\n<p>ks <\/p>\n<p>shell > cobbler distro list<br \/>\nCentos-6.6-minimal-x86_64<\/p>\n<p>shell > cobbler profile report &#8211;name Centos-6.6-minimal-x86_64<br \/>\nName : Centos-6.6-minimal-x86_64<br \/>\nTFTP Boot Files : {}<br \/>\nComment :<br \/>\nDHCP Tag : default<br \/>\nDistribution : Centos-6.6-minimal-x86_64<br \/>\nEnable gPXE? : 0<br \/>\nEnable PXE Menu? : 1<br \/>\nFetchable Files : {}<br \/>\nKernel Options : {}<br \/>\nKernel Options (Post Install) : {}<br \/>\nKickstart : \/var\/lib\/cobbler\/kickstarts\/sample_end.ks<br \/>\nKickstart Metadata : {}<br \/>\nManagement Classes : []<br \/>\nManagement Parameters : <<inherit>><br \/>\nName Servers : []<br \/>\nName Servers Search Path : []<br \/>\nOwners : [&#8216;admin&#8217;]<br \/>\nParent Profile :<br \/>\nProxy :<br \/>\nRed Hat Management Key : <<inherit>><br \/>\nRed Hat Management Server : <<inherit>><br \/>\nRepos : []<br \/>\nServer Override : <<inherit>><br \/>\nTemplate Files : {}<br \/>\nVirt Auto Boot : 1<br \/>\nVirt Bridge : xenbr0<br \/>\nVirt CPUs : 1<br \/>\nVirt Disk Driver Type : raw<br \/>\nVirt File Size(GB) : 5<br \/>\nVirt Path :<br \/>\nVirt RAM (MB) : 512<br \/>\nVirt Type : kvm<\/p>\n<p>\/var\/lib\/cobbler\/kickstarts\/sample_end.ks<\/p>\n<p>shell > cobbler profile add &#8211;name=Centos-6.6-minimal &#8211;distro=Centos-6.6-minimal-x86_64 &#8211;kickstart=\/var\/lib\/cobbler\/kickstarts\/Centos-6.6_minimal-x86_64.ks<\/p>\n<p>shell > cobbler profile report &#8211;name Centos-6.6-minimal<br \/>\nName : Centos-6.6-minimal<br \/>\nTFTP Boot Files : {}<br \/>\nComment :<br \/>\nDHCP Tag : default<br \/>\nDistribution : Centos-6.6-minimal-x86_64<br \/>\nEnable gPXE? : 0<br \/>\nEnable PXE Menu? : 1<br \/>\nFetchable Files : {}<br \/>\nKernel Options : {}<br \/>\nKernel Options (Post Install) : {}<br \/>\nKickstart : \/var\/lib\/cobbler\/kickstarts\/Centos-6.6_minimal-x86_64.ks<br \/>\nKickstart Metadata : {}<br \/>\nManagement Classes : []<br \/>\nManagement Parameters : <<inherit>><br \/>\nName Servers : []<br \/>\nName Servers Search Path : []<br \/>\nOwners : [&#8216;admin&#8217;]<br \/>\nParent Profile :<br \/>\nProxy :<br \/>\nRed Hat Management Key : <<inherit>><br \/>\nRed Hat Management Server : <<inherit>><br \/>\nRepos : []<br \/>\nServer Override : <<inherit>><br \/>\nTemplate Files : {}<br \/>\nVirt Auto Boot : 1<br \/>\nVirt Bridge : xenbr0<br \/>\nVirt CPUs : 1<br \/>\nVirt Disk Driver Type : raw<br \/>\nVirt File Size(GB) : 5<br \/>\nVirt Path :<br \/>\nVirt RAM (MB) : 512<br \/>\nVirt Type : xenpv<\/p>\n<p>shell > cobbler &#8211;help<br \/>\nusage<br \/>\n=====<br \/>\ncobbler <distro|profile|system|repo|image|mgmtclass|package|file> &#8230;<br \/>\n[add|edit|copy|getks*|list|remove|rename|report] [options|&#8211;help]<br \/>\ncobbler <aclsetup|buildiso|import|list|replicate|report|reposync|sync|validateks|version|signature|get-loaders|hardlink> [options|&#8211;help]<\/p>\n<p>shell > cobbler profile &#8211;help<br \/>\nusage<br \/>\n=====<br \/>\ncobbler profile add<br \/>\ncobbler profile copy<br \/>\ncobbler profile dumpvars<br \/>\ncobbler profile edit<br \/>\ncobbler profile find<br \/>\ncobbler profile getks<br \/>\ncobbler profile list<br \/>\ncobbler profile remove<br \/>\ncobbler profile rename<br \/>\ncobbler profile report<\/p>\n<p>shell > cobbler sync<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux operation and maintenance of automated tools Cobbler<\/p>\n<p>About operating system installation automation, the earlier we use RedHat launched Kickstart to batch install the operating system, in recent years, RedHat has introduced a Cobbler.<\/p>\n<p>Cobbler development using Python, compact and lightweight, able to complete the installation of the system, and even manage some services. (Known [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5913"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5913"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5913\/revisions"}],"predecessor-version":[{"id":5914,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/5913\/revisions\/5914"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}