amimof / kubernetes-the-right-way

Install Kubernetes with Ansible
MIT License
28 stars 7 forks source link

Ansible variable for keys check #42

Open anton-johansson opened 5 years ago

anton-johansson commented 5 years ago

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.

amimof commented 5 years ago

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

anton-johansson commented 5 years ago

Yeah, that sounds great!