Ansible: Need to send the text message (SMS) via ansible using the “Nexmo”. Getting below error

Below is the playbook which is used to send the messages to the registered numbers using nexmo. Please suggests what needs to be done to overcome this error - No which i used are registered one and same with the api inputs.

Is there any soln to overcome this error, please suggest the right forum to ask this question, if this is not the correct forum.

I’ve just tested this module to validate that it is working correctly, and it seems to be.

I’m not sure what specific issue you are running into.

I might suggest following the example on the getting started page for Nexmo, and using your same data:

curl -X POST https://rest.nexmo.com/sms/json
-d api_key=640c8a53
-d api_secret=0ce239a6
-d to=919168694888
-d from=8793161930
-d text=“Hello from Nexmo”

Of course, you need to replace api_key and api_secret with your key and secret.

Hello Matt,

Thanks a lot for your input, Really Appreciated!

I tried to make the changes in my playbook as per below -

even i have tried using the twilo still not able to get the output -

  • hosts: localhost
    tasks:
  • name: Send notification message via twilio
    twilio:
    msg: ‘Hello from Nishant via Ansible’
    account_sid: ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    auth_token: a0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    from_number: +918793127307
    to_number: +919168612880
    delegate_to: localhost

below is the error-

fatal: [localhost → localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Failed to validate the SSL certificate for api.twilio.com:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine or you can install the urllib3, pyopenssl, ndg-httpsclient, and pyasn1 python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible”}