unfortunately, it is not possible to perform such things in current Ambari release.
It reverts all the modification made in configuration files directly.
If you really need this functionality set, then you can edit files, but not use Ambari for restarting services, restart it manually from the command line.
Sorry for inconvenience…
Hope this helps.