what is the best way to import SSH-Keys to a provisioned Machine by foreman?
Before my Foreman Installation I added all my Keys into the Kickstart file, but now I think there is a better way.
In my “Kickstart default finish” prov Template i saw the variable/Snippet “remote_execution_ssh_keys”. Where i can change this one? How to create a new Variable like this?
the snippets are not variables but templates themselves, which are usually used in other templates.
For example the remote_execution_ssh_keys-snippet is not only used in the kickstart default finish, but also in kickstart default, preseed finish and autoyast.
In this case the ssh-keys for remote execution are read from all smart proxies and added to the authorized_keys during provisioning. You could also create a special ssh-user with sudo-priviledges using this snippet.
If you have already provisioned machines and you also use Katello, you could use the bootstrap.py-script to register them and there is also an option to add the ssh-keys for remote execution.
Another way would be a configuration management tool such as puppet to manage ssh-keys on the machine.
If you plan to adapt templates, i recommend to clone an existing one and edit it then. If you unlock and edit community templates your changes might be overwritten during upgrades.
You’re right, but the snippet also checks for existence of the parameter and if it finds it and is a string, it deploys that string as a key. If it returns array (rex plugin is present), the array contains keys from all proxies.
In other words, without rex plugin, it should be enough to set the key in the remote_execution_ssh_keys parameter. E.g. define that as a global parameter.