Yes, this is a missing feature if you use the built-in templates. The templates are intended to get a basic set-up off the ground but will not, as you have seen, suitable for all use cases.
There is a setting in the component configs that apply to Gateways and SANs, “config.rebuild”, which can be one of never, initial or always. For new Gateways this defaults to initial and for SANs to always. For adopted legacy installs the defaults are actually undefined. I will add that to the TODO list.
$ geneos add gateway blah
...
$ geneos show blah
{
"name": "blah",
"host": "localhost",
"type": "gateway",
"config": {
"aesfile": "gateway.aes",
"binary": "gateway2.linux_64",
"config": {
"rebuild": "initial",
"template": "gateway.setup.xml.gotmpl"
},
"gatewayname": "blah",
...
$ cat $(geneos home gateway blah)/gateway.json
{
"aesfile": "gateway.aes",
"binary": "gateway2.linux_64",
"config": {
"rebuild": "initial",
"template": "gateway.setup.xml.gotmpl"
},
"gatewayname": "blah",
If you set your SAN config.build to never then you should be able to edit the config file manually. If you add new template(s) to the san/templates directory then these can also help maintain the config files.
So:
$ geneos set gateway blah config.rebuild=never
$ geneos show blah
{
"name": "blah",
"host": "localhost",
"type": "gateway",
"config": {
"aesfile": "gateway.aes",
"binary": "gateway2.linux_64",
"config": {
"rebuild": "never",
"template": "gateway.setup.xml.gotmpl"
},
"gatewayname": "blah",
...
The templates are in Go text/template format and are passed a structure including all the items under the top-level config item in the instance configuration (see above). For instances that still use *.rc
files these are internally converted to the new values but no on-disk change should take place. Basically do a geneos show netprobe abc
to see the values that can appear in the template.
The documentation is not very extensive in this area and what there is, after a quick look, is a little out of date. Templates are both embedded in the binary at build time to ensure there are simple, sensible defaults, but they can be overridden. If you have picked up geneos
to use with a legacy system then your template directories may be empty; Try this:
$ ls $(geneos home)/san/templates
ls: cannot access /opt/geneos/geneos-utils/system/san/templates: No such file or directory
$ geneos init -T
gateway template written to /opt/geneos/geneos-utils/system/gateway/templates/gateway.setup.xml.gotmpl
gateway instance template written to /opt/geneos/geneos-utils/system/gateway/templates/gateway-instance.setup.xml.gotmpl
san template written to /opt/geneos/geneos-utils/system/san/templates/netprobe.setup.xml.gotmpl
$ ls -l $(geneos home)/san/templates
total 4
-rw-rw-r--. 1 geneos geneos 1582 Jun 29 12:13 netprobe.setup.xml.gotmpl
geneos init -T
will write the embedded templates into the right directories.
While testing some of this above I noticed the unset command is also a little broken. Apologies.