currently i am using tasks in ansible .The task include aws cli command like below:
command: aws ec2 describe-instances --region myregion --profile myawsprofile --filters
It works perfectly when ran through
ansible-playbook my.yml
Now my question is : I have multiple aws profiles and don't want hard code in the aws cli commands(in tasks).
wanted to use variable for profile,so whatever variable passed to profile it will execute task and run ansible-playbook.
Request anyone to suggest how to proceed for this.
I looked at Environment Variables in aws cli , but didn't helped much.