-
Bug
-
Resolution: Done
-
Normal
-
6.10.0
Description of problem:
Web UI, Hosts, All Hosts, Select target hosts, Down Arrow next to 'Select Action', change Puppet Master and Select Clear Puppet CA exist in v6.10/6.11, but it will prompt a dialog and spin forever because of the missing path error.
Version-Release number of selected component (if applicable):
v6.10/v6.11
How reproducible:
Always
Additional info:
From Hao's notes:
~~~
Even before disabling the foreman_puppet plugin in Satellite 6.10/6.11, "change Puppet Master" option exists but it doesn't work. After pressing the "change Puppet Master", it will prompt a dialog and spin forever because of the missing path error. Need to raise a bugzilla for this if not any is raised yet.
production.log error
2022-12-16T11:02:52 [I|app|cc3a5bd2] Rendering hosts/select_multiple_puppet_proxy.html.erb within layouts/application
2022-12-16T11:02:52 [I|app|cc3a5bd2] Rendered hosts/_selected_hosts.html.erb (Duration: 16.6ms | Allocations: 5533)
2022-12-16T11:02:52 [I|app|cc3a5bd2] Rendered hosts/select_multiple_puppet_proxy.html.erb within layouts/application (Duration: 479.7ms | Allocations: 46616)
2022-12-16T11:02:52 [W|app|cc3a5bd2] undefined method `update_multiple_puppet_proxy_hosts_path' for #<#<Class:0x000000001c5e07d8>:0x000000001bbe3c58>
cc3a5bd2 | Did you mean? update_multiple_puppet_ca_proxy_hosts_path
cc3a5bd2 | update_multiple_puppet_ca_proxy_hosts_url
cc3a5bd2 | update_multiple_openscap_proxy_hosts_path
cc3a5bd2 | update_multiple_owner_hosts_path
cc3a5bd2 | update_multiple_power_state_hosts_path
cc3a5bd2 | update_multiple_hostgroup_hosts_path
cc3a5bd2 | update_multiple_parameters_hosts_path
cc3a5bd2 | update_multiple_location_hosts_path
~~~
Current workaround:
~~~
1) Please take a backup or a snapshot of the Satellite
2) Identify the value of the puppet_ca_proxy_id and the puppet_proxy_id, replacing ch1.example.com with your host that uses the old puppet reference
- su - postgres -c "psql -x -d foreman -c \"select name, puppet_proxy_id, puppet_ca_proxy_id from hosts where name like 'ch1.example.com'\""
3) Identify the name of the puppet proxy that is no longer running, replacing id=1 to match the id of the puppet_proxy_id returned from the first sql query
- su - postgres -c "psql -x -d foreman -c \"select name, id from smart_proxies where id=1\""
4) Find all hosts using this puppet proxy, and set their values to nil.
a) Assign the puppet proxy id to 'id' variable, replacing <ID> with puppet_proxy_id
- id=<ID>
- echo $id
b) Run the below script on the Satellite (except ~~~ in the begging and the end)
~~~
foreman-rake console << RAKESCRIPT
hosts=::Host.where(puppet_proxy_id: $id)
hosts.each do |host|
p "Updating puppet proxy for host: #
"
host.update_attribute(:puppet_proxy_id, nil)
host.update_attribute(:puppet_ca_proxy_id, nil)
end; nil
RAKESCRIPT
~~~
~~~