LoginSignup
0
0

More than 1 year has passed since last update.

RHEL8.4(ppc64le) で Ansible 2.9 をオフライン・インストール

Last updated at Posted at 2021-10-17
はじめに

Power Systems 上の LPAR の RHEL 8.4 サーバーに Ansible をオフラインで導入したログです。


環境

OS: RHEL 8.4 (ppc64le, "Server with GUI" でインストール。追加パッケージなし。インターネット非接続)
HW: IBM Power S824

モジュール入手元

・RPM find : https://rpmfind.net/linux/RPM/index.html
・インストール iso ファイルを yum repository に設定する


■ OS バージョン確認

# cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.4:GA"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.4"


# uname -a
Linux testvm1 4.18.0-305.el8.ppc64le #1 SMP Thu Apr 29 08:53:15 EDT 2021 ppc64le ppc64le ppc64le GNU/Linux

導入・確認

■ Ansible の RPM 導入を試します。

まずは、ansible rpm を指定してインストール実行

# ls -l
total 17888
-rw-r--r--. 1 root root 17721112 Oct 16 23:23 ansible-2.9.25-1.el8.noarch.rpm

# rpm -ivh ansible-2.9.25-1.el8.noarch.rpm
warning: ansible-2.9.25-1.el8.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
error: Failed dependencies:
    python3-jinja2 is needed by ansible-2.9.25-1.el8.noarch
    python3-jmespath is needed by ansible-2.9.25-1.el8.noarch
    python3.6dist(cryptography) is needed by ansible-2.9.25-1.el8.noarch
    python3.6dist(jinja2) is needed by ansible-2.9.25-1.el8.noarch
    sshpass is needed by ansible-2.9.25-1.el8.noarch

python3-jinja2、python3-jmespath、python3.6dist(cryptography)、sshpass が必要とのこと。


Base と AppStream の yum repository を インストール時に使用した iso ファイルから作成して導入できるモジュールがないか確認します。

# yum repolist
repo id                                repo name
dvd-AppStream                          RHEL84_AppStream
dvd-BaseOS                             RHEL84_BaseOS

=> python3-jinja2 と python3-jmespath は AppStream 内にありました。


■ python3-jinja2 を導入。前提も一緒に導入されています。

 yum install python3-jinja2
Last metadata expiration check: 0:01:25 ago on Sat 16 Oct 2021 11:38:42 PM EDT.
Dependencies resolved.
===================================================================================================================================================================
 Package                                     Architecture                     Version                                 Repository                              Size
===================================================================================================================================================================
Installing:
 python3-jinja2                              noarch                           2.10.1-2.el8_0                          dvd-AppStream                          538 k
Installing dependencies:
 python3-babel                               noarch                           2.5.1-5.el8                             dvd-AppStream                          4.8 M
 python3-markupsafe                          ppc64le                          0.23-19.el8                             dvd-AppStream                           39 k

Transaction Summary
===================================================================================================================================================================
Install  3 Packages

Total size: 5.3 M
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                           1/1
  Installing       : python3-markupsafe-0.23-19.el8.ppc64le                                                                                                    1/3
  Installing       : python3-babel-2.5.1-5.el8.noarch                                                                                                          2/3
  Installing       : python3-jinja2-2.10.1-2.el8_0.noarch                                                                                                      3/3
  Running scriptlet: python3-jinja2-2.10.1-2.el8_0.noarch                                                                                                      3/3
  Verifying        : python3-babel-2.5.1-5.el8.noarch                                                                                                          1/3
  Verifying        : python3-jinja2-2.10.1-2.el8_0.noarch                                                                                                      2/3
  Verifying        : python3-markupsafe-0.23-19.el8.ppc64le                                                                                                    3/3
Installed products updated.

Installed:
  python3-babel-2.5.1-5.el8.noarch                  python3-jinja2-2.10.1-2.el8_0.noarch                  python3-markupsafe-0.23-19.el8.ppc64le

Complete!

「python3-jmespath」 はログは省略しますが、yum AppStream 内から導入しています。


その他のモジュールは、RPM find などを利用してppc64le のモジュールを探してきました。

■ sshpass の導入

# rpm -ivh sshpass-1.06-9.el8.ppc64le.rpm
warning: sshpass-1.06-9.el8.ppc64le.rpm: Header V3 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:sshpass-1.06-9.el8               ################################# [100%]

■ python3-cryptographyの導入

# rpm -ivh python3-cryptography-3.2.1-4.el8.ppc64le.rpm
warning: python3-cryptography-3.2.1-4.el8.ppc64le.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
error: Failed dependencies:
    python3-cffi >= 1.7 is needed by python3-cryptography-3.2.1-4.el8.ppc64le

=> python3-cryptography には、python3-cffi(1.7以上)が必要とされました。

■ (RPM find より探してきて) python3-cffiを導入

# rpm -ivh python3-cffi-1.11.5-5.el8.ppc64le.rpm
warning: python3-cffi-1.11.5-5.el8.ppc64le.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
error: Failed dependencies:
    python3-pycparser is needed by python3-cffi-1.11.5-5.el8.ppc64le
[root@p8188l ansible]# yum search python3-pycparser
Last metadata expiration check: 0:12:38 ago on Sat 16 Oct 2021 11:38:42 PM EDT.
============================================================= Name Exactly Matched: python3-pycparser =============================================================
python3-pycparser.noarch : C parser and AST generator written in Python

python3-cffi では、さらに python3-pycparser が必要とのこと。

=> yum 内、Base OS に存在したので、こちらを導入します。

# yum search python3-pycparser
Last metadata expiration check: 0:13:33 ago on Sat 16 Oct 2021 11:38:42 PM EDT.
============================================================= Name Exactly Matched: python3-pycparser =============================================================
python3-pycparser.noarch : C parser and AST generator written in Python

■ (python3-pycparser導入後) 改めて、python3-cffi の導入

# rpm -ivh python3-cffi-1.11.5-5.el8.ppc64le.rpm
warning: python3-cffi-1.11.5-5.el8.ppc64le.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-cffi-1.11.5-5.el8        ################################# [100%]

■ (python3-cffi 導入後) 改めて、python3-cryptographyの導入

# rpm -ivh python3-cryptography-3.2.1-4.el8.ppc64le.rpm
warning: python3-tography-3.2.1-4.el8.ppc64le.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-cryptography-3.2.1-4.el8 ################################# [100%]

■ ansible 2.9 導入

# rpm -ivh ansible-2.9.25-1.el8.noarch.rpm
warning: ansible-2.9.25-1.el8.noarch.rpm: Header V4 RSA/SHA256 Signature, key ID 2f86d6a1: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:ansible-2.9.25-1.el8             ################################# [100%]

■ 確認

# which ansible
/usr/bin/ansible
# ansible --version
ansible 2.9.25
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Mar 18 2021, 09:10:27) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]

導入できました。


■まとめ

モジュール依存関係と導入元

・ansible (RPM find より)
・python3-jinja2 (yum AppStream内)
  ・python3-babel (python3-jinja2の前提, AppStream内)
  ・python3-markupsafe (python3-jinja2の前提, AppStream内)
・python3-jmespath (yum AppStream内) 追加のモジュール導入なし。
・sshpass (RPM find より)
・python3.6dist(cryptography) (RPM find より)
  ・python3-cffi (python3-cryptographyの前提, RPM find より)
     ・python3-pycparser (python3-cffiの前提, RPM find より)


おわりに

rpm のバージョンが変わると必要モジュールも変わってきますがご参考まで。

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0