add refresh_api to jenkinsfile

This commit is contained in:
2026-04-18 16:14:22 -07:00
parent 280066436a
commit 67f3f8440b
12 changed files with 161 additions and 63 deletions

View File

@ -7,6 +7,8 @@ windows_base_packages:
- windirstat
- putty
windows_desktop_packages:
windows_features:
- NET-Framework-Features
- Telnet-Client

View File

@ -0,0 +1,16 @@
---
- name: Install base packages
when: false
win_chocolatey:
name:
- "{{ windows_desktop_packages_item }}"
state: present
loop: "{{ windows_desktop_packages }}"
loop_control:
loop_var: windows_desktop_packages_item
...

View File

@ -1,48 +1,62 @@
---
- name: Install base packages
win_chocolatey:
name:
- "{{ windows_base_packages_item }}"
state: present
loop: "{{ windows_base_packages }}"
loop_control:
loop_var: windows_base_packages_item
- name: Install Server Services
ansible.windows.win_feature:
name:
- "{{ windows_features_item }}"
state: present
loop: "{{ windows_features }}"
loop_control:
loop_var: windows_features_item
- name: Disable ms_tcpip6 of all the Interface
community.windows.win_net_adapter_feature:
interface: '*'
state: disabled
component_id:
- ms_tcpip6
- name: disable IE Enhanced Security
- name: skip if refresh
when: not refresh_api | bool
block:
- name: Get Windows version
win_shell: "systeminfo /fo csv | ConvertFrom-Csv | select OS*, System*, Hotfix* | Format-List"
register: windows_version
- name: disable for user
win_shell: 'Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0'
- name: Print Windows host information
debug:
msg: "{{ windows_version }}"
- name: disable for admin
win_shell: 'Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0'
- name: Install base packages
win_chocolatey:
name:
- "{{ windows_base_packages_item }}"
state: present
ignore_checksums: true
loop: "{{ windows_base_packages }}"
loop_control:
loop_var: windows_base_packages_item
- name: disable automatic updates
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU
name: NoAutoUpdate
data: 1
- name: Install Server Services
when: "'server' in windows_version"
ansible.windows.win_feature:
name:
- "{{ windows_features_item }}"
state: present
loop: "{{ windows_features }}"
loop_control:
loop_var: windows_features_item
- name: disable Firewall
win_shell: "netsh advfirewall set allprofiles state off"
- name: Disable ms_tcpip6 of all the Interfaces
community.windows.win_net_adapter_feature:
interface: '*'
state: disabled
component_id:
- ms_tcpip6
- name: windows server items
when: "'server' in windows_version"
block:
- name: disable IE-ESC for user
win_shell: 'Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0'
- name: disable IE-ESC for admin
win_shell: 'Set-ItemProperty -Path "HKLM:\\SOFTWARE\\Microsoft\\Active Setup\\Installed Components\\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" -Name "IsInstalled" -Value 0'
- name: disable automatic updates
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU
name: NoAutoUpdate
data: 1
- name: disable Firewall
win_shell: "netsh advfirewall set allprofiles state off"
#- name: desktop items
# when: "'server' not in windows_version"
# include_tasks: desktop.yaml
...