まず始めに考えなければならないことは共通です。つまり、各クライアントで実行される単純なスクリプト可能なコマンドを使用して取得およびインストールできるように、必要なファイルを一元化された場所にデプロイすることです。本章では、これらすべての要素を組み合わせて、組織内の任意のシステムから呼び出すことができる単一のスクリプトを作成する方法について説明します。
# First, install the latest client RPMs to the system.
rpm -Uvh \
http://proxy-or-sat.example.com.com/pub/rhn_register-2.8.27-1.7.3.i386.rpm \
http://proxy-or-sat.example.com.com/pub/rhn_register-gnome-2.8.27-1.7.3.i386.rpm \
http://proxy-or-sat.example.com.com/pub/up2date-3.0.7-1.i386.rpm \
http://proxy-or-sat.example.com.com/pub/up2date-gnome-3.0.7-1.i386.rpm
# Second, reconfigure the clients to talk to the correct server.
perl -p -i -e 's/s/www\.rhns\.redhat\.com/proxy-or-sat\.example\.com/g' \
/etc/sysconfig/rhn/rhn_register \
/etc/sysconfig/rhn/up2date
# Third, install the SSL client certificate for your company's
# RHN Satellite Server or RHN Proxy Server.
rpm -Uvh http://proxy-or-sat.example.com/pub/rhn-org-trusted-ssl-cert-*.noarch.rpm
# Fourth, reconfigure the clients to use the new SSL certificate.
perl -p -i -e 's/^sslCA/#sslCA/g;' \
/etc/sysconfig/rhn/up2date /etc/sysconfig/rhn/rhn_register
echo "sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" \
>> /etc/sysconfig/rhn/up2date
echo "sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" \
>> /etc/sysconfig/rhn/rhn_register
# Fifth, download the GPG key needed to validate custom packages.
wget -O - -q http://proxy-or-sat.example.com.com/pub/YOUR-RPM-GPG-KEY
# Sixth, import that GPG key to your GPG keyring.
rpm --import /path/to/YOUR-RPM-GPG-KEY
# First, install the latest client RPMs to the system.
rpm -Uvh \
http://proxy-or-sat.example.com.com/pub/rhn_register-2.8.27-1.7.3.i386.rpm \
http://proxy-or-sat.example.com.com/pub/rhn_register-gnome-2.8.27-1.7.3.i386.rpm \
http://proxy-or-sat.example.com.com/pub/up2date-3.0.7-1.i386.rpm \
http://proxy-or-sat.example.com.com/pub/up2date-gnome-3.0.7-1.i386.rpm
# Second, reconfigure the clients to talk to the correct server.
perl -p -i -e 's/s/www\.rhns\.redhat\.com/proxy-or-sat\.example\.com/g' \
/etc/sysconfig/rhn/rhn_register \
/etc/sysconfig/rhn/up2date
# Third, install the SSL client certificate for your company's
# RHN Satellite Server or RHN Proxy Server.
rpm -Uvh http://proxy-or-sat.example.com/pub/rhn-org-trusted-ssl-cert-*.noarch.rpm
# Fourth, reconfigure the clients to use the new SSL certificate.
perl -p -i -e 's/^sslCA/#sslCA/g;' \
/etc/sysconfig/rhn/up2date /etc/sysconfig/rhn/rhn_register
echo "sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" \
>> /etc/sysconfig/rhn/up2date
echo "sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" \
>> /etc/sysconfig/rhn/rhn_register
# Fifth, download the GPG key needed to validate custom packages.
wget -O - -q http://proxy-or-sat.example.com.com/pub/YOUR-RPM-GPG-KEY
# Sixth, import that GPG key to your GPG keyring.
rpm --import /path/to/YOUR-RPM-GPG-KEY
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
6 番目のステップは、Red Hat Linux 3 以降を実行しているシステムに関連するため、ここに記載されていることを忘れないでください。Red Hat Enterprise Linux 2.1 の場合は、以下のコマンドを使用してください。
gpg $(up2date --gpg-flags) --import /path/to/YOUR-RPM-GPG-KEY
gpg $(up2date --gpg-flags) --import /path/to/YOUR-RPM-GPG-KEY
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
このスクリプトはクリーンで反復可能なプロセスで構成され、RHN Proxy Server または RHN Satellite Server に登録するために準備として、あらゆる Red Hat Network クライアントを完全に設定します。RHN Server の URL、その公開ディレクトリー、実際の GPG キーなどのキーの値を、スクリプト内に記載されているプレースホルダーに挿入する必要があることに注意してください。また、環境によっては、追加の変更が必要になる場合があります。このスクリプトはほぼそのままの状態で機能する可能性がありますが、ガイドとして使用する必要があります。
wget -O - http://proxy-or-sat.example.com.com/pub/bootstrap_script | bash
wget -O - http://proxy-or-sat.example.com.com/pub/bootstrap_script | bash
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
その場合、この 1 行のコマンドをネットワーク上のすべてのシステムで呼び出すことができます。管理者が該当するすべてのシステムに SSH アクセスできる場合、これらのすべてのシステム上で操作を繰り返し、コマンドをリモートで実行するのは簡単な作業です。既存のキックスタートスクリプトの %post セクションにこのスクリプトを追加すると良いでしょう。