Rhel
在 rhel 機器 7.6 版本上安裝 ansible 的正確方法是什麼
我們想
ansible
在 rhel 7.6 機器上安裝離線(參考 - https://www.linuxschoolonline.com/how-to-install-ansible-offline-on-centos-or-redhat/)Ansible 需要在系統上存在以下先決條件
python-crypto python-httplib python-jinja2 python-keyczar sshpass
所以我們通過 yum 安裝所有請求的 rpm
我們可以看到它失敗了
Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch) Requires: python2.7dist(pyasn1) Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch) Requires: python2.7dist(pycrypto) > 2.0
請注意 - 我們已註冊到 redhat 7.x 儲存庫,我們不確定需要從哪裡獲取失去的 rpm,以及為什麼 rhel repo 不包含所有必需的 rpm?
安裝所有這些必需的 rpm 的建議是什麼?
yum localinstall -y python-keyczar-0.71c-2.el7.noarch.rpm sshpass-1.06-2.el7.x86_64.rpm python2-crypto-2.6.1-15.el7.x86_64.rpm python-httplib2-0.9.2-1.el7.noarch.rpm python-jinja2-2.7.2-4.el7.noarch.rpm python-keyczar-0.71c-8.mga7.noarch.rpm Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager Examining python-keyczar-0.71c-2.el7.noarch.rpm: python-keyczar-0.71c-2.el7.noarch Marking python-keyczar-0.71c-2.el7.noarch.rpm to be installed Examining sshpass-1.06-2.el7.x86_64.rpm: sshpass-1.06-2.el7.x86_64 sshpass-1.06-2.el7.x86_64.rpm: does not update installed package. Examining python2-crypto-2.6.1-15.el7.x86_64.rpm: python2-crypto-2.6.1-15.el7.x86_64 Marking python2-crypto-2.6.1-15.el7.x86_64.rpm to be installed Examining python-httplib2-0.9.2-1.el7.noarch.rpm: python-httplib2-0.9.2-1.el7.noarch Marking python-httplib2-0.9.2-1.el7.noarch.rpm as an update to python-httplib2-0.9.1-2.1.el7.noarch Examining python-jinja2-2.7.2-4.el7.noarch.rpm: python-jinja2-2.7.2-4.el7.noarch Marking python-jinja2-2.7.2-4.el7.noarch.rpm as an update to python-jinja2-2.7.2-3.el7_6.noarch Examining python-keyczar-0.71c-8.mga7.noarch.rpm: python-keyczar-0.71c-8.mga7.noarch Marking python-keyczar-0.71c-8.mga7.noarch.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package python-httplib2.noarch 0:0.9.1-2.1.el7 will be updated ---> Package python-httplib2.noarch 0:0.9.2-1.el7 will be an update ---> Package python-jinja2.noarch 0:2.7.2-3.el7_6 will be updated ---> Package python-jinja2.noarch 0:2.7.2-4.el7 will be an update ---> Package python-keyczar.noarch 0:0.71c-2.el7 will be installed ---> Package python-keyczar.noarch 0:0.71c-8.mga7 will be installed --> Processing Dependency: python2.7dist(pycrypto) > 2.0 for package: python-keyczar-0.71c-8.mga7.noarch --> Processing Dependency: python2.7dist(pyasn1) for package: python-keyczar-0.71c-8.mga7.noarch ---> Package python2-crypto.x86_64 0:2.6.1-15.el7 will be installed --> Processing Dependency: libtomcrypt.so.0()(64bit) for package: python2-crypto-2.6.1-15.el7.x86_64 --> Running transaction check ---> Package libtomcrypt.x86_64 0:1.17-26.el7 will be installed --> Processing Dependency: libtommath >= 0.42.0 for package: libtomcrypt-1.17-26.el7.x86_64 --> Processing Dependency: libtommath.so.0()(64bit) for package: libtomcrypt-1.17-26.el7.x86_64 ---> Package python-keyczar.noarch 0:0.71c-8.mga7 will be installed --> Processing Dependency: python2.7dist(pycrypto) > 2.0 for package: python-keyczar-0.71c-8.mga7.noarch --> Processing Dependency: python2.7dist(pyasn1) for package: python-keyczar-0.71c-8.mga7.noarch --> Running transaction check ---> Package libtommath.x86_64 0:0.42.0-6.el7 will be installed ---> Package python-keyczar.noarch 0:0.71c-8.mga7 will be installed --> Processing Dependency: python2.7dist(pycrypto) > 2.0 for package: python-keyczar-0.71c-8.mga7.noarch --> Processing Dependency: python2.7dist(pyasn1) for package: python-keyczar-0.71c-8.mga7.noarch --> Finished Dependency Resolution Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch) Requires: python2.7dist(pyasn1) Error: Package: python-keyczar-0.71c-8.mga7.noarch (/python-keyczar-0.71c-8.mga7.noarch) Requires: python2.7dist(pycrypto) > 2.0 ********************************************************************** yum can be configured to try to resolve such errors by temporarily enabling disabled repos and searching for missing dependencies. To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf **********************************************************************
您正在嘗試安裝兩個版本的
python-keyczar
,其中一個用於 Mageia;這就是破壞交易的原因。一般來說,要弄清楚離線安裝需要哪些包,您應該從基線開始,然後執行
sudo yum install --downloadonly --downloaddir=<directory> <package>
這會將所有必需的包下載到指定目錄。
在 Ansible 的情況下,您將按照RHEL 7 的安裝說明進行操作:
sudo subscription-manager repos --enable rhel-7-server-ansible-2.9-rpms mkdir /tmp/ansible-packages sudo yum install --downloadonly --downloaddir=/tmp/ansible-packages ansible
這會將所有要求下載到
/tmp/ansible-packages
. 然後,您可以將軟體包複製到其他系統(假設您的 RHEL 訂閱中有適當數量的單元)並使用yum localinstall
.