본문 바로가기
인프라/앤서블(Ansible)

[Ansible] windows 파일배포 & 압축 해제

by IT맥구리나스 2022. 7. 27.

윈도우 시스템에 zip파일을 배포 후 압축 해제 함

---
- hosts: all
  vars:
    ansible_port: 5985
    ansible_connection: winrm
    ansible_winrm_server_cert_validation: ignore
    ansible_winrm_scheme: http
    ansible_winrm_transport: basic
  tasks:
    - name: deploy disk mount file
      win_copy:
        src: '/data/ansible/file/Disk_Part.ps1'
        dest: 'c:\Disk_Part.ps1'
    - name: run powershell
      win_shell: 'powershell.exe -ExecutionPolicy Bypass -File c:\Disk_Part.ps1'
      args:
        executable: cmd
    - name: deploy msssql install file
      win_copy:
        src: '/data/ansible/file/mssql.zip'
        dest: 'c:\mssql.zip'
    - name: unzip file
      win_unzip:
        src: 'c:\mssql.zip'
        dest: 'c:\install_mssql'

 

ansible windows unzip

ansible windows 파일배포

반응형

댓글