
    Vh	                     ^    d dl mZmZmZ eZdZdZd dlZd dl	m
Z
 d Zd Zedk(  r e        yy)	    )absolute_importdivisionprint_functionaq  
module: say
short_description: Makes a computer to speak
description:
  - Makes a computer speak! Amuse your friends, annoy your coworkers!
notes:
  - In 2.5, this module has been renamed from C(osx_say) to M(community.general.say).
  - If you like this module, you may also be interested in the osx_say callback plugin.
  - A list of available voices, with language, can be found by running C(say -v ?) on a OSX host and C(espeak --voices) on a Linux host.
extends_documentation_fragment:
  - community.general.attributes
attributes:
  check_mode:
    support: full
  diff_mode:
    support: none
options:
  msg:
    type: str
    description:
      - What to say.
    required: true
  voice:
    type: str
    description:
      - What voice to use.
    required: false
requirements: [say or espeak or espeak-ng]
author:
  - "Ansible Core Team"
  - "Michael DeHaan (@mpdehaan)"
z
- name: Makes a computer to speak
  community.general.say:
    msg: '{{ inventory_hostname }} is all done'
    voice: Zarvox
  delegate_to: localhost
N)AnsibleModulec                 \    ||g}|r|j                  d|f       | j                  |d       y )Nz-vT)check_rc)extendrun_command)module
executablemsgvoicecmds        i/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/modules/say.pysayr   9   s2    s
C

D%=!
sT*    c                     t        t        t        d      t        d            d      } | j                  d   }| j                  d   }d}t        j                         d	k7  rd }|D ]  }| j                  |      }|s n% | j                  d
dj                  |      z         | j                  r| j                  |d       t        | ||       | j                  |d       y )NT)requiredF)r   r   )argument_specsupports_check_moder   r   )r   espeakz	espeak-ngDarwinzUnable to find either %sz, )r   )r   changed)r   dictparamsplatformsystemget_bin_path	fail_jsonjoin
check_mode	exit_jsonr   )r   r   r   	possiblespossibler   s         r   mainr%   @   s    d#&
 !F --
CMM'"E.IH$ P((2
P
 	7$))I:NNOS%0
C'
d+r   __main__)
__future__r   r   r   type__metaclass__DOCUMENTATIONEXAMPLESr   ansible.module_utils.basicr   r   r%   __name__ r   r   <module>r/      sI    A @B  4+,B zF r   