선 밖에 선 자유인

Ansible Playbook : Windows hotfix (msu 파일) 본문

IT/Cloud & DevOps

Ansible Playbook : Windows hotfix (msu 파일)

Hotman 2020. 5. 2. 00:07
---
- name: Windows MSU Patch
  hosts: windows
  gather_facts: no
  user: vagrant

  tasks:
  - name: create directory
    win_file:
      path: C:\Temp
      state: directory

  - name: file copy
    win_copy:
      src: /home/ansible/lab/windows10.0-kbxxxxx-x86_xxxxxxxxxxxxxxx.msu
      dest: C:\Temp\windows_patch.msu

  - name: Windows Hotfix
    win_hotfix:
      source: C:\Temp\windows_patch.msu
      state: present
    register: hotfix_install

  - win_reboot:
    when: hotfix_install.reboot_required

  - name: file delete
    win_file:
      path: C:\Temp\windows_patch.msu
      state: absent
Comments