Target: core-server Group
[Inventory]
[linux-server]
target1 ansible_host=172.22.3.135 ansible_ssh_pass=ansible ansible_user=ansible
target2 ansible_host=172.22.3.179 ansible_ssh_pass=ansible ansible_user=ansible
[core-server]
target1 ansible_host=172.22.3.135 ansible_ssh_pass=ansible ansible_user=ansible
[fileupdate-playbook.yml]
- hosts: core-server
tasks:
- name: Find files
unarchive:
src: /home/ansible/ansible-test-ssh/source_files/src.tar.gz
dest: /test/dest
- file:
path: /test/dest/src.tar.gz
state: absent
[before]
[Action]
ansible-playbook filemove-playbook.yml -i inventory
[After]
전체 linux 서버중 일부 core-server 그룹에 해당하는 인스턴스들에 압축파일을 전달하고 해제를 한 후 압축 파일 삭제 완료