Prerequisites:

  • Ansible Installed
  • Inventory Configured
  • AWS CLIv2 installed and Configured

Step-1)Configuring Dynamic inventory

  • Here I am using dynamic inventory because we have to configure minikube in ec2 instance.
  • For the dynamic inventory, download ec2.py and ec2.ini from this given URL, and paste in the inventory folder:
https://github.com/ansible/ansible/tree/stable-2.9/contrib/inventory
  • Now add this path in ansible.cfg
  • After that, you also need to copy the key.pem for the ec2 instance launch.
  • After copying your key, make it executable by the following command:
chmod 600 Key_Name.pem

  • Here you also need privilege escalation because in aws we have to configure all the configurations done by the user root only.
  • After this edit your ec2.py

#ansible #aws #kubernetes

Create an Ansible playbook to launch the EC2 instance and configure minikube in it.
12.50 GEEK