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

Incorrect URL being used for Red Had Insights project synchronisation #4447

Open
Bahu2016 opened this issue Aug 7, 2019 · 4 comments
Open

Comments

@Bahu2016
Copy link

Bahu2016 commented Aug 7, 2019

ISSUE TYPE
  • Bug Report
SUMMARY

insights.py default url: /api/remediations/v1/remediations. this not expected.

ENVIRONMENT
  • AWX version: 6.1.0
  • AWX install method: docker on linux
  • Ansible version: 2.8.2
  • Operating System: Redhat
  • Web Browser:
STEPS TO REPRODUCE

Install awx 6.1.0 and ansible version 2.8.2

EXPECTED RESULTS

Expected: url = '{}/r/insights/v3/maintenance?ansible=true'.format(insights_url)

ACTUAL RESULTS

"msg": "Expected /api/remediations/v1/remediations to return a status code of 200 but returned status code "404" instead with content "<!doctype html>\n\n\n <title>Example Domain</title>\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-color: #fff;\n }\n div {\n width: auto;\n margin: 0 auto;\n border-radius: 0;\n padding: 1em;\n }\n }\n </style> \n\n\n\n

\n

Example Domain

\n

This domain is established to be used for illustrative examples in documents. You may use this\n domain in examples without prior coordination or asking for permission.

\n

<a href="http://www.iana.org/domains/example\">More information...

\n
\n\n\n".",
"changed": false
}

ADDITIONAL INFORMATION

insights.py has to update to correct insight url = '{}/r/insights/v3/maintenance?ansible=true'.format(insights_url), or provide option to use custom url.

@awxbot awxbot added the type:bug label Aug 7, 2019
@Bahu2016
Copy link
Author

Bahu2016 commented Aug 7, 2019

This is the one which was working.
https://github.com/ansible/awx/blob/4.0.0/awx/playbooks/action_plugins/insights.py

From 5.0.0 it got changed.

https://github.com/ansible/awx/blob/5.0.0/awx/playbooks/action_plugins/insights.py

let me know where to modify the url in awx?

@Bahu2016
Copy link
Author

Bahu2016 commented Aug 8, 2019

Temporary fix, now i can see the planners.

$ docker exec -it awx_task /bin/bash
$ cd /var/lib/awx

vi venv/awx/lib/python3.6/site-packages/awx/settings/defaults.py

INSIGHTS_URL_BASE = "https://access.redhat.com"

$ venv/awx/lib64/python3.6/site-packages/awx/playbooks/action_plugins/insights.py ( used script from AWX 4.0.0 )

is that possible to provide permanent fix?

@Bahu2016
Copy link
Author

Bahu2016 commented Aug 8, 2019

And i followed same steps from https://docs.ansible.com/ansible-tower/latest/html/userguide/insights.html

It worked on awx 1.0.6.8 and ansible: 2.5.2, but not working {not showed up Insight} button for the hosts on awx 6.1.0 and ansible 2.8.2

@Bahu2016
Copy link
Author

Bahu2016 commented Aug 9, 2019

Fix: AWX 6.1.0

Change default INSIGHTS_URL_BASE = "https://.com"

on awx_task and awx_web containers. ( This is temporary ), for permanent rebuild image with the changes.

$ vi venv/awx/lib/python3.6/site-packages/awx/settings/defaults.py

docker restart awx_task and awx_web.

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

No branches or pull requests

4 participants