tech_memo / linux / cobbler / setup_cobbler_server


tech_memo/linux/cobbler

前提

  • OSはRHEL6
  • RHEL7の場合は、差分を赤字で記載
  • RHEL8の場合は、差分を青字で記載

手順

  • 以下をWebからRPMを取得しインストール
    • epel
      • RHEL8でのepelインストール方法
        dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    • python-pygments
      • RHEL8では不要
  • yumで以下をインストール
    • cobbler
      • 2020/04/11時点ではepelリポジトリから直接インストールできない?
        sudo dnf install https://download-ib01.fedoraproject.org/pub/epel/8/Modular/aarch64/Packages/c/cobbler-3.1.1-1.module_el8+7359+249b1e21.noarch.rpm
    • dhcp
    • syslinux
    • pykickstart
  • cobblerでインストールするrootユーザのデフォルトパスワードのハッシュ化
    [root@testserver10 ~]# openssl passwd -1 -salt myapp <PASSWORD>
    $1$myapp$4dckLUCDPE.putunpkrDD0
  • /etc/cobbler/settings編集
    ~
    default_password_crypted: "$1$myapp$4dckLUCDPE.putunpkrDD0" #上記ハッシュ化したパスワード
    ~
    next_server: 192.168.0.10
    ~
    server: 192.168.0.10
    ~
    manage_dhcp: 1
  • /etc/cobbler/dhcp.template編集
    subnet 192.168.0.0 netmask 255.255.255.0 { ★
        #option routers             192.168.1.5; ★
        #option domain-name-servers 192.168.1.1; ★
        option subnet-mask         255.255.255.0;
        range dynamic-bootp        192.168.0.220 192.168.0.240; ★
        filename                   "/pxelinux.0";
        default-lease-time         21600;
        max-lease-time             43200;
        next-server                $next_server;
    }
  • /etc/xinetd.d/tftp編集 (RHEL7では不要)
           disable                 = no
  • /etc/xinetd.d/rsync編集 (RHEL7では不要)
           disable = no
  • サービススタート
    [root@testserver10 ~]# service httpd start
    Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.0.10 for ServerName
                                                               [  OK  ]
    [root@testserver10 ~]# service xinetd start
    Starting xinetd:                                           [  OK  ]
    [root@testserver10 ~]# service cobblerd start
    Starting cobbler daemon:                                   [  OK  ]
    • (RHEL7の場合は、xinetdはデフォルトではインストールされないので、tftpとrsyncdを直接起動する)
      # systemctl start tftp
      # systemctl enable rsyncd.service
      # systemctl start rsyncd
  • PXEブートファイルの取得
    # cobbler get-loaders
    • proxy環境下の場合は/etc/cobbler/settingsのproxy_url_extを編集すること
      # external proxy - used by: get-loaders, reposync, signature update
      proxy_url_ext:
        http: http://192.168.0.1:8080/
        https: http://192.168.0.1:8080/
    • /var/lib/cobbler/loaders配下にファイルがdownloadされる。
    • これらのファイルは、cobbler sync実行時にTFTPのディレクトリに自動でコピーされる
  • cobbler syncを実行。エラーがでなければ最低限の設定は完了
  • 以下、cobbler checkの結果
    [root@testserver10 ~]# cobbler check
    The following are potential configuration items that you may want to fix:
    
    1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
    2 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them
    
    Restart cobblerd and then run 'cobbler sync' to apply changes.