I'm trying to attach an elastic IP to an instance in a VPC, but despite following what seem to be working examples in online documentation, I'm getting an error.
To keep it as simple as possible, I have:
- Launched an instance (using Ansible) in a public VPC subnet
- Manually captured its ID
- Created an elastic IP (using Ansible)
- Manually captured its ID
I've then placed these two into the following:
- ec2_eip:
in_vpc: yes
aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{ aws_secret_key }}"
region: "{{ aws_region }}"
ip: 176.34.177.168
device_id: i-017a9496dc9940cd1
The output I get is:
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "EC2ResponseError: 400 Bad Request\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Response><Errors><Error><Code>InvalidParameterCombination</Code><Message>You must specify an allocation id when mapping an address to a VPC instance</Message></Error></Errors><RequestID>14ea5e22-0e38-4392-90bc-48c1837f4a46</RequestID></Response>"}
I get the same behaviour when I tie the above tasks together with register and facts.
Having scoured the documentation, mailing lists, online books, and other Google resources, I can't see that I am doing anything wrong.
What am I missing?
My system:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
$ ansible --version
ansible 2.3.1.0
config file =
configured module search path = Default w/o overrides
python version = 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]
S.
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ce0ef404-3846-44ee-8f42-f56c267750c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,Try specifying "private_ip_address" of the ENI that you're allocating elastic IP to.
Will keep this thread updated.