dnf_aixtoolbox.sh を使用した AIX 7.2TL5SP3 への cloud-init の導入

##### はじめに

PowerVC 取込み用のイメージにするため、素の AIX 7.2 TL5 SP3 にdnf_aixtoolbox.sh を使用 して AIX Toolbox から cloud-init を導入します。

https://www.ibm.com/support/pages/aix-toolbox-open-source-software-downloads-date

> Official site for Downloading Packages
>For easy dnf installation use dnf_aixtoolbox.sh script. This script will download and install rpm.rte and all the packages needed for dnf. 

---

##### 環境

AIX 7.2 TL5 SP3  (proxy 経由でインターネットアクセスが可能)

AIX 7.2 TL5 SP3 のインストール直後のデフォルトのrpmは以下です。

```
tcl-8.4.7-3.ppc
expect-5.42.1-3.ppc
AIX-rpm-7.2.5.101-7.ppc
tk-8.4.7-3.ppc
```

dnf_aixtoolbox.sh を AIX Toolbox for Open Source Software のサイトからダウンロードして、対象サーバーに配置します。

----

#### dnf の導入

dnf_aixtoolbox.sh を用いて dnf およびリポジトリを設定します。

```
# ./dnf_aixtoolbox.sh -d
Attempting download of dnf_bundle_aix_71_72.tar ...
Saving to 'dnf_bundle_aix_71_72.tar'...
168 MB received in 104 seconds (1.61 MB/sec)

Extracting dnf_bundle_aix_71_72.tar ...
x ca-certificates-2020.06.01-0.aix7.1.ppc.rpm, 952182 bytes, 1860 tape blocks
x dnf-4.2.17-32_1.aix7.1.noarch.rpm, 11676 bytes, 23 tape blocks
x dnf-automatic-4.2.17-32_1.aix7.1.noarch.rpm, 13016 bytes, 26 tape blocks
x dnf-data-4.2.17-32_1.aix7.1.noarch.rpm, 24151 bytes, 48 tape blocks
x extra_list, 218 bytes, 1 tape blocks
x install_dnf.sh, 11065 bytes, 22 tape blocks
x libcomps-0.1.11-32_1.aix7.1.ppc.rpm, 1273338 bytes, 2487 tape blocks
x libdnf-0.39.1-32_1.aix7.1.ppc.rpm, 15810379 bytes, 30880 tape blocks
x libmodulemd-1.5.2-32_1.aix7.1.ppc.rpm, 3419904 bytes, 6680 tape blocks
x librepo-1.11.0-32_1.aix7.1.ppc.rpm, 3650338 bytes, 7130 tape blocks
x libsmartcols-2.34-32_1.aix7.1.ppc.rpm, 183412 bytes, 359 tape blocks
x libsolv-0.7.9-32_1.aix7.1.ppc.rpm, 1533403 bytes, 2995 tape blocks
x libzstd-1.4.4-32_1.aix7.1.ppc.rpm, 469194 bytes, 917 tape blocks
x p11-kit-0.23.16-0.aix7.1.ppc.rpm, 1047702 bytes, 2047 tape blocks
x p11-kit-tools-0.23.16-0.aix7.1.ppc.rpm, 39777 bytes, 78 tape blocks
x python3-3.7.9-0.aix7.1.ppc.rpm, 43168080 bytes, 84313 tape blocks
x python3-dateutil-2.8.0-1.aix6.1.noarch.rpm, 363137 bytes, 710 tape blocks
x python3-devel-3.7.9-0.aix7.1.ppc.rpm, 237244 bytes, 464 tape blocks
x python3-dnf-4.2.17-32_1.aix7.1.noarch.rpm, 197935 bytes, 387 tape blocks
x python3-dnf-plugin-migrate-4.0.16-32_1.aix7.1.noarch.rpm, 8546 bytes, 17 tape blocks
x python3-dnf-plugins-core-4.0.16-32_1.aix7.1.noarch.rpm, 49763 bytes, 98 tape blocks
x python3-docs-3.7.9-0.aix7.1.ppc.rpm, 2993180 bytes, 5847 tape blocks
x python3-gpgme-1.13.1-32_1.aix7.1.ppc.rpm, 682308 bytes, 1333 tape blocks
x python3-hawkey-0.39.1-32_1.aix7.1.ppc.rpm, 3113691 bytes, 6082 tape blocks
x python3-libcomps-0.1.11-32_1.aix7.1.ppc.rpm, 1020925 bytes, 1994 tape blocks
x python3-libdnf-0.39.1-32_1.aix7.1.ppc.rpm, 22549730 bytes, 44043 tape blocks
x python3-librepo-1.11.0-32_1.aix7.1.ppc.rpm, 2292962 bytes, 4479 tape blocks
x python3-six-1.13.0-1.aix6.1.noarch.rpm, 514483 bytes, 1005 tape blocks
x python3-test-3.7.9-0.aix7.1.ppc.rpm, 28383122 bytes, 55436 tape blocks
x python3-tools-3.7.9-0.aix7.1.ppc.rpm, 12734 bytes, 25 tape blocks
x rpm-python3-4.15.1-32_1.aix7.1.ppc.rpm, 100168 bytes, 196 tape blocks
x rpm.rte, 40620032 bytes, 79336 tape blocks
x yum-4.2.17-32_1.aix7.1.noarch.rpm, 9188 bytes, 18 tape blocks
x zchunk-1.1.4-32_1.aix7.1.ppc.rpm, 552363 bytes, 1079 tape blocks
x zchunk-devel-1.1.4-32_1.aix7.1.ppc.rpm, 19487 bytes, 39 tape blocks
x zchunk-libs-1.1.4-32_1.aix7.1.ppc.rpm, 534328 bytes, 1044 tape blocks

Installing rpm.rte at the latest version ...
This may take several minutes depending on the number of rpms installed...
+-----------------------------------------------------------------------------+
                    Pre-installation Verification...
+-----------------------------------------------------------------------------+
Verifying selections...done
Verifying requisites...done
Results...

WARNINGS
--------
  Problems described in this section are not likely to be the source of any
  immediate or serious failures, but further actions may be necessary or
  desired.

  Already Installed
  -----------------
  The number of selected filesets that are either already installed
  or effectively installed through superseding filesets is 1.  See
  the summaries at the end of this installation for details.

  NOTE:  Base level filesets may be reinstalled using the "Force"
  option (-F flag), or they may be removed, using the deinstall or
  "Remove Software Products" facility (-u flag), and then reinstalled.

  << End of Warning Section >>

+-----------------------------------------------------------------------------+
                   BUILDDATE Verification ...
+-----------------------------------------------------------------------------+
Verifying build dates...done
FILESET STATISTICS
------------------
    1  Selected to be installed, of which:
        1  Already installed (directly or via superseding filesets)
  ----
    0  Total to be installed


Pre-installation Failure/Warning Summary
----------------------------------------
Name                      Level           Pre-installation Failure/Warning
-------------------------------------------------------------------------------
rpm.rte                   4.15.1.3        Already installed



Checking whether any of the rpms from dnf_bundle are already installed...
Takes couple of minutes to process.

ca-certificates-2020.06.01-0 will be installed
dnf-4.2.17-32_1 will be installed
dnf-automatic-4.2.17-32_1 will be installed
dnf-data-4.2.17-32_1 will be installed
libcomps-0.1.11-32_1 will be installed
libdnf-0.39.1-32_1 will be installed
libmodulemd-1.5.2-32_1 will be installed
librepo-1.11.0-32_1 will be installed
libsmartcols-2.34-32_1 will be installed
libsolv-0.7.9-32_1 will be installed
libzstd-1.4.4-32_1 will be installed
p11-kit-0.23.16-0 will be installed
p11-kit-tools-0.23.16-0 will be installed
python3-3.7.9-0 will be installed
python3-dnf-4.2.17-32_1 will be installed
python3-gpgme-1.13.1-32_1 will be installed
python3-hawkey-0.39.1-32_1 will be installed
python3-libcomps-0.1.11-32_1 will be installed
python3-libdnf-0.39.1-32_1 will be installed
python3-librepo-1.11.0-32_1 will be installed
rpm-python3-4.15.1-32_1 will be installed
zchunk-libs-1.1.4-32_1 will be installed

Installing the packages...

Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:python3-3.7.9-0                  ################################# [  5%]
   2:libzstd-1.4.4-32_1               ################################# [  9%]
   3:libmodulemd-1.5.2-32_1           ################################# [ 14%]
   4:libsolv-0.7.9-32_1               ################################# [ 18%]
   5:libsmartcols-2.34-32_1           ################################# [ 23%]
   6:zchunk-libs-1.1.4-32_1           ################################# [ 27%]
   7:librepo-1.11.0-32_1              ################################# [ 32%]
   8:rpm-python3-4.15.1-32_1          ################################# [ 36%]
   9:libdnf-0.39.1-32_1               ################################# [ 41%]
  10:python3-libdnf-0.39.1-32_1       ################################# [ 45%]
  11:python3-hawkey-0.39.1-32_1       ################################# [ 50%]
  12:libcomps-0.1.11-32_1             ################################# [ 55%]
  13:python3-libcomps-0.1.11-32_1     ################################# [ 59%]
  14:python3-gpgme-1.13.1-32_1        ################################# [ 64%]
  15:p11-kit-0.23.16-0                ################################# [ 68%]
  16:p11-kit-tools-0.23.16-0          ################################# [ 73%]
  17:dnf-data-4.2.17-32_1             ################################# [ 77%]
  18:python3-dnf-4.2.17-32_1          ################################# [ 82%]
  19:dnf-4.2.17-32_1                  ################################# [ 86%]
  20:dnf-automatic-4.2.17-32_1        ################################# [ 91%]
  21:ca-certificates-2020.06.01-0     ################################# [ 95%]
  22:python3-librepo-1.11.0-32_1      ################################# [100%]

dnf installed successfully.
Please run 'dnf update' to update packages to the latest level.

Please note, RPM packages are downloaded in dnf cache /var/cache/dnf.
RPM packages install files go under the path /opt.
Hence it is recommended to always keep at least 512MB of free space in /var & /opt
to avoid any download and installation/update failures.
```

所要数分程度でした。

---

##### dnf コマンドの確認

以下のレポジトリーが自動構成されています。

```
# /opt/freeware/bin/dnf repolist
repo id                                                      repo name
AIX_Toolbox                                                  AIX generic repository
AIX_Toolbox_72                                               AIX 7.2 specific repository
AIX_Toolbox_noarch                                           AIX noarch repository
```

---

##### cloud-init 導入


dnf コマンドを使用して cloud-init を導入します。

```
# /opt/freeware/bin/dnf search cloud-init
Last metadata expiration check: 0:07:30 ago on Mon Jan 10 11:14:50 2022.
================================================ Name Exactly Matched: cloud-init ================================================
cloud-init.ppc : Cloud node initialization tool
```

```
# /opt/freeware/bin/dnf install cloud-init
AIX generic repository                                                                            4.7 kB/s | 2.6 kB     00:00
AIX noarch repository                                                                             4.3 kB/s | 2.5 kB     00:00
AIX 7.2 specific repository                                                                       5.0 kB/s | 2.5 kB     00:00
Dependencies resolved.
==================================================================================================================================
 Package                            Architecture           Version                       Repository                          Size
==================================================================================================================================
Installing:
 cloud-init                         ppc                    0.7.5-4.3                     AIX_Toolbox                        431 k
Installing dependencies:
 bash                               ppc                    5.1.4-2                       AIX_Toolbox                        2.8 M
 bzip2                              ppc                    1.0.8-2                       AIX_Toolbox                        238 k
 db                                 ppc                    1:5.3.28-1                    AIX_Toolbox                         17 M
 expat                              ppc                    2.2.9-2                       AIX_Toolbox                        895 k
 gdbm                               ppc                    1.19-1                        AIX_Toolbox                        274 k
 gettext                            ppc                    0.20.2-1                      AIX_Toolbox                         11 M
 libtextstyle                       ppc                    0.20.2-1                      AIX_Toolbox                        1.1 M
 glib2                              ppc                    2.56.1-3                      AIX_Toolbox                         16 M
 libffi                             ppc                    3.2.1-3                       AIX_Toolbox                         47 k
 libiconv                           ppc                    1.16-1                        AIX_Toolbox                        1.6 M
 libunistring                       ppc                    0.9.10-1                      AIX_Toolbox                        1.5 M
 libxml2                            ppc                    2.9.11-1                      AIX_Toolbox                        5.5 M
 libyaml                            ppc                    0.2.2-1                       AIX_Toolbox                        506 k
 ncurses                            ppc                    6.2-3                         AIX_Toolbox                        3.5 M
 python                             ppc                    2.7.18-3                      AIX_Toolbox                         22 M
 python-PyYAML                      ppc                    3.11-1                        AIX_Toolbox                        497 k
 python-cheetah                     ppc                    2.4.4-2                       AIX_Toolbox                        940 k
 python-pyserial                    ppc                    2.7-1                         AIX_Toolbox                        154 k
 python-xml                         ppc                    0.8.4-1                       AIX_Toolbox                        1.9 M
 readline                           ppc                    8.1-1                         AIX_Toolbox                        2.5 M
 sqlite                             ppc                    3.35.5-1                      AIX_Toolbox                        8.7 M
 info                               ppc                    6.7-1                         AIX_Toolbox                        699 k
 xz-libs                            ppc                    5.2.5-1                       AIX_Toolbox                        540 k
 zlib                               ppc                    1.2.11-2                      AIX_Toolbox                        335 k
 python-boto                        noarch                 2.34.0-1                      AIX_Toolbox_noarch                 7.7 M
 python-configobj                   noarch                 5.0.5-1                       AIX_Toolbox_noarch                  70 k
 python-jsonpatch                   noarch                 1.8-1                         AIX_Toolbox_noarch                  17 k
 python-jsonpointer                 noarch                 1.0-1                         AIX_Toolbox_noarch                 6.6 k
 python-oauth                       noarch                 1.0.1-1                       AIX_Toolbox_noarch                  16 k
 python-prettytable                 noarch                 0.7.2-1                       AIX_Toolbox_noarch                  37 k
 python-requests                    noarch                 2.4.3-1                       AIX_Toolbox_noarch                 723 k
 python-setuptools                  noarch                 0.9.8-2                       AIX_Toolbox_noarch                 547 k
 python-six                         noarch                 1.10.0-1                      AIX_Toolbox_noarch                  37 k
 libgcc                             ppc                    1:8-1                         AIX_Toolbox_72                      14 k
 libgomp                            ppc                    1:8-1                         AIX_Toolbox_72                      14 k
 libstdc++                          ppc                    1:8-1                         AIX_Toolbox_72                      14 k
 libgcc8                            ppc                    8.3.0-6                       AIX_Toolbox_72                     974 k
 libgomp8                           ppc                    8.3.0-6                       AIX_Toolbox_72                     1.4 M
 libstdc++8                         ppc                    8.3.0-6                       AIX_Toolbox_72                      12 M

Transaction Summary
==================================================================================================================================
Install  40 Packages

Total download size: 123 M
Installed size: 123 M
Is this ok [y/N]: y
Downloading Packages:
(1/40): cloud-init-0.7.5-4.3.aix6.1.ppc.rpm                                                       262 kB/s | 431 kB     00:01
(2/40): bzip2-1.0.8-2.aix6.1.ppc.rpm                                                              136 kB/s | 238 kB     00:01
(3/40): bash-5.1.4-2.aix6.1.ppc.rpm                                                               793 kB/s | 2.8 MB     00:03
(4/40): gdbm-1.19-1.aix6.1.ppc.rpm                                                                 95 kB/s | 274 kB     00:02
(5/40): expat-2.2.9-2.aix6.1.ppc.rpm                                                              161 kB/s | 895 kB     00:05
(6/40): libtextstyle-0.20.2-1.aix6.1.ppc.rpm                                                      730 kB/s | 1.1 MB     00:01
(7/40): gettext-0.20.2-1.aix6.1.ppc.rpm                                                           986 kB/s |  11 MB     00:10
(8/40): libffi-3.2.1-3.aix6.1.ppc.rpm                                                             153 kB/s |  47 kB     00:00
(9/40): db-5.3.28-1.aix6.1.ppc.rpm                                                                807 kB/s |  17 MB     00:21
(10/40): libiconv-1.16-1.aix6.1.ppc.rpm                                                           287 kB/s | 1.6 MB     00:05
(11/40): libunistring-0.9.10-1.aix6.1.ppc.rpm                                                     659 kB/s | 1.5 MB     00:02
(12/40): libyaml-0.2.2-1.aix6.1.ppc.rpm                                                           668 kB/s | 506 kB     00:00
(13/40): ncurses-6.2-3.aix6.1.ppc.rpm                                                             857 kB/s | 3.5 MB     00:04
(14/40): glib2-2.56.1-3.aix6.1.ppc.rpm                                                            423 kB/s |  16 MB     00:37
(15/40): python-PyYAML-3.11-1.aix6.1.ppc.rpm                                                      131 kB/s | 497 kB     00:03
(16/40): python-cheetah-2.4.4-2.aix6.1.ppc.rpm                                                    119 kB/s | 940 kB     00:07
(17/40): python-pyserial-2.7-1.aix6.1.ppc.rpm                                                     511 kB/s | 154 kB     00:00
(18/40): python-2.7.18-3.aix6.1.ppc.rpm                                                           707 kB/s |  22 MB     00:31
(19/40): python-xml-0.8.4-1.aix6.1.ppc.rpm                                                        380 kB/s | 1.9 MB     00:05
(20/40): libxml2-2.9.11-1.aix6.1.ppc.rpm                                                          129 kB/s | 5.5 MB     00:43
(21/40): readline-8.1-1.aix6.1.ppc.rpm                                                            258 kB/s | 2.5 MB     00:10
(22/40): info-6.7-1.aix6.1.ppc.rpm                                                                112 kB/s | 699 kB     00:06
(23/40): zlib-1.2.11-2.aix6.1.ppc.rpm                                                             705 kB/s | 335 kB     00:00
(24/40): xz-libs-5.2.5-1.aix6.1.ppc.rpm                                                           180 kB/s | 540 kB     00:03
(25/40): python-configobj-5.0.5-1.aix6.1.noarch.rpm                                               276 kB/s |  70 kB     00:00
(26/40): python-jsonpatch-1.8-1.aix6.1.noarch.rpm                                                 136 kB/s |  17 kB     00:00
(27/40): python-jsonpointer-1.0-1.aix6.1.noarch.rpm                                                52 kB/s | 6.6 kB     00:00
(28/40): python-oauth-1.0.1-1.aix6.1.noarch.rpm                                                   124 kB/s |  16 kB     00:00
(29/40): python-prettytable-0.7.2-1.aix6.1.noarch.rpm                                             284 kB/s |  37 kB     00:00
(30/40): python-boto-2.34.0-1.aix6.1.noarch.rpm                                                   894 kB/s | 7.7 MB     00:08
(31/40): python-setuptools-0.9.8-2.aix6.1.noarch.rpm                                              868 kB/s | 547 kB     00:00
(32/40): python-six-1.10.0-1.aix6.1.noarch.rpm                                                    233 kB/s |  37 kB     00:00
(33/40): libgcc-8-1.aix7.2.ppc.rpm                                                                 83 kB/s |  14 kB     00:00
(34/40): libgomp-8-1.aix7.2.ppc.rpm                                                                86 kB/s |  14 kB     00:00
(35/40): python-requests-2.4.3-1.aix6.1.noarch.rpm                                                 83 kB/s | 723 kB     00:08
(36/40): libstdcplusplus-8-1.aix7.2.ppc.rpm                                                        73 kB/s |  14 kB     00:00
(37/40): libgcc8-8.3.0-6.aix7.2.ppc.rpm                                                           925 kB/s | 974 kB     00:01
(38/40): libgomp8-8.3.0-6.aix7.2.ppc.rpm                                                          954 kB/s | 1.4 MB     00:01
(39/40): libstdcplusplus8-8.3.0-6.aix7.2.ppc.rpm                                                  536 kB/s |  12 MB     00:23
(40/40): sqlite-3.35.5-1.aix6.1.ppc.rpm                                                           181 kB/s | 8.7 MB     00:49
----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                             1.1 MB/s | 123 MB     01:53
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                          1/1
  Installing       : libgcc8-8.3.0-6.ppc                                                                                     1/40
  Installing       : libgcc-1:8-1.ppc                                                                                        2/40
  Installing       : libstdc++8-8.3.0-6.ppc                                                                                  3/40
  Installing       : zlib-1.2.11-2.ppc                                                                                       4/40
  Installing       : libstdc++-1:8-1.ppc                                                                                     5/40
  Installing       : ncurses-6.2-3.ppc                                                                                       6/40
  Installing       : libffi-3.2.1-3.ppc                                                                                      7/40
  Installing       : libgomp8-8.3.0-6.ppc                                                                                    8/40
  Running scriptlet: libgomp8-8.3.0-6.ppc                                                                                    8/40
  Installing       : libgomp-1:8-1.ppc                                                                                       9/40
  Installing       : bzip2-1.0.8-2.ppc                                                                                      10/40
  Running scriptlet: db-1:5.3.28-1.ppc                                                                                      11/40
  Installing       : db-1:5.3.28-1.ppc                                                                                      11/40
  Installing       : expat-2.2.9-2.ppc                                                                                      12/40
  Installing       : libyaml-0.2.2-1.ppc                                                                                    13/40
  Installing       : python-PyYAML-3.11-1.ppc                                                                               14/40
  Installing       : xz-libs-5.2.5-1.ppc                                                                                    15/40
  Installing       : libtextstyle-0.20.2-1.ppc                                                                              16/40
  Installing       : glib2-2.56.1-3.ppc                                                                                     17/40
  Installing       : libxml2-2.9.11-1.ppc                                                                                   18/40
  Installing       : libunistring-0.9.10-1.ppc                                                                              19/40
  Installing       : libiconv-1.16-1.ppc                                                                                    20/40
  Running scriptlet: libiconv-1.16-1.ppc                                                                                    20/40
add shr4.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
add shr4_64.o shared members from /usr/lib/libiconv.a to  /opt/freeware/lib/libiconv.a
/

  Running scriptlet: gettext-0.20.2-1.ppc                                                                                   21/40
  Installing       : gettext-0.20.2-1.ppc                                                                                   21/40
  Running scriptlet: gettext-0.20.2-1.ppc                                                                                   21/40
  Installing       : bash-5.1.4-2.ppc                                                                                       22/40
  Running scriptlet: bash-5.1.4-2.ppc                                                                                       22/40

        ## Binary "bash" is available in 32bit and 64bit ##

        Default is 64bit. For 32bit, use /opt/freeware/bin/bash_32


  Running scriptlet: info-6.7-1.ppc                                                                                         23/40
  Installing       : info-6.7-1.ppc                                                                                         23/40
  Running scriptlet: info-6.7-1.ppc                                                                                         23/40
Please check that /etc/info-dir does exist.
You might have to rename it from /etc/info-dir.rpmsave to /etc/info-dir.

  Installing       : readline-8.1-1.ppc                                                                                     24/40
  Running scriptlet: readline-8.1-1.ppc                                                                                     24/40
  Installing       : sqlite-3.35.5-1.ppc                                                                                    25/40
  Installing       : gdbm-1.19-1.ppc                                                                                        26/40
  Installing       : python-2.7.18-3.ppc                                                                                    27/40
  Installing       : python-cheetah-2.4.4-2.ppc                                                                             28/40
  Installing       : python-pyserial-2.7-1.ppc                                                                              29/40
  Installing       : python-xml-0.8.4-1.ppc                                                                                 30/40
  Installing       : python-boto-2.34.0-1.noarch                                                                            31/40
  Installing       : python-configobj-5.0.5-1.noarch                                                                        32/40
  Installing       : python-jsonpointer-1.0-1.noarch                                                                        33/40
  Installing       : python-jsonpatch-1.8-1.noarch                                                                          34/40
  Installing       : python-oauth-1.0.1-1.noarch                                                                            35/40
  Installing       : python-prettytable-0.7.2-1.noarch                                                                      36/40
  Installing       : python-setuptools-0.9.8-2.noarch                                                                       37/40
  Installing       : python-six-1.10.0-1.noarch                                                                             38/40
  Installing       : python-requests-2.4.3-1.noarch                                                                         39/40
  Installing       : cloud-init-0.7.5-4.3.ppc                                                                               40/40
  Running scriptlet: cloud-init-0.7.5-4.3.ppc                                                                               40/40
  Running scriptlet: zlib-1.2.11-2.ppc                                                                                      40/40
  Running scriptlet: gettext-0.20.2-1.ppc                                                                                   40/40
  Running scriptlet: bash-5.1.4-2.ppc                                                                                       40/40
  Running scriptlet: readline-8.1-1.ppc                                                                                     40/40
  Verifying        : bash-5.1.4-2.ppc                                                                                        1/40
  Verifying        : bzip2-1.0.8-2.ppc                                                                                       2/40
  Verifying        : cloud-init-0.7.5-4.3.ppc                                                                                3/40
  Verifying        : db-1:5.3.28-1.ppc                                                                                       4/40
  Verifying        : expat-2.2.9-2.ppc                                                                                       5/40
  Verifying        : gdbm-1.19-1.ppc                                                                                         6/40
  Verifying        : gettext-0.20.2-1.ppc                                                                                    7/40
  Verifying        : libtextstyle-0.20.2-1.ppc                                                                               8/40
  Verifying        : glib2-2.56.1-3.ppc                                                                                      9/40
  Verifying        : libffi-3.2.1-3.ppc                                                                                     10/40
  Verifying        : libiconv-1.16-1.ppc                                                                                    11/40
  Verifying        : libunistring-0.9.10-1.ppc                                                                              12/40
  Verifying        : libxml2-2.9.11-1.ppc                                                                                   13/40
  Verifying        : libyaml-0.2.2-1.ppc                                                                                    14/40
  Verifying        : ncurses-6.2-3.ppc                                                                                      15/40
  Verifying        : python-2.7.18-3.ppc                                                                                    16/40
  Verifying        : python-PyYAML-3.11-1.ppc                                                                               17/40
  Verifying        : python-cheetah-2.4.4-2.ppc                                                                             18/40
  Verifying        : python-pyserial-2.7-1.ppc                                                                              19/40
  Verifying        : python-xml-0.8.4-1.ppc                                                                                 20/40
  Verifying        : readline-8.1-1.ppc                                                                                     21/40
  Verifying        : sqlite-3.35.5-1.ppc                                                                                    22/40
  Verifying        : info-6.7-1.ppc                                                                                         23/40
  Verifying        : xz-libs-5.2.5-1.ppc                                                                                    24/40
  Verifying        : zlib-1.2.11-2.ppc                                                                                      25/40
  Verifying        : python-boto-2.34.0-1.noarch                                                                            26/40
  Verifying        : python-configobj-5.0.5-1.noarch                                                                        27/40
  Verifying        : python-jsonpatch-1.8-1.noarch                                                                          28/40
  Verifying        : python-jsonpointer-1.0-1.noarch                                                                        29/40
  Verifying        : python-oauth-1.0.1-1.noarch                                                                            30/40
  Verifying        : python-prettytable-0.7.2-1.noarch                                                                      31/40
  Verifying        : python-requests-2.4.3-1.noarch                                                                         32/40
  Verifying        : python-setuptools-0.9.8-2.noarch                                                                       33/40
  Verifying        : python-six-1.10.0-1.noarch                                                                             34/40
  Verifying        : libgcc-1:8-1.ppc                                                                                       35/40
  Verifying        : libgomp-1:8-1.ppc                                                                                      36/40
  Verifying        : libstdc++-1:8-1.ppc                                                                                    37/40
  Verifying        : libgcc8-8.3.0-6.ppc                                                                                    38/40
  Verifying        : libgomp8-8.3.0-6.ppc                                                                                   39/40
  Verifying        : libstdc++8-8.3.0-6.ppc                                                                                 40/40

Installed:
  cloud-init-0.7.5-4.3.ppc         bash-5.1.4-2.ppc            bzip2-1.0.8-2.ppc                 db-1:5.3.28-1.ppc
  expat-2.2.9-2.ppc                gdbm-1.19-1.ppc             gettext-0.20.2-1.ppc              libtextstyle-0.20.2-1.ppc
  glib2-2.56.1-3.ppc               libffi-3.2.1-3.ppc          libiconv-1.16-1.ppc               libunistring-0.9.10-1.ppc
  libxml2-2.9.11-1.ppc             libyaml-0.2.2-1.ppc         ncurses-6.2-3.ppc                 python-2.7.18-3.ppc
  python-PyYAML-3.11-1.ppc         python-cheetah-2.4.4-2.ppc  python-pyserial-2.7-1.ppc         python-xml-0.8.4-1.ppc
  readline-8.1-1.ppc               sqlite-3.35.5-1.ppc         info-6.7-1.ppc                    xz-libs-5.2.5-1.ppc
  zlib-1.2.11-2.ppc                python-boto-2.34.0-1.noarch python-configobj-5.0.5-1.noarch   python-jsonpatch-1.8-1.noarch
  python-jsonpointer-1.0-1.noarch  python-oauth-1.0.1-1.noarch python-prettytable-0.7.2-1.noarch python-requests-2.4.3-1.noarch
  python-setuptools-0.9.8-2.noarch python-six-1.10.0-1.noarch  libgcc-1:8-1.ppc                  libgomp-1:8-1.ppc
  libstdc++-1:8-1.ppc              libgcc8-8.3.0-6.ppc         libgomp8-8.3.0-6.ppc              libstdc++8-8.3.0-6.ppc

Complete!
```

cloud-init が導入が完了しました!
所要数分程度でした。

---

##### cloud.cfg の確認

```
# find / -name cloud.cfg
/opt/freeware/etc/cloud/cloud.cfg
```

導入されたデフォルトの cloud.cfg は以下の状態でした。


```
# cat /opt/freeware/etc/cloud/cloud.cfg
# The top level settings are used as module
# and system configuration.

# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
   - default

# If this is set, 'root' will not be able to ssh in and they
# will get a message to login instead as the above $user (ubuntu)
disable_root: false

# Allow SSH password authorization
ssh_pwauth: true

# Delete existing SSH host keys
ssh_deletekeys: true

# Regen rsa and dsa host keys
ssh_genkeytypes: ['rsa', 'dsa']

# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: false

datasource_list: ['ConfigDrive']

# Example datasource config
# datasource:
#    Ec2:
#      metadata_urls: [ 'blah.com' ]
#      timeout: 5 # (defaults to 50 seconds)
#      max_wait: 10 # (defaults to 120 seconds)

# The modules that run in the 'init' stage
cloud_init_modules:
 - migrator
 - seed_random
 - bootcmd
 - write-files
 - set_hostname
 - update_hostname
 - update_etc_hosts
 - ca-certs
 - rsyslog
 - users-groups
 - ssh
 - restore-volume-groups
 - set-multipath-hcheck-interval
 - update-bootlist
 - reset-rmc

# The modules that run in the 'config' stage
cloud_config_modules:
# Emit the cloud config ready event
# this can be used by upstart jobs for 'start on cloud-config'.
 - emit_upstart
 - disk_setup
 - mounts
 - ssh-import-id
 - locale
 - set-passwords
 - package-update-upgrade-install
 - landscape
 - timezone
 - puppet
 - chef
 - salt-minion
 - mcollective
 - disable-ec2-metadata
 - runcmd
 - byobu

# The modules that run in the 'final' stage
cloud_final_modules:
 - rightscale_userdata
 - scripts-vendor
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user
 - ssh-authkey-fingerprints
 - keys-to-console
 - phone-home
 - final-message
 - power-state-change

# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
   # This will affect which distro class gets used
   distro: aix
   # Default user name + that default users groups (if added/used)
   default_user:
     name: root
     lock_passwd: false
   # Other config here will be given to the distro class and/or path classes
   paths:
      cloud_dir: /opt/freeware/var/lib/cloud/
      templates_dir: /opt/freeware/etc/cloud/templates/
      upstart_dir: /etc/rc.d/init.d/
   ssh_svcname: ssh
```





----

##### 導入 rpm 確認

dnf と cloud-init 導入で付随して導入されたデフォルト導入を除く rpm のリスト (62個)

```
python3-3.7.9-0.ppc
libmodulemd-1.5.2-32_1.ppc
libsmartcols-2.34-32_1.ppc
librepo-1.11.0-32_1.ppc
libdnf-0.39.1-32_1.ppc
python3-hawkey-0.39.1-32_1.ppc
python3-libcomps-0.1.11-32_1.ppc
p11-kit-0.23.16-0.ppc
dnf-data-4.2.17-32_1.noarch
dnf-4.2.17-32_1.noarch
ca-certificates-2020.06.01-0.ppc
libgcc8-8.3.0-6.ppc
libstdc++8-8.3.0-6.ppc
libstdc++-8-1.ppc
libffi-3.2.1-3.ppc
libgomp-8-1.ppc
db-5.3.28-1.ppc
libyaml-0.2.2-1.ppc
xz-libs-5.2.5-1.ppc
glib2-2.56.1-3.ppc
libunistring-0.9.10-1.ppc
gettext-0.20.2-1.ppc
info-6.7-1.ppc
sqlite-3.35.5-1.ppc
python-2.7.18-3.ppc
python-pyserial-2.7-1.ppc
python-boto-2.34.0-1.noarch
python-jsonpointer-1.0-1.noarch
python-oauth-1.0.1-1.noarch
python-setuptools-0.9.8-2.noarch
python-requests-2.4.3-1.noarch
libzstd-1.4.4-32_1.ppc
libsolv-0.7.9-32_1.ppc
zchunk-libs-1.1.4-32_1.ppc
rpm-python3-4.15.1-32_1.ppc
python3-libdnf-0.39.1-32_1.ppc
libcomps-0.1.11-32_1.ppc
python3-gpgme-1.13.1-32_1.ppc
p11-kit-tools-0.23.16-0.ppc
python3-dnf-4.2.17-32_1.noarch
dnf-automatic-4.2.17-32_1.noarch
python3-librepo-1.11.0-32_1.ppc
libgcc-8-1.ppc
zlib-1.2.11-2.ppc
ncurses-6.2-3.ppc
libgomp8-8.3.0-6.ppc
bzip2-1.0.8-2.ppc
expat-2.2.9-2.ppc
python-PyYAML-3.11-1.ppc
libtextstyle-0.20.2-1.ppc
libxml2-2.9.11-1.ppc
libiconv-1.16-1.ppc
bash-5.1.4-2.ppc
readline-8.1-1.ppc
gdbm-1.19-1.ppc
python-cheetah-2.4.4-2.ppc
python-xml-0.8.4-1.ppc
python-configobj-5.0.5-1.noarch
python-jsonpatch-1.8-1.noarch
python-prettytable-0.7.2-1.noarch
python-six-1.10.0-1.noarch
cloud-init-0.7.5-4.3.ppc
```

----

##### PATH の設定

導入直後はパスが通っていないため、コマンドを実行するには絶対パスでの指定または、/opt/freeware/bin/にパスを通すことが必要になります。

```
# which cloud-init
which: 0652-141 /usr/bin /etc /usr/sbin /usr/ucb /usr/bin/X11 /sbin /usr/java8_64/jre/bin /usr/java8_64/bin �� cloud-init �͂���܂���B

# ls -l /opt/freeware/bin/cloud-init
-rwxr-xr-x    1 root     system        22247 Jun  9 2017  /opt/freeware/bin/cloud-init
```

パスを通します。

```
# echo $PATH
/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java8_64/jre/bin:/usr/java8_64/bin

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

# echo $PATH
/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java8_64/jre/bin:/usr/java8_64/bin:/opt/freeware/bin

# which cloud-init
/opt/freeware/bin/cloud-init
```

恒常的にパスを通すには、"/.kshrc" などに書いておく必要があります。


---

AIX 7.2 TL5 SP3 での cloud-init 導入を確認しました。

以上です。