본문 바로가기
카테고리 없음

[Ansible] windows update playbook

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

ansiblle을 이용하여 윈도우 업데이트를 할 수 있다.

 

---
- hosts: all
  tasks:
    - name : windows update
      win_updates:
        category_names:
          - SecurityUpdates
          - CriticalUpdates
          - UpdateRollups
        state: installed
        log_path: C:\ansible_wu.txt
        register: update_result

    - name: reboot if required
      win_reboot:
      when: update_result.reboot_required

state: installed 설치, searched 검색만, downloaded, 다운로드만 진행

log_path 는 윈도우 업데이트 이력이 파일로 남는다

반응형

댓글