티스토리 뷰

ansible

ansible remote shell

fendys 2023. 8. 31. 20:01
반응형

스크립트 실행시 상대 경로의 파일을 못찾을때는 chdir: prefix 설정해주면 상대 경로의 원격지 스크립트가 정삭적으로 수행 된다.

---
- name: mkdir solid_step client direct
  shell: 'mkdir -p /fendys/solied_step'
################################################################################################################################################################
- name: Get solid_step client file
  shell: 'wget -P /fendys/solied_step --no-check-certificate --content-disposition https://192.168.0.1/exec/Agent/Download?type=linux'
################################################################################################################################################################
- name: solid_step client tar extract 
  shell: 'tar xvf agent_linux.tar'
  args:
    chdir: /fendys/solied_step
################################################################################################################################################################
- name: install solid_step client 
  shell: /bin/sh Install.sh 2 0 /fendys/Solid_step_client
  args:
    chdir: /fendys/solied_step
반응형

'ansible' 카테고리의 다른 글

cisco ansible config  (0) 2024.04.05
cisco switch config backup  (0) 2022.02.28
install ansible on centos 7  (0) 2021.10.26
ansible 간단 명령어  (0) 2021.08.18
ansible key copy  (0) 2021.08.05