티스토리 뷰

ansible

ansible 간단 명령어

fendys 2021. 8. 18. 21:07
반응형

ping

  • 모든 hosts 그룹에 ping 테스트

ansible hosts -m ping

command

  • 모든 hosts 그룹에 ls -al 명령어 수행

ansible hosts -m command -a "ls -al"

파일전송 put

  • Ansible 서버의 example.txt 파일을 모든 hosts에 test.txt 파일명으로 업로드

ansible hosts -m copy -a "src=~/example.txt dest=~/test.txt"

파일전공get

  • 모든 hosts의 test.txt 파일을 Ansible 서버의 example 디렉토리 하위에 다운로드

ansible hosts -m fetch -a "src=~/test.txt dest=~/example"

반응형

'ansible' 카테고리의 다른 글

cisco switch config backup  (0) 2022.02.28
install ansible on centos 7  (0) 2021.10.26
ansible key copy  (0) 2021.08.05
[ansible] file 내용 변경하기  (0) 2020.02.22
[Ansible] ansible /etc/sudoers line 추가하기  (0) 2020.02.21