Ansible Tower Cluster install 방법에 대한 가이드이다.
본 가이드는 deploy 노드를 통해 Tower, PostgreSQL을 설치하는 방식으로 진행하였으며, RedHat Subs 등록 / Tower license 관련된 부분은 추가하지 않았다.
Ansible Tower Cluster 구성시 DB서버는 별도의 서버로 구성해야만 한다.
Ansible Setup Considerations
Important considerations to note in the new clustering environment:
- PostgreSQL is still a standalone instance and is not clustered. Tower does not manage replica configuration or database failover (if the user configures standby replicas).
- When spinning up a cluster, the database node should be a standalone server, and PostgreSQL should not be installed on one of the Tower nodes
- < 이하 생략 >
# Tower 로그인 후 license 등록 내용은 아래 기 작성된 방법을 참고 (https://hkjeon2.tistory.com/48)
# Ansible Tower Cluster 설치에 사용했던 인스톨 파일들은 Git에 ansible-tower-cluster.tar.gz로 저장해서 올려놓았다.
https://github.com/hkjeon/ansible-tower
1. 구성 정보
- Tower 1, 2 , 3, PostgreSQL 1, Ansible Deploy
- 2 CPU / 4G Mem / 50G Disk / 1 Network (Public)
- tower 및 postgresql에 python3 install (dnf install -y python3)
- ansible deploy 노드에 ansible 설치 (dnf install -y ansible)
- tower IPs : 60.30.157.211 ~ 213
- postgresql IP : 60.30.157.214
2. ansible hosts파일에 hosts 추가
[root@hk-deploy ansible]# vi /etc/ansible/hosts
[tower]
60.30.157.21[1:4]
3. ansible list 확인 및 통신 확인
[root@hk-deploy ansible]# ansible tower --list-hosts
hosts (4):
60.30.157.211
60.30.157.212
60.30.157.213
60.30.157.214
[root@hk-deploy ansible]# ansible tower -m ping
60.30.157.213 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
60.30.157.214 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
60.30.157.211 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
60.30.157.212 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"ping": "pong"
}
4. tower package 다운로드 및 압축해제
테스트 기준으로 latest 버전은 (3.8.3-1) 이다.
[root@hk-deploy ansible]# cd ~
[root@hk-deploy ~]# ansible localhost -m unarchive -a "src=https://releases.ansible.com/ansible-tower/setup/ansible-tower-setup-latest.tar.gz dest=/root/ remote_src=yes"
localhost | CHANGED => {
"changed": true,
"dest": "/root/",
"extract_results": {
"cmd": [
"/usr/bin/gtar",
"--extract",
"-C",
"/root/",
"-z",
"-f",
"/root/.ansible/tmp/ansible-tmp-1626835196.7137358-301872-161227522359411/ansible-tower-setup-latest.tarur54ntex.gz"
],
"err": "",
"out": "",
"rc": 0
},
"gid": 0,
"group": "root",
"handler": "TgzArchive",
"mode": "0550",
"owner": "root",
"secontext": "system_u:object_r:admin_home_t:s0",
"size": 4096,
"src": "/root/.ansible/tmp/ansible-tmp-1626835196.7137358-301872-161227522359411/ansible-tower-setup-latest.tarur54ntex.gz",
"state": "directory",
"uid": 0
}
[root@hk-deploy ~]# ls
anaconda-ks.cfg ansible-tower-setup-3.8.3-1
5. inventory 구성
[root@hk-deploy ~]# cd ansible-tower-setup-3.8.3-1
[root@hk-deploy ansible-tower-setup-3.8.3-1]# mv inventory inventory-orig
[root@hk-deploy ansible-tower-setup-3.8.3-1]# vi inventory
[tower]
60.30.157.211
60.30.157.212
60.30.157.213
[database]
60.30.157.214
[all:vars]
ansible_become=true
admin_password='test1234'
pg_host='60.30.157.214'
pg_port='5432'
pg_database='awx'
pg_username='awx'
pg_password='awx'
rabbitmq_port=5672
rabbitmq_vhost=tower
rabbitmq_username=tower
rabbitmq_password='redhat'
rabbitmq_cookie=cookiemonster
rabbitmq_use_long_name=true
6. ansible tower 설치
root@hk-deploy ansible-tower-setup-3.8.3-1]# ./setup.sh
... < 중략 >
PLAY RECAP ***************************************************************************************************************************************************************
60.30.157.211 : ok=142 changed=69 unreachable=0 failed=0 skipped=85 rescued=0 ignored=2
60.30.157.212 : ok=130 changed=61 unreachable=0 failed=0 skipped=79 rescued=0 ignored=1
60.30.157.213 : ok=130 changed=61 unreachable=0 failed=0 skipped=79 rescued=0 ignored=1
60.30.157.214 : ok=48 changed=15 unreachable=0 failed=0 skipped=47 rescued=0 ignored=0
The setup process completed successfully.
[warn] /var/log/tower does not exist. Setup log saved to setup.log
7. instance groups 확인
tower 1번 서버에 로그인한 후 왼쪽 메뉴 "Instance Groups" 메뉴를 선택한다.
로그인 계정 (admin / test1234)
"tower"를 선택하여 group내에 3개의 tower 정보가 나타나는지 확인한다.
8. Cluster 동작확인
정상적으로 cluster 구성이 되었는지 확인하기 위해 2번서버의 로그인 페이지까지만 확인한다.
Tower 1번 서버에서 로고 및 로그인 정보를 구성한 후 저장한다.
Tower 2번 서버에서 새로고침을 수행하여 변경한 로고와 로그인 정보가 나타나는지 확인한다.
'IaC (Automation) > Ansible-Tower (AWX)' 카테고리의 다른 글
[RHAAP2] ansible tower 백업 및 복구 방법 (0) | 2021.08.19 |
---|---|
[RHAAP2] Ansible Tower cli (API) 설치 및 사용법 (0) | 2021.07.20 |
[RHAAP2] Ansible Tower logo 설정 (0) | 2021.07.15 |
[RHAAP2] Ansible Tower(AWX) 사용법 (0) | 2021.07.09 |
AWX install (ver17.1.0) (0) | 2021.07.09 |