kubernetes-the-right-way icon indicating copy to clipboard operation
kubernetes-the-right-way copied to clipboard

Ansible variable for keys check

Open anton-johansson opened this issue 6 years ago • 2 comments

Background:

I have a working cluster with 3 masters and 5 nodes. I ask my colleague to add another node into the cluster. He clones KTRW and our repository that contains our inventory file. He adds the new node into the inventory file.

If he runs the Ansible playbook now, it will destroy the cluster, since he has no keys on his machine.

I was thinking that we could have a validation parameter. If the parameter is set to true, it could check if vital keys are missing (for example the service-account-key.pem) and if so, simply fail the playbook, explaining that the user needs the keys to continue.

What do you think? Just as a safety measure.

anton-johansson avatar Apr 01 '19 12:04 anton-johansson

Interesting! A simple check for existing certificates could suffice. For example if the issuer signature is different from those already copied to the hosts, the install will fail. And we can use regenerate_keys and regenerate_cerst to force recreate certs and keys

amimof avatar Apr 02 '19 08:04 amimof

Yeah, that sounds great!

anton-johansson avatar Apr 02 '19 12:04 anton-johansson