Hi, first-time ansible user here. I’m trying to create a playbook that creates a namespace in an existing AKS cluster. I see tutorials about locally creating a namespace using ansible, but for those, your AKS cluster/kubeconfig file is already in path. I’m wondering how I can do this on AAP, I’m not exactly sure what my playbook should look like. I’d really appreciate if anyone could point me in the right direction!
There are several options you can approach this with. You could encrypt the kube config file using Ansible vault and have a pre-step in your playbook to decrypt. You could also create a new Credential Type in AAP (I assume it has this since it’s based on AWX) that is just your kubeconfig file. 11. Custom Credential Types — Ansible Tower User Guide v3.8.6 You’d then create a credential of this type containing your kubeconfig file and you can have your playbook copy it from the credential variable to a file that you’d then reference for your k8s commands in your play. kubernetes.core.k8s module – Manage Kubernetes (K8s) objects — Ansible Community Documentation you may be able to reference the variable directly in some way, not sure, maybe someone else has.