@Tom-Elliott The probably the easiest solution is to create a procedure (wiki page) that if you need to update your fog server you need to do:

Update the settings in the /opt/fog/.fogsettings

Rerun the installer

Update the IP address for the storage node on the FOG system where you changed the IP address

Update the IP address on a any master storage node that may reference this FOG server

Update the FOG_WEB_HOST value

update the FOG_TFTP_HOST value

I can I’ll marked this as addressed (Solved), since its not a technical solution but a procedural one that resolves the issue.
[Edit] I would, but it appears I can no longer mark topics as solved[/Edit]

This one provides messages, and outputs them to a log file. It also creates it’s own settings file instead of storing settings inside of .fogsettings.

The web directory work is also dynamically based on the settings in .fogsettings

bldnsmasq now defaults to 1 if it’s not previously set - this only makes sense to build the correct file if it doesn’t exist, that way if the user wants to start up dnsmasq, they can just simply start it.

I’ve also fixed some minor errors. I’ve tested this only on CentOS 7 - seems to be working good.

Given that dnsmasq has been added to the /opt/fog/.fogsettings “productlist”, and is installed, and this script is named: /opt/fog/utils/updateIP.sh and made executable, and a root crontab event is made such as */5 * * * * /opt/fog/utils/updateIP.sh or */3 * * * * /opt/fog/utils/updateIP.sh (every 5 minutes, or every 3 minutes)

Then this will keep you’re fog server and it’s “defaultmember” storage node’s IP addresses totally up to date.
And - if you’re using the dodnsmasq and bldnsmasq settings, it’ll keep those updated with the right IP as well. With those set and this script running via Cron - you have a 100% Mobile FOG Server that auto-configures itself every time it’s IP changes.

This still needs further polishing, like a installer and uninstaller, a readme and a GNU GPL license attached. I’ll also make it into a sourceforge project too.

@Wayne-Workman
I think there should be an option in .fogsettings to skip this altogether, not because of system resources, but occasionally I might want to poke at the system (e.g. add a temporary VIP for testing something else) and unless the coding is air-tight, it might kick off some horrible changes.

@Wayne-Workman This is going to be a critical review of the code. Don’t take it personally (my guys hate me when I do this type of review, but the finished product is generally better).

Some lines use the full path to the application and some only use the application name. (i.e. /usr/share/awk)

Since you are using the full path to the application you assume that is the proper location. I just checked on my ubuntu based system awk is in /usr/bin/awk under Centos 7 its again /usr/bin/awk but in your script it references /usr/share/awk which I assume would cause your script to fail on these systems.

What would happen if interface or fogsettingsIP returned nothing instead of a value what would happen to your script?

The same question if the mysql credentials were not returned.

In sudburr’s post also references a wol host field to be updated, is this important?

What happens if config.class.php.old already exists when the script is run a second or third time. Will anything important be lost?

Do any running fog services maintain a cached copy of the server’s IP address or do the fog services need to be stopped when you update these settings to make them stick?

The only thing that jumps out that may be an issue in the script is that for the Centos 7 OS the ethernet adapters are no longer just eth0, eth1 and so on. The Intel NUC I’m working on the default ethernet adapter is enp3s0.

If the interface name is known, you can use this to get the IP in CentOS 7.

I agree this is great! I’m glad we have the community involvement in the FOG community to help everyone solve these basic problems. Well done @sudburr !!

The only thing that jumps out that may be an issue in the script is that for the Centos 7 OS the ethernet adapters are no longer just eth0, eth1 and so on. The Intel NUC I’m working on the default ethernet adapter is enp3s0.

I just checked and this value interface="enp3s0" can be extracted from the /opt/fog/.fogsettings file. This would then tie into what interface FOG is using too. There may be a case where there is a system with one or more network interfaces that the script would have to take into account.