Host interface swap primary eth0 to eth1

Problem:
I have registered some hosts and the host ethernet for foreman communication is eth1. However all hosts have been registered as eth0.
Ive tried swapping this in the guin but return an error - Some of the interfaces are invalid. Please check the table below.
I have around 300 hosts with this problem. eth1 need to become the primary. So really want to script it.

Expected outcome:
able to switch primary interface between eth0 and eth 1

Foreman and Proxy versions:
3.14

Foreman and Proxy plugin versions:
2.35
katello 3.18
Distribution and version:

Other relevant data:

Looks like to make it work in GUI
store original hostname name
rename host - save
edit eth1 to be primary
save
edit eth1 add original hostname to fqdn
save

1 Like