AnsibleTower自建研究7

單台離線安裝

ZONGRU Li
6 min readFeb 12, 2023

開了一台t3.xlarge(4c16g)

加開空間到30G

擺上iso到/tmp目錄下(下載iso的位置在LINK,另一個下載處LINK):

對外連線只限機台本身:

然後Mount DVD:

#先切到root:
sudo su

#Mount Linux 8.x Binary DVD ISO
mkdir /mnt/disc
mount -r -o loop /tmp/rhel-8.7-x86_64-dvd.iso /mnt/disc/

#Copy example repo file from ISO file
cp /mnt/disc/media.repo /etc/yum.repos.d/rhel8disc.repo
chmod 644 /etc/yum.repos.d/rhel8disc.repo

#編輯repo file來設定本地repository:
vi /etc/yum.repos.d/rhel8disc.repo

#內容如下:
[RHEL8-Server-DVD-Appstream]
name=Red Hat Enterprise Linux 8.7.0 (DVD) Appstream
mediaid=None
metadata_expire=-1
gpgcheck=1
cost=500
baseurl=file:///mnt/disc/AppStream
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[RHEL8-Server-DVD-BaseOS]
name=Red Hat Enterprise Linux 8.7.0 (DVD) BaseOS
mediaid=None
metadata_expire=-1
gpgcheck=1
cost=500
baseurl=file:///mnt/disc/BaseOS
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


#確認:
dnf repolist

#2023/03/10補充,也可以透過指令下載iso:
reposync -nm -v --download-metadata --repo rhel-8-for-x86_64-appstream-rpms
reposync -nm -v --download-metadata --repo rhel-8-for-x86_64-baseos-rpms

其他下載iso甚至分享local repository方式參考(LINK)

在這環境下執行update

#嘗試執行update:
sudo yum update -y
看起來可以離線跑!!

後面卡在:

#只留下兩個DVD掛上去的,其餘關閉:
yum-config-manager --disable ansible-2-for-rhel-8-rhui-rpms
yum-config-manager --disable rhel-8-appstream-rhui-rpms
yum-config-manager --disable rhel-8-baseos-rhui-rpms
yum-config-manager --disable rhui-client-config-server-8

再次update:

過程一樣有402個套件

最後有完成:

解壓上傳的安裝檔:

#root下:
tar zxf ansible-automation-platform-setup-bundle-2.2.1-1.1.tar.gz

編輯inventory檔:

清空後參考官方單台範例(LINK):

我改成這樣:

現在比較有疑問的就是上面registry的防火牆要不要特別開了

執行setup.sh檔案

yes後才想到:

我忘了弄ssh連線...補弄:

測試連線自己:

再次建置:

大概十多分鐘後完成:

真的完成離線安裝,所以其實安裝過程"registry.redhat.io"其實沒有需要連線

這個只是單台

所以先移除

--

--

ZONGRU Li
ZONGRU Li

Written by ZONGRU Li

2022/11/17 開源部分個人筆記給LINE "Java程式語言討論區"社群,希望能對社群的技術學習做一點點貢獻.(掩面....記得退訂閱!

No responses yet