2024.11.14 기준 pypi 저장소에 올라온 latest 버전 기준으로 설명
Ansible : 10.6.0
Ansible-Core : 2.13.13
rocky linux 8 버전은 python 3.6 버전이 설치되어있으나, 위 앤서블 버전은 python 3.8 이상을 요구하므로
python 재설치 과정 포함
1. 설치 [pip]
# python 버전 확인
python3 --version
# 3.8 버전 이하면 삭제 후 3.8 이상으로 재설치
yum list installed | grep python # 설치된 python 버전 확인 후
sudo yum remove python36 # 삭제 (예시는 3.6 버전)
yum search python # 3.8 이상 버전 정보 찾고
sudo yum install python38 # 3.8 버전 설치
# pip 설치 확인
python3 -m pip --version
# pip 최신 버전으로 업그레이드
pip3 install --upgrade --user pip
# 앤서블 설치
python3 -m pip install --user ansible
# 설치 확인
ansible --version
2. 설치 [dnf & epel repository]
# epel repository 설치
sudo dnf config-manager --set-enabled powertools
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# epel repisotry 설치 확인
# repo id : epel, repo name : Extra Packages for Enterprise Linux 8 - x86_64 확인
dnf repolist
# ansible 설치
sudo dnf ansible -y
# 설치 확인
ansible --version
Reference : https://docs.ansible.com/ansible/latest/index.html