diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..9ed2e19 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +windows_autologon_password: vagrant diff --git a/tasks/Windows.yml b/tasks/Windows.yml index f34751b..7895634 100644 --- a/tasks/Windows.yml +++ b/tasks/Windows.yml @@ -5,8 +5,8 @@ state: present become: true -- name: "Enable autologon for vagrant" - ansible.windows.win_command: "C:\\ProgramData\\chocolatey\\bin\\Autologon.exe vagrant . vagrant" +- name: Enable autologon for vagrant + ansible.windows.win_command: powershell.exe Start-Process -FilePath "C:\\ProgramData\\chocolatey\\bin\\Autologon.exe" -ArgumentList '"/accepteula" vagrant . {{ windows_autologon_password }}' - name: Disable screen saver ansible.windows.win_shell: Set-ItemProperty "HKCU:\Control Panel\Desktop" -Name ScreenSaveActive -Value 0 -Type DWord