Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_say - fix up syntax and test issues #45450

Merged
merged 1 commit into from
Sep 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/win_say-fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- win_say - fix syntax error in module and get tests working
2 changes: 1 addition & 1 deletion lib/ansible/modules/windows/win_say.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $result = @{

$words = $null

f ($speech_speed -lt -10 -or $speech_speed -gt 10) {
if ($speech_speed -lt -10 -or $speech_speed -gt 10) {
Fail-Json $result "speech_speed needs to a integer in the range -10 to 10. The value $speech_speed is outside this range."
}

Expand Down
8 changes: 8 additions & 0 deletions test/integration/targets/win_say/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# CI hosts don't have a valid Speech package so we rely on check mode for basic
# sanity tests
---
- name: Warn of impending deployment
win_say:
msg: Warning, deployment commencing in 5 minutes, please log out.
check_mode: yes

- name: Using a different voice and a start sound
win_say:
msg: Warning, deployment commencing in 5 minutes, please log out.
start_sound_path: C:\Windows\Media\ding.wav
voice: Microsoft Hazel Desktop
check_mode: yes

- name: Example with start and end sound
win_say:
msg: New software installed
start_sound_path: C:\Windows\Media\Windows Balloon.wav
end_sound_path: C:\Windows\Media\chimes.wav
check_mode: yes

- name: Create message file
win_copy:
Expand All @@ -24,6 +30,7 @@
msg_file: C:\Windows\Temp\win_say_message.txt
start_sound_path: C:\Windows\Media\Windows Balloon.wav
end_sound_path: C:\Windows\Media\chimes.wav
check_mode: yes

- name: Remove message file
win_file:
Expand All @@ -34,3 +41,4 @@
win_say:
speech_speed: 5
msg: Stay calm and proceed to the closest fire exit.
check_mode: yes