Unable to assigne ansible Roles to Host / Hostgroups

I found out what is happening:

https://projects.theforeman.org/issues/26645

Thank you, Ondrej.

Let me know if I can be of assistance.

i’ve got the same problem but the difference is that when i create new host, the switcher is still not visible (and has never been) :

Yeah, same here, but i would guess that it has the same cause - something is wrong with the rendering …

Good morning/evening/etc., Ondrej.

I’ve chased down through your issues report to the pull request, and applied the change (single token change to /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-2.3.3/app/views/foreman_ansible/ansible_roles/_select_tab_content.html.erb in my case.) Unfortunately… it seems to not have changed the visible behavior. I did stop Katello services prior to writing out the change, and started back up cleanly after.

Well, wait a sec…This is pulled from /var/log/foreman/production.log after application:

Started GET "/hosts/host.example.com/edit" for 172.24.29.167 at 2019-04-19 08:10:07 -0500
Processing by HostsController#edit as HTML
Parameters: {"id"=>"host.example.com"}
Current user set to admin (admin)
Rendering hosts/edit.html.erb within layouts/application
Deface: [WARNING][0m No :original defined for 'add_execution_interface_js', you should change its definition to include:
:original => '738d75b8975dc598101e60505810ef267e2c43ae' 
Deface: [WARNING][0m No :original defined for 'ansible_roles_tab', you should change its definition to include:
:original => '8c63c5282ee199068bfd65475e13066ee981089a' 
Deface: [WARNING][0m No :original defined for 'ansible_roles_tab_content', you should change its definition to include:
:original => '738d75b8975dc598101e60505810ef267e2c43ae' 
Rendered hosts/_progress.html.erb (0.8ms)
Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.11.0/app/views/overrides/activation_keys/_host_environment_select.html.erb (27.1ms)
Rendered hosts/puppet/_main_tab_fields.html.erb (11.0ms)
Rendered collection of puppetclasses/_selectedClasses.html.erb [0 times] (0.0ms)
Rendered collection of puppetclasses/_classes_in_groups.html.erb [0 times] (0.0ms)
Rendered puppetclasses/_classes.html.erb (1.0ms)
Rendered puppetclasses/_class_selection.html.erb (18.6ms)
Rendered hosts/puppet/_puppet_classes_tab.html.erb (20.0ms)
Deface: [WARNING][0m No :original defined for 'add_execution_interface', you should change its definition to include:
:original => 'dbe1da973bfb251a74b994e7ae11bc8d11502c97' 
Rendered nic/_base_form.html.erb (76.0ms)
Rendered nic/_virtual_form.html.erb (3.5ms)
Rendered nic/_provider_specific_form.html.erb (1.5ms)
Rendered nic/manageds/_managed.html.erb (97.3ms)
Rendered nic/_base_form.html.erb (71.3ms)
Rendered nic/_virtual_form.html.erb (1.5ms)
Rendered nic/_provider_specific_form.html.erb (0.2ms)
Rendered nic/manageds/_managed.html.erb (76.8ms)
Rendered hosts/_interfaces.html.erb (179.0ms)
Rendered common/os_selection/_architecture.html.erb (6.0ms)
Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-14.0.0/app/views/hosts/provision_method/bootdisk/_form.html.erb (0.9ms)
Deface: [WARNING][0m No :original defined for 'hosts_select_media_type', you should change its definition to include:
:original => '356145b9d744833e37767c56700139090bc696d7' 
Deface: [WARNING][0m No :original defined for 'hosts_select_synced_content', you should change its definition to include:
:original => '356145b9d744833e37767c56700139090bc696d7' 

I’ve taken the liberty of removing timestamps and greeking the hostname, as well as what appear to be greeked non-printable characters. This contains all of the errors and warnings (some of which I’m quite sure simply do not apply to this issue, such as the interface and OS warnings.)

As this is a complete sandbox environment (both of them, actually,) I have complete freedom for changes and testing.

Thanks for testing the patch, however it needs a change in Foreman for the issue to be fixed:

https://projects.theforeman.org/issues/26651

1 Like

Thanks again. I’ll wait for more news.

Hi,
I try to use the fix from the github pull request but I can not find the index.js. Where should this file? It would be great if I had a workaround until the patch is upstream.

CentOs7
foreman: 1.21.3
foreman_ansible: 2.3.3

I see that it was resolved and the pull request merged a few hours ago. Thank you for fielding the bug and resolving the issue, Ondrej!

I’m curious how these are released once they’re merged. Will it appear as an typical incremental package update within the Foreman 1.21 lifecycle, or will it be held for a later version? (I haven’t been tracking the Foreman community long, so please take this as an information seeking question and not evidence of impatience.)

The new release 3.0.1 was only planned for 1.22. I was unaware that this is reproducible with 1.21, we may need to do another 2.3.z release. Once that happens, you will see that as regular update in 1.21 repositories.

1 Like

Hi Marek,

as far as i can see, there is a new relase 2.3.4. Will this be released to .deb and .rpm too?
Thanks to all for fixing this bug.

Regards,
Bastian

Hello, @Ondrej_Prazak opened a request for rpm and I believe will open one for deb too. Ondra, let me know if you need any help with it.

Packaging PR for deb is now opened as well.

I just installed 2.3.4 and restarted the services with ‘katello-service restart’. Unfortunately, the issue of the Ansible role switcher not appearing is still occurring. Is there any type of cache to clear or command to rebuild javascripts that needs to be run?
If not, what log file would you look into to try to help find the issue?

Running:
foreman-1.21.3
katello-3.11.1
tfm-rubygem-foreman_ansible-2.3.4

Thanks again for looking into this issue.

I have done the same and the bug still present with me. Same Version but without katello.

@Ondrej_Prazak, @ezr-ondrej,
Hi all,

i’ve already patched my lab, but the new version did not fix that issue.
Is there another patch of core components needed?
As far as i understand the comments in the PR, it was expected that the patch for foreman_ansible would fix that issue.
The PR for the fix in foreman core was closed in favor of the patch for foreman-ansible…

Is there anything i can do to help fix this bug?

Regards,
Bastian

I noticed that after installing version 2.3.4 I have the following in the log. Maybe that’s the reason for the problem.

2019-05-08T07:08:22 [I|app|ab30a973] Deface: [WARNING] No :original defined for ‘ansible_roles_tab’, you should change its definition to include:
:original => ‘8c63c5282ee199068bfd65475e13066ee981089a’
2019-05-08T07:08:22 [I|app|ab30a973] Deface: [WARNING] No :original defined for ‘ansible_roles_tab_content’, you should change its definition to include:
:original => ‘738d75b8975dc598101e60505810ef267e2c43ae’

Hi,

that is the same error i initial reported … thought that this update was the fix for that…

Regards

I’m really hoping that I’m missing something fundamental. This would appear to me to be a bit of a show stopper if you’re depending on Ansible integration.

I’ve followed the pull request through, and I appear to have the updated RPMs installed, yet I still have no Ansible roles available in a host edit session. I’m seeing the same warnings that Edll posted.

Deface warnings should be harmless, do you see any error in browser JS console?