마짱짱의 지식창고
Wordpress 만드는 과정 - 1 (준비물, inventory, 구성파일) 본문
0. 사전준비
VM 5대
1. Controller
ip : 192.168.123.41
2. wordpress1
ip : 192.168.123.51
3. wordpress2
ip : 192.168.123.52
4. db
ip : 192.168.123.53
5. haproxy
ip : 192.168.123.54
1. Inventory 란?
- 데이터 소스를 가리켜 Ansible이 작업 대상으로 지정하는데 사용하는 호스트의 인벤토리를 컴파일 할 수 있다.
2. Inventroy 설정
(참고)
https://docs.ansible.com/ansible/latest/plugins/inventory.html
Inventory Plugins — Ansible Documentation
Inventory plugins allow users to point at data sources to compile the inventory of hosts that Ansible uses to target tasks, either via the -i /path/to/file and/or -i 'host1, host2' command line parameters or from other configuration sources. The only requi
docs.ansible.com
* Controller 에서 진행
1. vi ~/inventory
node1 ansible_host=192.168.123.51
node2 ansible_host=192.168.123.52
node3 ansible_host=192.168.123.53
node4 ansible_host=192.168.123.54
[wp-lb]
node1
[wp-web]
node2
node3
[wp-db]
node4
[wp-nfs]
node4
[wp:children]
wp-lb
wp-web
wp-db
wp-nfs
3. 구성파일
(참고)
https://docs.ansible.com/ansible/latest/reference_appendices/config.html
Ansible Configuration Settings — Ansible Documentation
Default:[‘bud-frogs’, ‘bunny’, ‘cheese’, ‘daemon’, ‘default’, ‘dragon’, ‘elephant-in-snake’, ‘elephant’, ‘eyes’, ‘hellokitty’, ‘kitty’, ‘luke-koala’, ‘meow’, ‘milk’, ‘moofasa’, ‘moose’, ‘ren
docs.ansible.com
환경변수를 통해 설정값을 수정 가능하다.
- ANSIBLE_CONFIG (환경변수)
- ansible.cfg(현재 디렉토리)
- .ansible.cfg ( 홈 디렉토리)
- /etc/ansible/ansible.cfg
(가장 아래가 우선순위가 낮다)
1. vi ansible.cfg
[defaults]
inventory = inventory.ini
'Automation > Ansible' 카테고리의 다른 글
Wordpress 만드는 과정 3 - (변수 및 Jinja2 template) (0) | 2020.08.14 |
---|---|
Wordpress 만드는 과정 - 2 (AD-HOC, Playbook) (0) | 2020.08.14 |
Ansible var 를 이용한 wordpress (0) | 2020.08.11 |
[Ansible] 1. 설치 및 Ad-hoc로만 wordpress 올려보기 (맛보기) (0) | 2020.08.05 |
[Ansible] 0. Ansible 이란? (0) | 2020.08.05 |