Ansible installation on Foreman

Hello,

I have a problem about enabling Ansible on Foreman machine. The error that I get is:

[root@foreman ~]# foreman-installer --enable-foreman-plugin-ansible --enable-foreman-proxy-plugin-ansible
2022-08-12 06:43:29 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-08-12 06:43:35 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-08-12 06:43:35 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --f ull-help for definitions.
2022-08-12 06:43:57 [NOTICE] [configure] Starting system configuration.
2022-08-12 06:44:17 [NOTICE] [configure] 250 configuration steps out of 1413 steps complete.
2022-08-12 06:45:05 [NOTICE] [configure] 500 configuration steps out of 1415 steps complete.
2022-08-12 06:45:09 [NOTICE] [configure] 750 configuration steps out of 1420 steps complete.
2022-08-12 06:45:28 [NOTICE] [configure] 1000 configuration steps out of 1424 steps complete.
2022-08-12 06:51:24 [NOTICE] [configure] 1250 configuration steps out of 1424 steps complete.
2022-08-12 06:53:38 [ERROR ] [configure] Error making PUT request to https://foreman.lab.local/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on foreman.lab.local for detailed information
2022-08-12 06:53:38 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[foreman.lab.local]/features: c hange from [“Logs”, “Pulpcore”] to [“Ansible”, “Dynflow”, “Logs”, “Pulpcore”] failed: Error making PUT request to https://forem an.lab.local/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log/foreman/production.log on fore man.lab.local for detailed information
2022-08-12 06:53:39 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[foreman.lab.local]: Failed to call refresh: Error making PUT request to https://foreman.lab.local/api/v2/smart_proxies/1/refresh: Response: 500 Internal Serv er Error: Check /var/log/foreman/production.log on foreman.lab.local for detailed information
2022-08-12 06:53:39 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[foreman.lab.local]: Error maki ng PUT request to https://foreman.lab.local/api/v2/smart_proxies/1/refresh: Response: 500 Internal Server Error: Check /var/log /foreman/production.log on foreman.lab.local for detailed information
2022-08-12 06:53:44 [NOTICE] [configure] System configuration has finished.

There were errors detected during install.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.

Ansible version: 2.9
OS version: RedHat 8.6
Foreman version: 3.3.0

Could you please help me?

Many thanks!
Bruno

Hi!

Can you show us the contents of /var/log/foreman/production.log at 06:53, when the installer was running?

Hi,

Thanks for answering!

[root@foreman ~]# cat of /var/log/foreman/production.log | grep 06:53
cat: of: No such file or directory
2022-08-12T06:53:12 [W|app|] Scoped order is ignored, it’s forced to be batch order.
2022-08-12T06:53:13 [W|app|] Scoped order is ignored, it’s forced to be batch order.
2022-08-12T06:53:13 [W|app|] Scoped order is ignored, it’s forced to be batch order.
2022-08-12T06:53:14 [I|app|] No new seed file updates found. Skipping
2022-08-12T06:53:18 [I|app|] Everything ready for world: cf80dcc0-4011-4ede-b7b4-ca0d584809d9
2022-08-12T06:53:34 [I|app|5dbd95f3] Started GET “/api/v2/hosts?search=name%3D%22foreman.lab.local%22” for 192.168.251.118 at 2022-08-12 06:53:34 -0400
2022-08-12T06:53:34 [I|app|5dbd95f3] Processing by Api::V2::HostsController#index as JSON
2022-08-12T06:53:34 [I|app|5dbd95f3] Parameters: {“search”=>“name="foreman.lab.local"”, “apiv”=>“v2”, “host”=>{}}
2022-08-12T06:53:34 [I|app|5dbd95f3] Authorized user foreman_api_admin(API Admin)
2022-08-12T06:53:34 [I|app|5dbd95f3] Rendering api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout
2022-08-12T06:53:35 [I|app|5dbd95f3] Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (Duration: 113.6ms | Allocations: 16872)
2022-08-12T06:53:35 [I|app|5dbd95f3] Completed 200 OK in 321ms (Views: 99.4ms | ActiveRecord: 91.2ms | Allocations: 55674)
2022-08-12T06:53:38 [I|app|75f148c7] Started GET “/api/v2/smart_proxies?search=name%3D%22foreman.lab.local%22” for 192.168.251.118 at 2022-08-12 06:53:38 -0400
2022-08-12T06:53:38 [I|app|75f148c7] Processing by Api::V2::SmartProxiesController#index as JSON
2022-08-12T06:53:38 [I|app|75f148c7] Parameters: {“search”=>“name="foreman.lab.local"”, “apiv”=>“v2”, “smart_proxy”=>{}}
2022-08-12T06:53:38 [I|app|75f148c7] Authorized user foreman_api_admin(API Admin)
2022-08-12T06:53:38 [I|app|75f148c7] Rendering api/v2/smart_proxies/index.json.rabl within api/v2/layouts/index_layout
2022-08-12T06:53:38 [I|app|75f148c7] Rendered api/v2/smart_proxies/index.json.rabl within api/v2/layouts/index_layout (Duration: 54.2ms | Allocations: 11507)
2022-08-12T06:53:38 [I|app|75f148c7] Completed 200 OK in 102ms (Views: 50.8ms | ActiveRecord: 27.4ms | Allocations: 24358)
2022-08-12T06:53:38 [I|app|2e8da032] Started PUT “/api/v2/smart_proxies/1/refresh” for 192.168.251.118 at 2022-08-12 06:53:38 -0400
2022-08-12T06:53:38 [I|app|2e8da032] Processing by Api::V2::SmartProxiesController#refresh as JSON
2022-08-12T06:53:38 [I|app|2e8da032] Parameters: {“apiv”=>“v2”, “id”=>“1”, “smart_proxy”=>{}}
2022-08-12T06:53:38 [I|app|2e8da032] Authorized user foreman_api_admin(API Admin)
2022-08-12T06:53:38 [W|app|2e8da032] Action failed
2022-08-12T06:53:38 [I|app|2e8da032] Backtrace for ‘Action failed’ error (ProxyAPI::ProxyException): ERF12-9411 [ProxyAPI::ProxyException]: Unable to fetch public key ([RestClient::InternalServerError]: 500 Internal Server Error) for proxy https://foreman.lab.local:9090/ssh
2022-08-12T06:53:38 [I|app|2e8da032] Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2022-08-12T06:53:38 [I|app|2e8da032] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 1.4ms | Allocations: 288)
2022-08-12T06:53:38 [I|app|2e8da032] Completed 500 Internal Server Error in 494ms (Views: 4.6ms | ActiveRecord: 104.2ms | Allocations: 18285)
2022-08-12T06:53:38 [I|app|3a2a9ed9] Started PUT “/api/v2/smart_proxies/1/refresh” for 192.168.251.118 at 2022-08-12 06:53:38 -0400
2022-08-12T06:53:38 [I|app|3a2a9ed9] Processing by Api::V2::SmartProxiesController#refresh as JSON
2022-08-12T06:53:38 [I|app|3a2a9ed9] Parameters: {“apiv”=>“v2”, “id”=>“1”, “smart_proxy”=>{}}
2022-08-12T06:53:38 [I|app|3a2a9ed9] Authorized user foreman_api_admin(API Admin)
2022-08-12T06:53:39 [W|app|3a2a9ed9] Action failed
2022-08-12T06:53:39 [I|app|3a2a9ed9] Backtrace for ‘Action failed’ error (ProxyAPI::ProxyException): ERF12-9411 [ProxyAPI::ProxyException]: Unable to fetch public key ([RestClient::InternalServerError]: 500 Internal Server Error) for proxy https://foreman.lab.local:9090/ssh
2022-08-12T06:53:39 [I|app|3a2a9ed9] Rendering api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout
2022-08-12T06:53:39 [I|app|3a2a9ed9] Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 5.7ms | Allocations: 5373)
2022-08-12T06:53:39 [I|app|3a2a9ed9] Completed 500 Internal Server Error in 374ms (Views: 10.3ms | ActiveRecord: 94.1ms | Allocations: 27647)
[root@foreman ~]#

Interesting, can you re-run the installer with the --enable-foreman-proxy-plugin-remote-execution-script flag?