There are multiple configuration options you can do with the ini file. Https:/ //ansible /ansible/stable- 2.9/contrib/inventory/ec2.iniĬhmod x ~ /my_aws_project/inventory /ec2.py Wget -O ~ /my_aws_project/inventory /ec2.ini \ Https:/ //ansible /ansible/stable- 2.9/contrib/inventory/ec2.py Get the EC2 dynamic inventory: wget -O ~ /my_aws_project/inventory /ec2.py \ Sudo ln -s /usr/ bin/python3 /usr/ bin/python Install prerequisites: sudo apt install -y python3-pip Or we can use the one already provide with Ansible: We could then develop a script that discovers our EC2 infrastructure that would take some time. A dynamic inventory is a scrip that outputs a JSON in a structure that Ansible can handle. This source can be a database, an active directory, etc. Instead of having a static declaration in a static file of your inventory, you can generate it from a source. The one I’ve seen as the best so far: mkdir - p ~/my_aws_project/inventoryĪnsible can work with a different kind of inventory called the dynamic inventory. Ref: Connect your environment to your AWS cloud $ aws configureĪWS Access Key ID : AKIAIOSFODNN7EXAMPLEĪWS Secret Access Key : wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEYĭefault region name : eu-central-a 24_linux_amd64.zipĪWS Client installation: curl "" -o "awscliv2.zip" Terraform installation: wget https: ///terraform/0.12.24/terraform_0.12.24_linux_amd64.zip Sudo apt- add-repository -yes -update ppa:ansible/ansible Sudo apt install -y software-properties-common This installation is made from a bastion server already available with the proper network permissions.įor different deployment types, you should adapt it to your need. Automate AWS deployments with Ansible Terraform
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |