Skip to content

Twilio 'post_twilio_api' is not defined #73

Description

@kflavin

I'm going through the Full Stack Python Deployment PDF. On page 137, I'm attempting to configure Twilio alerts on successful deployment. I have the following in my main.yml:

- name: alert that deployment is complete
  twilio:
    msg: "Deployment complete!"
    account_sid: "{{ wsgi_env_vars.TWILIO_ACCOUNT_SID }}"
    auth_token: "{{ wsgi_env_vars.TWILIO_AUTH_TOKEN }}"
    from_number: "{{ wsgi_env_vars.TWILIO_NUMBER }}"
    to_number: "{{ alert_number }}"
  delegate_to: localhost
  when: deployment_alert

When I run deploy_prod.sh, I get an error that "post_twilio_api" is not defined.

TASK: [common | alert that deployment is complete] **************************** 
failed: [<myip> -> localhost] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/home/<myuser>/.ansible/tmp/ansible-tmp-1449278658.43-275151344117765/twilio", line 2515, in <module>
    main()
  File "/home/<myuser>/.ansible/tmp/ansible-tmp-1449278658.43-275151344117765/twilio", line 123, in main
    r, info = post_twilio_api(module, account_sid, auth_token, msg,
NameError: global name 'post_twilio_api' is not defined

FATAL: all hosts have already failed -- aborting

Tracing back that symbol, it appears to be a function call in the ansible module:
ansible/modules/extras/notification/twilio.py.

I'm running ansible versino 1.9.4, and Twilio support seems to be available in 1.6. Am I missing a module of some sort?

Thanks,
Kyle

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions