AWX with Jenkins Tower plugin

Hi All,

Any one out there managed to get AWX working with Jenkins Ansible Tower plugin? I run Ansible AWX with pure http (not https),an I get a 502 when I try to add the AWX host to jenkins. Any thoughts how we can do this? Any additional steps I need to follow?

Cheers.

Hi Kosala,

The Ansible Jenkins Tower plugin can be used with AWX.
Make sure you are using a fully qualified URL in the configuration like: http://localhost:8081/
However, a 502 is a bad gateway response; is there anything in-between your jenkins instance and your AWX instance?
Please feel free to reach out to me either here or on the Jenkins wiki for the plugin: https://plugins.jenkins.io/ansible-tower

-John

Hi All,

I can see the following in the awx_web logs.

2018-07-22 16:47:57,779 ERROR django.request Internal Server Error: /authtoken/

Traceback (most recent call last):

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/handlers/exception.py”, line 116, in get_exception_response

response = callback(request, **param_dict)

File “/usr/lib/python2.7/site-packages/awx/main/views.py”, line 80, in handle_404

return handle_error(request, 404, **kwargs)

File “/usr/lib/python2.7/site-packages/awx/main/views.py”, line 56, in handle_error

return render(request, ‘error.html’, kwargs, status=status)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/shortcuts.py”, line 30, in render

content = loader.render_to_string(template_name, context, request, using=using)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/loader.py”, line 68, in render_to_string

return template.render(context, request)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/backends/django.py”, line 66, in render

return self.template.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 207, in render

return self._render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 199, in _render

return self.nodelist.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 990, in render

bit = node.render_annotated(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 957, in render_annotated

return self.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/loader_tags.py”, line 177, in render

return compiled_parent._render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 199, in _render

return self.nodelist.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 990, in render

bit = node.render_annotated(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 957, in render_annotated

return self.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/loader_tags.py”, line 177, in render

return compiled_parent._render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 199, in _render

return self.nodelist.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 990, in render

bit = node.render_annotated(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 957, in render_annotated

return self.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/loader_tags.py”, line 72, in render

result = block.nodelist.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 990, in render

bit = node.render_annotated(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 957, in render_annotated

return self.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/loader_tags.py”, line 72, in render

result = block.nodelist.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 990, in render

bit = node.render_annotated(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 957, in render_annotated

return self.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/defaulttags.py”, line 40, in render

output = self.nodelist.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 990, in render

bit = node.render_annotated(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 957, in render_annotated

return self.render(context)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/defaulttags.py”, line 166, in render

values = self.sequence.resolve(context, True)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/template/base.py”, line 736, in resolve

new_obj = func(obj, *arg_vals)

File “/var/lib/awx/venv/awx/lib/python2.7/site-packages/rest_framework/templatetags/rest_framework.py”, line 243, in items

return value.items()

AttributeError: ‘NoneType’ object has no attribute ‘items’