fix and lint role
This commit is contained in:
parent
b536447319
commit
ed45cddfcb
2 changed files with 40 additions and 5 deletions
|
@ -6,8 +6,43 @@
|
||||||
|
|
||||||
- name: Set windows product key
|
- name: Set windows product key
|
||||||
ansible.windows.win_powershell:
|
ansible.windows.win_powershell:
|
||||||
script: 'cscript.exe "slmgr.vbs" /ipk {{ windows_product_key }}'
|
script: 'cscript.exe "C:\Windows\System32\slmgr.vbs" /ipk {{ windows_product_key }}'
|
||||||
|
register: a1
|
||||||
|
|
||||||
|
- name: Show Script Output
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ a1.output }}"
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
- name: Akivate Windows
|
- name: Akivate Windows
|
||||||
ansible.windows.win_powershell:
|
ansible.windows.win_powershell:
|
||||||
script: "cscript.exe 'slmgr.vbs' /ato"
|
script: 'cscript.exe "C:\Windows\System32\slmgr.vbs" /ato'
|
||||||
|
register: a2
|
||||||
|
|
||||||
|
- name: Show Script Output
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "{{ a2 }}"
|
||||||
|
verbosity: 1
|
||||||
|
|
||||||
|
- name: Get product id and product key
|
||||||
|
community.windows.win_product_facts:
|
||||||
|
|
||||||
|
- name: Display Windows edition
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: ansible_os_license_edition
|
||||||
|
|
||||||
|
- name: Display Windows license status
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: ansible_os_license_status
|
||||||
|
|
||||||
|
- name: Install all security updates with automatic reboots
|
||||||
|
ansible.windows.win_updates:
|
||||||
|
category_names:
|
||||||
|
- SecurityUpdates
|
||||||
|
- CriticalUpdates
|
||||||
|
reboot: true
|
||||||
|
|
||||||
|
- name: Install all critical and rollup updates without a scheduled task
|
||||||
|
ansible.windows.win_updates:
|
||||||
|
category_names:
|
||||||
|
- UpdateRollups
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
community.windows.win_product_facts:
|
community.windows.win_product_facts:
|
||||||
|
|
||||||
- name: Display Windows edition
|
- name: Display Windows edition
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: ansible_os_license_edition
|
var: ansible_os_license_edition
|
||||||
|
|
||||||
- name: Display Windows license status
|
- name: Display Windows license status
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: ansible_os_license_status
|
var: ansible_os_license_status
|
||||||
|
|
||||||
- name: activate windows
|
- name: Activate windows
|
||||||
ansible.builtin.include_tasks: activate.yml
|
ansible.builtin.include_tasks: activate.yml
|
||||||
when: ansible_os_license_edition != "Windows(R), Enterprise edition" or ansible_os_license_status != "Licensed"
|
when: ansible_os_license_edition != "Windows(R), Enterprise edition" or ansible_os_license_status != "Licensed"
|
||||||
|
|
Loading…
Reference in a new issue