Note
This plugin is part of the community.windows collection (version 1.2.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_say
.
Parameter | Choices/Defaults | Comments |
---|---|---|
end_sound_path path | Full path to a .wav file containing a sound to play after the text has been spoken.Useful on conference calls to alert other speakers that ansible has finished speaking. | |
msg string | The text to be spoken. Use either msg or msg_file .Optional so that you can use this module just to play sounds. | |
msg_file path | Full path to a windows format text file containing the text to be spoken. Use either msg or msg_file .Optional so that you can use this module just to play sounds. | |
speech_speed integer | Default: 0 | How fast or slow to speak the text. Must be an integer value in the range -10 to 10. -10 is slowest, 10 is fastest. |
start_sound_path path | Full path to a .wav file containing a sound to play before the text is spoken.Useful on conference calls to alert other speakers that ansible has something to say. | |
voice string | Which voice to use. See notes for how to discover installed voices. If the requested voice is not available the default voice will be used. Example voice names from Windows 10 are Microsoft Zira Desktop and Microsoft Hazel Desktop . |
Note
To find which voices are installed, run the following Powershell commands.
Add-Type -AssemblyName System.Speech $speech = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer $speech.GetInstalledVoices() | ForEach-Object { $_.VoiceInfo } $speech.Dispose()
See also
The official documentation on the community.windows.win_msg module.
The official documentation on the community.windows.win_toast module.
- name: Warn of impending deployment community.windows.win_say: msg: Warning, deployment commencing in 5 minutes, please log out. - name: Using a different voice and a start sound community.windows.win_say: start_sound_path: C:\Windows\Media\ding.wav msg: Warning, deployment commencing in 5 minutes, please log out. voice: Microsoft Hazel Desktop - name: With start and end sound community.windows.win_say: start_sound_path: C:\Windows\Media\Windows Balloon.wav msg: New software installed end_sound_path: C:\Windows\Media\chimes.wav - name: Text from file example community.windows.win_say: start_sound_path: C:\Windows\Media\Windows Balloon.wav msg_file: AppData\Local\Temp\morning_report.txt end_sound_path: C:\Windows\Media\chimes.wav
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
message_text string | success | The text that the module attempted to speak. Sample: Warning, deployment commencing in 5 minutes. |
voice string | success | The voice used to speak the text. Sample: Microsoft Hazel Desktop |
voice_info string | when requested voice could not be loaded | The voice used to speak the text. Sample: Could not load voice TestVoice, using system default voice |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/community/windows/win_say_module.html