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실행하는 것을 고려할 수도 있습니다 .

관련 정보