2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

インターネット非接続環境でAIXに aws cli を導入する

Last updated at Posted at 2023-08-31

はじめに

IBM Cloud Object Storage や AWS の S3 に対して aws コマンドで操作が可能です。

インターネット非接続のプライベートネットワーク環境にある AIX で aws cli の導入方法を確認しました。


環境

OS: AIX 7.2TL5SP5

  • OSバージョンの違いで必要なモジュールが変わります。
  • 当手順は事前にインターネット接続環境で必要なモジュールの確認がとれた上で実行しています。

手順の流れ

① python-pip のダウンロードとサーバーへの配置
② pip python-pip をインストール (AIX Toolbox for Open Source Software から導入)
③ pip で導入するモジュールのダウンロードとサーバーへの配置
④ awscli 導入


作業

① python-pip をダウンロード

AIX Toolbox for Open Source Software から pip をダウンロードします。

当環境では次のモジュールを使用しました。

ダウンロードしたモジュールをサーバーに配置します。


② python-pip.noarch のインストール
# rpm -ivh python-pip-10.0.1-1.aix6.1.noarch.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python-pip-10.0.1-1              ################################# [100%]
# echo $?
0
#
# which pip
/usr/bin/pip
#

③ pip で導入するモジュールのダウンロードとサーバーへの配置

事前にインターネット接続環境のAIX 7.2TL5SP5 では pip install awscli 実行時に以下のモジュールがダウンロード、インストールされました。

同じモジュールをダウンロードし、対象のAIX環境に配置します。


④ awscli 導入

pip install コマンドで --find-linksでモジュールが配置されているディレクトリを指定し、awscli 導入を実行します。

# pip install --no-index --find-links=./ awscli
Looking in links: ./
Collecting awscli
Requirement already satisfied: PyYAML<5.5,>=3.10 in /opt/freeware/lib/python2.7/site-packages (from awscli) (3.11)
Collecting docutils<0.16,>=0.10 (from awscli)
Collecting s3transfer<0.5.0,>=0.4.0 (from awscli)
Collecting rsa<=4.5.0,>=3.1.2; python_version == "2.7" (from awscli)
Collecting colorama<0.4.4,>=0.2.5 (from awscli)
Collecting botocore==1.20.112 (from awscli)
Collecting futures<4.0.0,>=2.2.0; python_version == "2.7" (from s3transfer<0.5.0,>=0.4.0->awscli)
Collecting pyasn1>=0.1.3 (from rsa<=4.5.0,>=3.1.2; python_version == "2.7"->awscli)
Collecting urllib3<1.27,>=1.25.4 (from botocore==1.20.112->awscli)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.20.112->awscli)
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.20.112->awscli)
Requirement already satisfied: six>=1.5 in /opt/freeware/lib/python2.7/site-packages (from python-dateutil<3.0.0,>=2.1->botocore==1.20.112->awscli) (1.10.0)
cloud-init 0.7.5 requires requests, which is not installed.
jsonpatch 1.8 has requirement jsonpointer>=1.3, but you'll have jsonpointer 1.0 which is incompatible.
Installing collected packages: docutils, futures, urllib3, python-dateutil, jmespath, botocore, s3transfer, pyasn1, rsa, colorama, awscli
Successfully installed awscli-1.19.112 botocore-1.20.112 colorama-0.4.3 docutils-0.15.2 futures-3.4.0 jmespath-0.10.0 pyasn1-0.5.0 python-dateutil-2.8.2 rsa-4.5 s3transfer-0.4.2 urllib3-1.26.16
#

数分時間を要しました。

確認

無事導入されていることを確認しました。
当手順では awscli v1.19.112 が導入されました。

# pip list
Package             Version
------------------- --------
awscli              1.19.112
boto                2.34.0
botocore            1.20.112
Cheetah             2.4.4
cloud-init          0.7.5
colorama            0.4.3
configobj           5.0.5
docutils            0.15.2
futures             3.4.0
iniparse            0.4
jmespath            0.10.0
jsonpatch           1.8
jsonpointer         1.0
oauth               1.0.1
pip                 10.0.1
prettytable         0.7.2
pyasn1              0.5.0
pycurl              7.19.3
pyserial            2.7
pysqlite            1.1.7
python-dateutil     2.8.2
PyXML               0.8.4
PyYAML              3.11
rsa                 4.5
s3transfer          0.4.2
setuptools          0.9.8
six                 1.10.0
urlgrabber          3.10.1
urllib3             1.26.16
yum-metadata-parser 1.1.4
#

/opt/freeware/bin の下にコマンドがあります。

# ls -l /opt/freeware/bin/aws*
-rwxr-xr-x    1 root     system          823 Aug 29 00:30 /opt/freeware/bin/aws
-rwxr-xr-x    1 root     system         1432 Aug 29 00:25 /opt/freeware/bin/aws.cmd
-rwxr-xr-x    1 root     system          204 Aug 29 00:25 /opt/freeware/bin/aws_bash_completer
-rwxr-xr-x    1 root     system         1144 Aug 29 00:30 /opt/freeware/bin/aws_completer
-rwxr-xr-x    1 root     system         1807 Aug 29 00:25 /opt/freeware/bin/aws_zsh_completer.sh
#

PATH は設定されていないため、/opt/freeware/bin/ をパスに追加します。

# export PATH=$PATH:/opt/freeware/bin
# which aws
/opt/freeware/bin/aws
#

以上です。

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?