blob: 8651dbc214223913d4072b4d9dc825ccf9957aa9 [file] [log] [blame]
# Adjust time, power management, and auto-login settings.
- hosts: all
C:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\
- name: Set time zone to EST
timezone: Eastern Standard Time
- name: Ensure Windows time service is started
# Omitting this task causes the w32tm command below to fail with "The service has not been
# started." I'm not sure why the w32time service is not started automatically -- maybe it only
# starts after login?
name: w32time
state: started
- name: Set NTP server
# This assumes default router setup per
# Doc for w32tm is here:
win_command: w32tm /config /update /manualpeerlist: /syncfromflags:MANUAL
- name: Restart Windows time service to pick up new config
name: w32time
state: restarted
- name: Force NTP resync
win_command: w32tm /resync /rediscover
- name: Create Temp
path: c:\Temp
state: directory
- name: Copy skolo.pow to host
# The skolo.pow file was created by configuring a machine as desired, then:
# > powercfg -list
# ... Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) * ...
# > powercfg -changename 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
# Skolo "High performance and never sleep."
# > powercfg -export skolo.pow 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
src: "{{ win_package_src }}/skolo.pow"
dest: c:\Temp\skolo.pow
- name: Import Skolo power settings
win_command: powercfg -import c:\Temp\skolo.pow
register: powercfg_out
- name: Activate Skolo power settings
win_command: "powercfg -setactive {{ powercfg_out.stdout |
regex_replace('^.*GUID: ([-0-9a-f]+)$', '\\1') }}"
- name: Cleanup skolo.pow
path: c:\Temp\skolo.pow
state: absent
# For unknown reasons, occasionally Windows will have trouble logging in and say "We can't sign in
# to your account." When this happens, the Default profile is used instead. Despite many attempts,
# I have not found a way to avoid this problem; instead, just reboot when the Default profile
# opens.
- name: Create Default profile Startup folder
path: "{{ default_profile_startup_path }}"
state: directory
- name: Copy default-profile-auto-reboot.bat to Default profile Startup folder
src: default-profile-auto-reboot.bat
dest: "{{ default_profile_startup_path }}"