Automated deployment of Cobbler UBUNTU14

Source: Internet
Author: User
Tags locale chrony

Overview

This example is mainly implemented through cobbler, with the seed script file, to automate the installation and deployment of the Ubunut environment, and install the corresponding software and the corresponding basic configuration, this method can be deployed for large-scale cluster infrastructure such as Ceph.

Seed file: An automated deployment profile and kickstart file functionality for the Debian Ubuntu platform is the same. In fact, Ubuntu can also use KS files, but only the basic environment configuration, can not customize the package installation and script run.

Experimental environment


      • cobbler-server:1.1.1.122 centos7.2

      • Ubuntu client: KVM Virtual machine


Defining the release version distro

    1. Import external installation sources, such as CD-ROM imported locally will be placed under/var/www/cobbler/ks_mirror, via HTTP output, assuming that the Ubuntu installation CD is attached to the local/mnt

      1. Cobbler Import--name= "UBUNTU14"--path=/mnt "Import installation Source" Cobbler distro List "View Existing installation sources"

Creating a profile for changing profiles

1. Used in conjunction with the corresponding distribution, to achieve the same release version of the different installation options, not the same name as distro. By default, the profile that is associated with it is automatically established when the distro is completed. If you want to manually create and specify a seed file, use the following:

Cobbler profile Add--name=ubuntu14-x86_64--distro=ubuntu14--kickstart=/var/lib/cobbler/kickstarts/ubuntu.seed " Specify the release version as UBUNTU14 and specify the name and location of the seed file, with many kickstart and seed file templates in the/var/lib/cobbler/kickstarts/directory of Cobbler

The content of the specific seed file is listed later. Of course, these operations can be done under the Web UI interface and are intuitive.

2. View the existing profile

Cobbler Profile List

Add Installation node system

The main function is to identify the differences in installation options for different nodes, such as IP, DNS, hostname, etc., based on the MAC address of the node.

Cobbler system Add--name=ceph-deploy--hostname=ceph-deploy.test.com--dns-name=ceph-deploy.test.com--profile= ubuntu14-x86_64--interface=eth0--mac= [MAC address]--ip-address=1.1.1.30--subnet=255.255.255.0--gateway=1.1.1.1-- Static=1

This allows the client to automatically pick up the appropriate system when it detects a matching Mac by PXE boot, and assigns the appropriate address during the installation. If it does not match the Boot menu interface will appear cobbler default.


Preseed file

A seed file is listed here, which generally applies to most UBUNTU14 installations, but in some cases there may be some exceptions, and seed is not as good as KS compatibility, and there may be a difference between large versions. In this case, only the 14 version, the 12 version is not available, because I also have limited understanding of the seed file, so only for reference

##############  Network configuration ############ #d-i netcfg/choose_interface select auto##############  Pre Install############# Command Line 1: This is necessary  Otherwise you will be prompted to umount /dev/sda. see ubuntu  bug  #1347726 .d-i preseed/early_command string        umount /media | |  true      ############## Net Image##############  For more than 12.10 versions, be sure to configure this d-i live-installer/net-image string ############# #语言设置 ############ #d-i  debian-installer/locale string end-i debian-installer/country string cnd-i  Debian-installer/locale string en_us. utf-8d-i debian-installer/language string en##############  Keyboard settings ############ #d-i  Console-setup/ask_detect boolean falsed-i console-setup/layoutcode&nBsp;string usd-i console-setup/variantcode stringd-i keyboard-configuration/layoutcode  string us##############  installation Source Configuration ############# #安装源配置d-i mirror/country string  manuald-i mirror/http/proxy string 1.1.1.122     #此处必须填写, otherwise the installation system will wait a long time d-i  mirror/http/hostname string 1.1.1.122d-i mirror/http/directory string /ubuntu/# ############# apt ############ #如不配置此项, it will be stuck for a long time while installing the package, but does not affect the final installation results d-i apt-setup/security_host  String 172.16.245.240d-i apt-setup/security_path string /ubuntu############### clock  and time zone############# #d-i clock-setup/ntp boolean trued-i clock-setup /ntp-server string 1.1.1.1d-i time/zone string asia/shanghaid-i clock-setup/cst  boolean true############## partitioning############# #清楚磁盘中所有的lvm分区d-i partman-lvm/device_ remove_lvm boolean true#  Clear all RAID partitions d-i partman-md/device_remove_md boolean true# use disk for normal partitioning d-i  partman-auto/method string  regulard-i partman-auto/disk string /dev/vda      #kvm虚拟机中磁盘是vda, if a real machine is a sda# predefined partitioning method, each partition is defined in a row, with a. End # three numbers per set of partitions: Minimum partition number MB, priority (the smaller the higher the priority), Maximum number of partitions mbd-i partman-auto/expert_recipe string                                boot-root ::                                                             150 150 150 ext4                                                           $primary { }  $bootable { }                                         method{ format } format{ }                                      use_filesystem{ } filesystem{ ext4 }                            mountpoint{ /boot }                                     .                                                                 8000  8000  8000 linux-swap                                                  method{ swap  } format{&nBSP;}                                .                                                                   204800 204800 204800 ext4                                                method{ format } format{ }                                      use_filesystem{ } filesystem{ ext4 }                            mountpoint{ / }                                         .               d-i partman-partitioning/confirm_write_new_label boolean  true  #不提示写入fenqu信息到磁盘d-i partman/choose_partition select finish d-i  partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true # Do not prompt to overwrite existing data on the disk ##############&nBsp packages##############  here at present I can only choose the package group, unable to formulate a specific installation package, do not know the specific why. tasksel tasksel/first multiselect openssh-server#  Disable Automatic Updates on installation d-i pkgsel/upgrade  select noned-i pkgsel/update-policy select nonepopularity-contest popularity-contest/ participate boolean false############## users and password############# #允许使用root登录d-I.  passwd/root-login boolean true#  do not set up other users d-i passwd/make-user boolean false# Allows the use of weak password d-i user-setup/allow-password-weak boolean true# to configure the root password, generated through the MKPASSWD program d-i passwd/ root-password-crypted password $1$rsmbi5p0$bwmhi.i4mnzpmwfxpbey0/############## bootloader##### ####### #d-i grub-installer/only_debian boolean trued-i finish-install/reboot_in_progress  note     #安装完成后重启 ##############  Execute scripts and commands after installation ############# #所有命令通过; If you use the General command can be executed directly, but at this time the real system is being hung under the load/target/, so the ultimate goal is to/target/, if you want to use system-level commands, such asExecute scripts, and so on. Need to pass chroor  to/target, with target root   to normal execution, otherwise error. #第一个命令是修改ssh配置文件 to allow root login # The second command is to download the Soures.list, which implements the internal apt source definition. #第三个命令是去掉cobbler中system的自动引导, or the next time you restart the system will be reinstalled. #第四个命令是下载并执行一个脚本, implement the public key injection function. #第五个命令是更新apt源, and install the specified package. #第六个命令则修改puppet配置文件和chrony时间服务的配置文件. D-i preseed/late_command string         sed -i   '/permitrootlogin / s/ .*/ yes/'  /target/etc/ssh/sshd_config;          wget http://$http _server/cobbler/repo_mirror/trusty-sources.list  -O /target/etc/a        pt/sources.list;          wget http://$http _server/cblr/svc/op/nopxe/system/$system _name - o /dev/null;         cd /target;          wget http://$http _server/cobbler/svc/public_key.sh; chmod +x ./public_key.sh; chr        oot ./ ./ public_key.sh;         chroot ./ apt-get update;          chroot ./ apt-get install -y -- force-yes vim chrony puppet;         cd -  ;         sed -i  ' 8 s/^.*/server= puppet-server.chinergy.com.cn/'  /target/etc/puppet/puppet.         conf; sed -i  ' 4 s/^.*/server 1.1.1.1 iburst/'  /target/etc/chrony/ Chrony.conf

Public key Injection script content

Mkdir/root/.sshcat >>/root/.ssh/authorized_keys << Puppetssh-rsa aaaab3nzac1yc2eaaaadaqabaaabaqck0cgpsrcwvikbe+y4sdmtcrinkxglvxdtjhi1m4v+hvuf0vuo7dmjesfcucpjvrn09o8erycpy548b/ mjboy0zfp16+5mgw6y9nh/vhtoxfqka1nadbkqrih7chv40io7cfxfbndcl+ 5ntyhzhabpx4tz5qwswgnpnl8ymfyex2dxp64woiwvicko2yovockyyigkgiob6vc6zk6xkr1ljhar1esaaybzskncnak8qrf4tucvvi++ qnl9giilj+oattnolid3umz5+j5/hrfhhxnzr7p0q/fjbqovgtbqxaldjfym6zr679db4nimuobxphvuovgfqddok7w/[email protected] PUPPET

Summarize

Personal feeling Ubuntu's seed file is more complex than KS, and is more error-prone, and very detailed documentation is very few, so in their own environment to constantly test the changes, and finally achieve the appropriate version of their environment. It is not yet known how the snippets variable was successfully referenced in the Post script phase, and there are many ways to make an error, so simply use the Execute script instead.


Automated deployment of Cobbler UBUNTU14

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.