
ansible localhost,192.168.56.13 -m copy -a "src=/home/vagrant/ansible_practice_0521/copy dest=/home/vagrant" -i invent
ory --become-user root

관리 호스트에 httpd 패키지를 설치되어 있는지 확인하고 제어 노드의 files/index.html 파일을 관리 호스트의 /var/www/html/index.html 파일로 복사하고 httpd 서비스를 실행하는 플레이북 구성하기
플레이북을 실행하여 관리 호스트의 웹 서버로 접속할 수 있는지 확인하기
---
- name: practice-0521-2
hosts: 192.168.56.13
become: true
tasks:
- name: download httpd
yum:
name: httpd
state: present
- name: copy
copy:
src: /home/vagrant/files/index.html
dest: /var/www/html/
- name: run httpd server
service:
name: httpd
state: started
enabled: true

관리 호스트에 /var/www/html/index2.html 파일에 Welcome to the example.com intranet! 메세지를 작성하는 플레이 작성
http 서비스 방화벽을 개방하는 플레이 작성
uri 모듈을 사용하여 관리 호스트에 접속하여 Welcome to the example.com intranet! 문구를 가져오는 플레이 작성