Hi,
I have a playbook which spins/deletes servers, adds volumes to previously created instances etc. I have exported my aws_access_key and aws_secret_key as environment variables. But when I try to pass them via parameters in playbook as names aws_access_key and aws_secret_key(as stated in ec2 module), my program fails stating unsupported parameters for aws_secret_key. My code is -
tasks:
- name: Launch Instances
local_action: ec2 aws_access_key=xxxx aws_secret_key=xxxx keypair={{keypair}} group={{security_group}} instance_type={{instance_type}} image={{image}} wait=true count={{count}} region={{region}} instance_tags=‘{“Name”:“NewansibleTest021”}’
register: ec2
But when I use ec2_access_key and ec2_secret_key instead of aws_access_key and aws_secret_key, my program runs successfully. So I would like to know whether this is a bug or am I doing somethin wrong…? My final code is -
tasks:
- name: Launch Instances
local_action: ec2 ec2_access_key=xxxx ec2_secret_key=xxxx keypair={{keypair}} group={{security_group}} instance_type={{instance_type}} image={{image}} wait=true count={{count}} region={{region}} instance_tags=‘{“Name”:“NewansibleTest021”}’
register: ec2
Thanks,