Skip to content

Use better variable values for ssh_public_key#11

Merged
fghaas merged 3 commits intocleura:mainfrom
fghaas:null-key
Mar 5, 2026
Merged

Use better variable values for ssh_public_key#11
fghaas merged 3 commits intocleura:mainfrom
fghaas:null-key

Conversation

@fghaas
Copy link
Contributor

@fghaas fghaas commented Mar 5, 2026

  • fix: Set ssh_public_key to null (not "") in heat/environment.yaml
    Without this change, if the user neglects to set the ssh_public_key
    stack parameter, they get an error message that is rather unhelpful to
    a new user:

    ERROR: The public_key property is required by the nova API version currently used.

    By setting it to null (instead of the empty string) in
    heat/environment.yaml, they instead get:

    ERROR: The Parameter (ssh_public_key) was not provided.

    ... which is a much more self-explanatory message.

  • fix: Comment ssh_public_key in ansible/vars.yaml
    When setting ssh_public_key to null or the empty string, the Ansible
    playbook proceeds and completes successfully, but creates an invalid
    SSH keypair and thus an invalid authorized_keys file in the Pad Ramp
    host.

    Thus, comment out the variable in ansible/vars.yaml (leaving it
    undefined), which causes the playbook to fail outright because of a
    reference to an undefined variable.

  • fix: Comment ssh_public_key in tf/vars.tfvars
    When setting ssh_public_key to null or the empty string, "tofu apply"
    proceeds and completes successfully, but creates an invalid SSH
    keypair and thus an invalid authorized_keys file in the Pad Ramp host.

    Thus, comment out the variable in tf/vars.tfvars (leaving it
    undefined), which causes OpenTofu to prompt for the missing variable
    (unless a TF_VAR_ssh_public_key environment variable is set).

fghaas added 3 commits March 5, 2026 12:28
Without this change, if the user neglects to set the ssh_public_key
stack parameter, they get an error message that is rather unhelpful to
a new user:

ERROR: The public_key property is required by the nova API version currently used.

By setting it to null (instead of the empty string) in
heat/environment.yaml, they instead get:

ERROR: The Parameter (ssh_public_key) was not provided.

... which is a much more self-explanatory message.
When setting ssh_public_key to null or the empty string, the Ansible
playbook proceeds and completes successfully, but creates an invalid
SSH keypair and thus an invalid authorized_keys file in the Pad Ramp
host.

Thus, comment out the variable in ansible/vars.yaml (leaving it
undefined), which causes the playbook to fail outright because of a
reference to an undefined variable.
When setting ssh_public_key to null or the empty string, "tofu apply"
proceeds and completes successfully, but creates an invalid SSH
keypair and thus an invalid authorized_keys file in the Pad Ramp host.

Thus, comment out the variable in tf/vars.tfvars (leaving it
undefined), which causes OpenTofu to prompt for the missing variable
(unless a TF_VAR_ssh_public_key environment variable is set).
@fghaas fghaas changed the title null key Use better defaults for ssh_public_key Mar 5, 2026
@fghaas fghaas requested a review from colder-is-better March 5, 2026 12:45
@fghaas fghaas changed the title Use better defaults for ssh_public_key Use better variable values for ssh_public_key Mar 5, 2026
@fghaas fghaas merged commit 2c11000 into cleura:main Mar 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants