Will
Thank you.
Yes, you are correct, I had the wrong value for the argument I was using.
instance_profile_name=administrator
is now working for me.
The complete stanza is
- name: Launch instance
local_action: ec2 keypair={{ keypair }} instance_type={{ instance_type
}}
image={{ image }} region={{ region }}
aws_access_key={{ aws_access_key }}
aws_secret_key={{ aws_secret_key }}
group={{ security_group }} wait=true
instance_profile_name=administrator
register: ec2
Thanks much.
mark
On Tuesday, April 15, 2014 6:32:05 PM UTC-5, Will Thames wrote:
>
> I wonder if you should just use administrator (rather than the full ARN)
> for instance_profile_name.
>
> From
> http://boto.readthedocs.org/en/latest/ref/ec2.html#boto.ec2.connection.EC2Connection.run_instances
>
> - *instance_profile_arn*
> (*string*<http://docs.python.org/library/string.html#module-string>)
> – The Amazon resource name (ARN) of the IAM Instance Profile (IIP) to
> associate with the instances.
> - *instance_profile_name*
> (*string*<http://docs.python.org/library/string.html#module-string>)
> – The name of the IAM Instance Profile (IIP) to associate with the
> instances.
>
> The ec2 module only uses the latter, I think, although it could presumably
> be tweaked to use the former in addition.
>
> Will
>
> On Wednesday, April 16, 2014 7:52:51 AM UTC+10, mark david mcCreary wrote:
>>
>> - name: Launch instance
>> local_action: ec2 keypair={{ keypair }} instance_type={{ instance_type
>> }}
>> image={{ image }} region={{ region }}
>> aws_access_key={{ aws_access_key }}
>> aws_secret_key={{ aws_secret_key }}
>> group={{ security_group }} wait=true
>>
>> instance_profile_name=arn:aws:iam::127847392001:instance-profile/administrator
>> register: ec2
>>
>>
>> and Ansible says
>>
>> # Instance Profile ARN(s)
>> arn:aws:iam::127847392001:instance-profile/administrator
>>
>> # TASK: [ec2 | Launch instance]
>> *************************************************
>> # failed: [localhost] => {"failed": true, "item": ""}
>> # msg: Instance creation failed => InvalidParameterValue: Value
>> (arn:aws:iam::127847392001:instance-profile/administrator) for parameter
>> iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name
>>
>>
>> Have also tried with double quotes around name
>>
>>
>> instance_profile_name="arn:aws:iam::127847392001:instance-profile/administrator"
>>
>> Looking at Amazon console I see a role named - administrator. I can
>> launch instances without Ansible using the above profile.
>>
>> Is this a syntax problem, or am I in the wrong environment or something.
>>
>> Thaks
>>
>> mark
>>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/5016cd62-3549-4fce-8b12-6d61b1cf5950%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.