Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-scylla-node: Allow the user to use a same certificate for all the nodes #427

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

igorribeiroduarte
Copy link
Collaborator

No description provided.

…set of nodes

If the user provides certificates for at least one node, then the user should either
provide certificates for all the other nodes or provide the CA used, otherwise the role
would generate its own CA which would of course be different than the one used by the user.

The main change in this patch is that now the user is allowed to provide certs for the nodes
without having to provide a CA, as long as the certificates are provided for all the nodes.
So far this role allowed the user to provide a parent folder (localhost_cert_path)
for the certificates but would always create the certificates and keys in `{{ localhost_cert_path }}/ssl/{{ hostname }}`,
with fixed names {{ hostname }}.crt and {{ hostname }}.pem,
what prevented us from being able to use a single certificate for all the nodes without having to create
a folder for every single node in the cluster with a same crt and key files.

With the changes in this patch, the 'localhost_cert_path' will indicate the complete path to the crt file and
a variable 'localhost_cert_key_path' was also added, this way the user can save the key in a different path, if necessary.

By having a 'localhost_cert_path' which is not a function of '{{ hostname }}', the user will now be able to have a single
certificate for the whole cluster.

The patch also tries to use the old defaults in the ssl task in case 'localhost_cert_path' and 'localhost_cert_key_path'
are not set in ordre to still support clusters that were relying on the old defaults.
@tarzanek
Copy link
Collaborator

tarzanek commented Dec 6, 2024

so with wildcard certificate support I guess #151 could be closed too

@igorribeiroduarte
Copy link
Collaborator Author

so with wildcard certificate support I guess #151 could be closed too

The issue above is still relevant when we are using certificates generated by this role, but it's out of the scope of the current PR

@igorribeiroduarte igorribeiroduarte marked this pull request as draft December 6, 2024 18:04
So far we were considering that the CA would always be used as a truststore, but
since the CA is not mandatory, this wouldn't always work.
From now on, let's have a dedicated file for the truststore and use the CA as
truststore only if the CA exists and if a dedicated truststore is not given.
This is necessary since the scylla.yaml.j2 file uses variables  '_localhost_cert_path',
'_localhost_cert_key_path' and '_truststore_exists', which are defined only
in the ssl task.
@igorribeiroduarte igorribeiroduarte marked this pull request as ready for review December 9, 2024 21:50
Copy link
Collaborator

@tarzanek tarzanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thnx for the truststore resolution!

@tarzanek tarzanek merged commit 80a9836 into scylladb:master Dec 10, 2024
2 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