RHEL 9.1 で Ansible Tower 3.8.6 のインストールがエラーのため失敗する: モジュール/タスク 'ini_file' を確認できない

RHEL 9.1 で Ansible Tower 3.8.6 のインストールがエラーのため失敗する: モジュール/タスク 'ini_file' を確認できない

公式のRHリポジトリから設定を取得し、仮想マシンにAnsible Towerをインストールしてみました。https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz

すべては公式RH Reposからのものです。コンテンツを抽出し、パスワードでマニフェストを設定した後に実行しましたが、sudo ./setup.sh次のエラーが発生しました(インストールプログラムはパッケージをインストールしたはずですがansible)。

[ansible@tower ansible-tower-setup-3.8.6-2]$ sudo ./setup.sh
Updating Subscription Management repositories.
Error: Unknown repo: 'ansible-tower-dependencies-temp'
[error] Unable to install ansible.
[error] Ansible is not installed on this machine.
You must install Ansible before you can install Tower.

For guidance on installing Ansible, consult
http://docs.ansible.com/intro_installation.html.

RedHatがパッケージの可用性を変更したため、これをインストールする必要がありましたが、ansible-core今すぐインストールプログラムを実行するとエラーが発生しましたERROR! couldn't resolve module/action 'ini_file'. This often indicates a misspelling, missing collection, or incorrect module path.。 FQCNを含めるようにモジュール名を変更しようとしましたが、commnity.general.ini_file成功しませんでした!

残念ながら、私は最初にAnsibleに触れ、Ansible Towerのインストールを続ける方法を知りません。

完全なエラーログ(およびプラットフォームの詳細)は次のとおりです。

Installed:
  ansible-core-2.14.2-4.el9.x86_64                    git-core-2.39.1-1.el9.x86_64            libnsl2-2.0.0-1.el9.x86_64                      mpdecimal-2.5.1-3.el9.x86_64           
  python3.11-3.11.2-2.el9.x86_64                      python3.11-cffi-1.15.1-1.el9.x86_64     python3.11-cryptography-37.0.2-5.el9.x86_64     python3.11-libs-3.11.2-2.el9.x86_64    
  python3.11-pip-wheel-22.3.1-2.el9.noarch            python3.11-ply-3.11-1.el9.noarch        python3.11-pycparser-2.20-1.el9.noarch          python3.11-pyyaml-6.0-1.el9.x86_64     
  python3.11-setuptools-wheel-65.5.1-2.el9.noarch     python3.11-six-1.16.0-1.el9.noarch      sshpass-1.09-4.el9.x86_64                      

Complete!

[ansible@tower ansible-tower-setup-3.8.6-2]$ ansible --version
ansible [core 2.14.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.2 (main, Feb 16 2023, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

[ansible@tower ansible-tower-setup-3.8.6-2]$ sudo ./setup.sh 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.9/distutils/version.py", line 64, in __gt__
    c = self._cmp(other)
  File "/usr/lib64/python3.9/distutils/version.py", line 341, in _cmp
    if self.version < other.version:
TypeError: '<' not supported between instances of 'str' and 'int'
Updating Subscription Management repositories.
Error: Unknown repo: 'ansible-tower-dependencies-temp'
Using /etc/ansible/ansible.cfg as config file
[DEPRECATION WARNING]: "include" is deprecated, use include_tasks/import_tasks 
instead. See https://docs.ansible.com/ansible-
core/2.14/user_guide/playbooks_reuse_includes.html for details. This feature 
will be removed in version 2.16. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.
ERROR! couldn't resolve module/action 'community.general.ini_file'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/home/ansible/ansible-tower-setup-3.8.6-2/roles/repos_el/tasks/main.yml': line 67, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


    - name: Enable AWS rhui repositories
      ^ here
[error] Oops!  An error occurred while running setup.
[warn] /var/log/tower does not exist. Setup log saved to setup.log.

[ansible@tower ansible-tower-setup-3.8.6-2]$ cat /etc/os-rel*
NAME="Red Hat Enterprise Linux"
VERSION="9.1 (Plow)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="9.1"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Red Hat Enterprise Linux 9.1 (Plow)"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:redhat:enterprise_linux:9::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/9/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_BUGZILLA_PRODUCT_VERSION=9.1
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.1"
[ansible@tower ansible-tower-setup-3.8.6-2]$ 

ベストアンサー1

私が知っている限り、Tower 3.8.6はAnsible 2.9を介してのみインストールできます。最善の方法は、次のようにvirtualenvにAnsibleをインストールすることです。

python -m venv ansible29
ansible29/bin/pip install --upgrade pip
ansible29/bin/pip install 'cryptography<37' 'ansible<2.10'
export PATH=$PWD/ansible29/bin:$PATH
$ ansible --version
ansible 2.9.27

しかし... RHEL9はTower 3.8.6をサポートしていないようです。可能ですが、正式にはRHEL7 / 8でのみ機能し、RHEL9用のAutomation Platform 2.xを使用する必要があります。

./setup.sh -- --becomeいくつかの問題を軽減するためにルートとして実行することsudo ./setup.shを検討することもできます。

おすすめ記事