IT/LINUX

[Ansible] 설치(control node)

송시 2020. 6. 6. 18:52
728x90

RHCE ansible 을 취득하기 위해 공부를 조금 한 후 직접 설치를 진행해보았다.

control node 에 설치해야하는 명령어를 남겨본다.

레드햇 교육용 환경에서는 python 2 버전에 대해서만 언급을 해서 이번 설치는 python2 로 진행을 했지만

(python 2.5 이상)

python3 도 지원한다고 한다.(python 3.5 이상)

https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html

나의 경우는 dnf 를 통한 설치가 진행 안되서 pip 를 통해 설치함.

dnf install python2-pip
pip2 install paramiko PyYAML jinja2 httplib2
wget https://cbs.centos.org/kojifiles/packages/sshpass/1.06/8.el8/x86_64/sshpass-1.06-8.el8.x86_64.rpm
dnf install ./sshpass-1.06-8.el8.x86_64.rpm
ansible --version
mkdir /etc/ansible/
echo "127.0.0.1" > /etc/ansible/hosts
ansible all -m ping -k

-m 은 --module-name 의 약어로 module 을 사용할때 사용하고 -k 는 --ask-pass 의 약어로 접속하려는 비밀번호를 묻는 명령어
ansible 이 비밀번호를 묻지 않고 하기 위해서는 ssh 의 key 값 교환이 이루어진 후 부터 되는 것은 너무나 자명하다.

 

현재로서는 이정도만 하면 control node 의 ansible 은 설치 끝

앞으로는 설정과 같은 부분에 대해서 알아보아야 할것 같다.

728x90