redhat-cop/infra.osbuild

Skip kickstart Generation if Not Enough Info Provided

jjaswanson4 opened this issue · 3 comments

If certain vars are not defined, generating a kickstart file will fail:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleError: An unhandled exception occurred while templating '{{ lookup('file', '~/.ssh/id_rsa.pub') }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'file'. Error was a <class 'ansible.errors.AnsibleError'>, original message: could not locate file in lookup: ~/.ssh/id_rsa.pub. could not locate file in lookup: ~/.ssh/id_rsa.pub
fatal: [edge-manager-local]: FAILED! => {"changed": false, "msg": "AnsibleError: An unhandled exception occurred while templating '{{ lookup('file', '~/.ssh/id_rsa.pub') }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: An unhandled exception occurred while running the lookup plugin 'file'. Error was a <class 'ansible.errors.AnsibleError'>, original message: could not locate file in lookup: ~/.ssh/id_rsa.pub. could not locate file in lookup: ~/.ssh/id_rsa.pub"}

This is not being caught by CI because we "fake" an SSH key there, which is fine, but we should be warning users (or optionally, skipping the task).

@jjaswanson4 would you prefer to skip the task or to omit the entry in the templated kickstart?

I'm good with either, we just need to make sure to document the behavior so the user isn't surprised.

I'd say generating a default kickstart and skipping the omitted info is cleaner, and agreed on documentation.

Maybe we should document and add a debug of "if you don't specify a user/pass or sshkey, you won't be able to log in so...define one of those" ?

Maybe we should document and add a debug of "if you don't specify a user/pass or sshkey, you won't be able to log in so...define one of those" ?

That's technically only true for the edge-type composes, but yes we should make it clear.