젠킨스를 통해서 윈도우 업데이트 목록을 추출할 수 있다.
- hosts: all
gather_facts: no
vars:
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
ansible_winrm_scheme: http
ansible_become: false
ansible_winrm_transport: basic
ansible_port: 5985
tasks:
- name: windows update list
win_shell: |
Get-HotFix | ForEach-Object {
[PSCustomObject]@{
FullName = hostname
HotFixID = $_.HotFixID
Date = (Get-Date $_.installedon).Tostring("yyyy-MM-dd")
}
}
register: result
- debug:
msg: "{{ result.stdout_lines }}"
반응형
'인프라 > 앤서블(Ansible)' 카테고리의 다른 글
[ANSIBLE] winrm or requests is not installed: No module named 'winrm' 해결방법 (0) | 2024.02.07 |
---|---|
[ANSIBLE] 앤서블 윈도우 task timeout 설정하기 (0) | 2023.12.11 |
[ANSIBLE] 앤서블 그룹내 특정 호스트 제외하고 실행하기 (0) | 2023.10.05 |
[ansible] 앤서블 윈도우 서버 파일 배포 실행하기 (0) | 2023.09.21 |
[ansible] ansible 윈도우 방화벽 생성 (0) | 2023.08.22 |
댓글