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

Twilio 'post_twilio_api' is not defined #73

Open
kflavin opened this issue Dec 5, 2015 · 2 comments
Open

Twilio 'post_twilio_api' is not defined #73

kflavin opened this issue Dec 5, 2015 · 2 comments

Comments

@kflavin
Copy link

kflavin commented Dec 5, 2015

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

@mattmakai
Copy link
Owner

@kflavin yea, I'm able to replicate this as well. Not clear what's happening just from reading the source. I'll try with an older version of Ansible. I know there were some modifications made by the Ansible folks and it's possible some issue was inadvertently introduced along the way

@kflavin
Copy link
Author

kflavin commented Dec 11, 2015

Thanks. It seems to be the version of Ansible I was running (1.9.4). I downgraded to 1.9.2, and Twilio is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants