Project

General

Profile

Actions

Bug #21747

closed

Ansible Error 500 when importing roles

Added by Regis McCall over 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Hello,

I'm trying to get ansible roles imported into foreman. I installed a test role using the following command:

ansible-galaxy install elastic.elasticsearch

- Ansible galaxy imports the files correctly into /etc/ansible/roles and this directory is clearly defined in the /etc/ansible.cfg file.
- Once I login to foreman, I go to "Configure" >> "Ansible", "Roles"
- Foreman states that there are no available roles, so I tried to import these items by clicking "Import" >> "Import from Foreman Host". This option reports "No changes in roles detected".
- I then try to click "Import" >> "Import from foreman.xxxx.io" and I receive the following error: "Oops, we're sorry but something went wrong 500 Internal Server Error"
- I looked through proxy, dyn flow, auth logs and I do not see any error message that can help.

Playbook tests run with no issues and from foreman I can run ansible on a host just fine.
I do not know of a place (or I did not find one in any documentation) that allows you to set where foreman looks for roles other than the ansible.cfg
- All permissions look to be set correctly on all necessary folders.

I'm going to try a few different foreman builds. What am I missing? If this is the wrong place, I apologize.

Foreman Release: 1.15
Ansible version: 2.4.1.0
Linux (uname -a): foreman.xxxxx.io 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Linux: Latest version of CentOS7

Actions #1

Updated by Daniel Lobato Garcia over 6 years ago

  • translation missing: en.field_release deleted (240)

Welcome!

Could you enable log-level debug in your proxy (/etc/foreman-proxy/settings.yml), try to import roles from the proxy again, and post the logs here? (/var/log/foreman-proxy/proxy.log). Ideally if you can post the logs from Foreman itself that would be useful too ( turn on debug mode here - https://theforeman.org/manuals/1.15/#Foremandebugging).

Thanks!

Actions #2

Updated by Francisco Rebolledo over 6 years ago

Hey! you should edit your roles_path variable in /etc/ansible/ansible.cfg to look like this:

roles_path = /etc/ansible/roles

apparently, foreman can't handle multiple directories for roles.

Actions #3

Updated by Marek Hulán over 6 years ago

Wasn't the support for this added recently? See #20884 it should be in 1.4.6

Actions #4

Updated by Tomer Brisker almost 6 years ago

  • Project changed from Foreman to Ansible
Actions #5

Updated by Anonymous almost 6 years ago

  • Triaged set to No

I do not reproduce with foreman 1.18RC3 / katello 3.7. I have role path defined in /etc/ansible/ansible.cfg as :

roles_path = /etc/ansible/roles:/opt/ansible/roles

I installed 1 role in each path and they appear in the update window. When I confirm, roles from both paths are imported.

Actions #6

Updated by Anonymous almost 6 years ago

(I don't know why "triaged" just has be defined to "no")

Actions #7

Updated by Marek Hulán over 5 years ago

  • Status changed from New to Resolved

I'm closing as I've seen this working on multiple instances of 1.18 and 1.19. Please let us know if you still experience the problem.

Actions

Also available in: Atom PDF