Page 1 of 1
Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Wed Aug 07, 2024 2:02 pm
by mcdonamw
In Windows, I've found that if I simply install ncpa overtop of an existing installation, it will upgrade it to that new version, but I have cases where the previous install has an ncpa.cfg file with a bad token. It seems installing overtop does not overwrite an existing ncpa.cfg file.
Is there an option with the installer itself to force this, or do I have no choice but to move that previous ncpa.cfg file out of the way (del/rename/etc) before reinstall?
***EDIT*** Rewrote to make more clear.
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Wed Aug 07, 2024 2:13 pm
by jmichaelson
Would you mind sharing how your script is doing the install to facilitate troubleshooting this?
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Wed Aug 07, 2024 2:34 pm
by bbahn
Hello @mcdonamw,
When you upgrade NCPA, it keeps your ncpa.cfg in order to maintain your current configurations. If you want to change the token for NCPA with your script, you can use something like
Code: Select all
sudo sed -i '/^community_string.*=/c\community_string = [new_token_here]' /usr/local/ncpa/etc/ncpa.cfg
sudo systemctl restart ncpa
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Thu Aug 08, 2024 4:26 pm
by mcdonamw
Apologies, I should have been more clear. I'm installing NCPA on Windows systems using Powershell. I'm simply using Invoke-Command to launch the installer in silent mode, including the token on the command line.
So there's no option on the installer itself to overwrite the current ncpa.cfg file?
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Fri Aug 09, 2024 9:23 am
by bbahn
There is not. It is expected that users want to keep their configuration changes from previous versions. If you would like for this option to be added, I could file a feature request for you.
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Fri Aug 09, 2024 10:19 am
by mcdonamw
That makes sense. My concern is primarily the token not updating even though I passed it as part of the install. We're providing the token for a reason.
With that said, it would be nice to have an option for administrators to force a complete "reinstall" option, e.g. uninstall previous version before installing.
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Thu Aug 15, 2024 10:36 am
by bbahn
@mcdonamw,
I'll file a feature request to upgrade the silent installs to be able to update configuration options and to be able to do a clean install after uninstalling the previous version.
Re: Ncpa reinstall over existing does not update ncpa.cfg file
Posted: Mon Aug 19, 2024 10:48 am
by mcdonamw
Thank you!