https://rancher.com/ logo
Title
s

straight-morning-82320

12/21/2022, 11:14 AM
Hi all, Is there any rke2 terraform provider or other similar solutions for installation automation ?
Actually, I am looking for a similar provider like for RKE to do IaC. If it does not exist yet, is it on Rancher roadmap ? I'd be glad to contribute if necessary.
b

boundless-eye-27124

12/21/2022, 6:40 PM
this a good ansible automation I found and using it: https://github.com/rancherfederal/rke2-ansible
if you are using kube-vip this role is also good: https://github.com/lablabs/ansible-role-rke2
s

straight-morning-82320

12/22/2022, 8:19 AM
@boundless-eye-27124 Thanks, I already took a look on that role. However, the major drawback of Ansible is being stateless. You cannot really delete rke2 once installed unless going throigh shell commands.
b

best-microphone-20624

12/24/2022, 6:20 PM
Have you looked at the rke2 provisioner included in the rancher terraform provider?
s

straight-morning-82320

01/02/2023, 8:43 AM
Hi @best-microphone-20624, yes I looked at Rancher provider. But unfortunately, it requires an existing instance of Rancher. My need is to install RKE2 to install Rancher on top of it. See similar discussion here : https://github.com/rancher/rke2/issues/1676#issuecomment-1361671521
Currently, a workaround is to use Terraform provisioner. I created a module to install and uninstall an existing RKE2 via Terraform (that launches shell commands).