AWX and Insights integration

Hi all. Me again. :slight_smile:

I have some odd behaviour after creating an Insights credential and project.

Attempting to sync. the Insights project with the Insights credential attempt to authenticate against an unexpected endpoint in the playbook output:

`

…

TASK [Fetch Insights Playbook(s)] **********************************************

fatal: [localhost,]: FAILED! => {“changed”: false, “msg”: "Expected https://example.org/r/insights/v3/maintenance?ansible=true to return a status code of 200 but returned status code "404" instead with content "\n\n\n Example Domain\n\n <meta charset="utf-8" />\n <meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style type="text/css">\n body {\n background-color: #f0f0f2;\n margin: 0;\n padding: 0;\n font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;\n \n }\n div {\n width: 600px;\n margin: 5em auto;\n padding: 50px;\n background-color: #fff;\n border-radius: 1em;\n }\n a:link, a:visited {\n color: #38488f;\n text-decoration: none;\n }\n @media (max-width: 700px) {\n body {\n background-co…

`

Why is AWX attempting to contact **https://example.org/r/insights/v3/maintenance?ansible=true**?

How can I modify this?

Thanks,
Toby.

Has anyone else successfully performed Red Hat Insights integration with AWX 4.0.0? I would love to hear from you.

Failing that, I will report an issue on GitHub for the incorrect endpoint address.

Now logged on GitHub: https://github.com/ansible/awx/issues/3916

I poked around a bit and looks like there’s a variable INSIGHTS_URL_BASE that defaults to https://example.org. I’m not too familiar with how the default settings work but I think if you define INSIGHTS_URL_BASE in settings.py with your correct URL it should at least try to connect to the right place. It doesn’t look like this value is controlled by an environment variable or in the installer so you might need to customize the build.

https://github.com/ansible/awx/blob/d9965cfe7e0f7a82fea04acb3b6b49852874f655/awx/settings/defaults.py#L936

Thanks a lot Uriel. I will take a look at that.