Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocating EIPs to Interfaces with Private IPs do not associate with the Private IP address unless the EIP already exists. #330

Closed
JonTheNiceGuy opened this issue Dec 11, 2020 · 0 comments · Fixed by #328

Comments

@JonTheNiceGuy
Copy link

JonTheNiceGuy commented Dec 11, 2020

SUMMARY

I've created an ENI with two secondary IP addresses, and I've then tried to create and attach an EIP to each of those Secondary IPs. If I created the EIP and tried to associate it to the Private IP of the ENI, the first EIP would be created, but the second pass would replace the first. To actually create the EIPs I wanted, I had to create the EIPs separately wihout associating them to anything, and then run a second pass where I said "associate yourself with that IP", and that worked.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.aws.ec2_eip

ANSIBLE VERSION
ansible 2.10.3
  config file = /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg
  configured module search path = ['/home/spriggsj/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/spriggsj/Ansible-2.10.3/lib/python3.8/site-packages/ansible
  executable location = /home/spriggsj/Ansible-2.10.3/bin/ansible
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
CONFIGURATION
COLLECTIONS_PATHS(/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg) = ['/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections', '/home/spriggsj/.ansible/collections', '/usr/share/ansible/collections']
DEFAULT_HOST_LIST(/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg) = ['/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory']
DEFAULT_ROLES_PATH(/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg) = ['/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/roles', '/home/spriggsj/.ansible/roles', '/usr/share/ansible/roles', '/etc/ansible/roles']
DISPLAY_SKIPPED_HOSTS(/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg) = False
RETRY_FILES_ENABLED(/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg) = False
OS / ENVIRONMENT

Windows Subsystem for Linux, running Ubuntu 20.04. I have a virtualenv running ansible 2.10.3 and ansible-base 2.10.3 too. I'm targetting AWS assets.

STEPS TO REPRODUCE
- name: Does not work
  hosts: localhost
  gather_facts: false
  vars:
    EIPs:
    - EIP_Name: demo_EIP1
      region: eu-west-1
      interface: eni-0101c767b231dae60 # replace with your own
      private_ip: 192.168.0.20 # Primary address
    - EIP_Name: demo_EIP2
      region: eu-west-1
      interface: eni-0101c767b231dae60
      private_ip: 192.168.0.21 # Secondary address
    - EIP_Name: demo_EIP3
      region: eu-west-1
      interface: eni-0101c767b231dae60
      private_ip: 192.168.0.22 # Secondary address
  tasks:
  - name: Allocate EIP to ENI
    loop: "{{ EIPs }}"
    loop_control:
      label: "{{ item.EIP_Name }}"
    community.aws.ec2_eip:
      region: "{{ item.region }}"
      device_id: "{{ item.interface }}"
      private_ip_address: "{{ item.private_ip }}"
      state: present
      in_vpc: true
    register: eip_association
# Result
# EIP: Unnamed EIP (203.0.113.12) associated to ENI eni-0101c767b231dae60 address 192.168.0.20
- name: Works
  hosts: localhost
  gather_facts: false
  vars:
    EIPs:
    - EIP_Name: demo_EIP1
      region: eu-west-1
      interface: eni-0101c767b231dae60 # replace with your own
      private_ip: 192.168.0.20 # Primary address
    - EIP_Name: demo_EIP2
      region: eu-west-1
      interface: eni-0101c767b231dae60
      private_ip: 192.168.0.21 # Secondary address
    - EIP_Name: demo_EIP3
      region: eu-west-1
      interface: eni-0101c767b231dae60
      private_ip: 192.168.0.22 # Secondary address
  tasks:
  - name: Create EIPs
    loop: "{{ EIPs }}"
    loop_control:
      label: "{{ item.EIP_Name }}"
    community.aws.ec2_eip:
      region: "{{ item.region }}"
      state: present
      in_vpc: true
    register: eip_allocation
  - name: Allocate EIP to ENI
    loop: "{{ eip_allocation.results }}"
    loop_control:
      label: "{{ item.item.EIP_Name }}"
    community.aws.ec2_eip:
      public_ip: "{{ item.public_ip }}"
      region: "{{ item.item.region }}"
      device_id: "{{ item.item.interface }}"
      private_ip_address: "{{ item.item.private_ip }}"
      state: present
      in_vpc: true
    register: eip_association
# Result
# EIP: Unnamed EIP (203.0.113.94) associated to ENI eni-0101c767b231dae60 address 192.168.0.20
# EIP: Unnamed EIP (203.0.113.52) associated to ENI eni-0101c767b231dae60 address 192.168.0.21
# EIP: Unnamed EIP (203.0.113.47) associated to ENI eni-0101c767b231dae60 address 192.168.0.22
EXPECTED RESULTS

My expectation is that passing the Private IP to the community.aws.ec2_eip module would associate that EIP to the Private IP on the ENI.

ACTUAL RESULTS

Does not work

ansible-playbook 2.10.3
  config file = /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg
  configured module search path = ['/home/spriggsj/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/spriggsj/Ansible-2.10.3/lib/python3.8/site-packages/ansible
  executable location = /home/spriggsj/Ansible-2.10.3/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
Using /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory as it did not pass its verify_file() method
script declined parsing /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory as it did not pass its verify_file() method
auto declined parsing /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory as it did not pass its verify_file() method
Parsed /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory inventory source with ini plugin
Loading collection community.aws from /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws
Loading callback plugin default of type stdout, v2.0 from /home/spriggsj/Ansible-2.10.3/lib/python3.8/site-packages/ansible/plugins/callback/default.py
Attempting to use 'default' callback.
Skipping callback 'default', as we already have a stdout callback.
Attempting to use 'junit' callback.
Attempting to use 'minimal' callback.
Skipping callback 'minimal', as we already have a stdout callback.
Attempting to use 'oneline' callback.
Skipping callback 'oneline', as we already have a stdout callback.
Attempting to use 'tree' callback.

PLAYBOOK: poc_eip.yml **************************************************************************************************************************************
Positional arguments: poc_eip.yml
verbosity: 5
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory',)
forks: 5
1 plays in poc_eip.yml

PLAY [Does not work] ***************************************************************************************************************************************
META: ran handlers
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: spriggsj
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762 `" && echo ansible-tmp-1607685544.1425083-18529-77403463762762="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762 `" ) && sleep 0'
Loading collection amazon.aws from /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/amazon/aws
Including module_utils file ansible/__init__.py
Including module_utils file ansible/module_utils/__init__.py
Including module_utils file ansible/module_utils/basic.py
Including module_utils file ansible/module_utils/_text.py
Including module_utils file ansible/module_utils/common/_collections_compat.py
Including module_utils file ansible/module_utils/common/__init__.py
Including module_utils file ansible/module_utils/common/_json_compat.py
Including module_utils file ansible/module_utils/common/_utils.py
Including module_utils file ansible/module_utils/common/file.py
Including module_utils file ansible/module_utils/common/parameters.py
Including module_utils file ansible/module_utils/common/collections.py
Including module_utils file ansible/module_utils/common/process.py
Including module_utils file ansible/module_utils/common/sys_info.py
Including module_utils file ansible/module_utils/common/text/converters.py
Including module_utils file ansible/module_utils/common/text/__init__.py
Including module_utils file ansible/module_utils/common/text/formatters.py
Including module_utils file ansible/module_utils/common/validation.py
Including module_utils file ansible/module_utils/common/warnings.py
Including module_utils file ansible/module_utils/compat/selectors.py
Including module_utils file ansible/module_utils/compat/__init__.py
Including module_utils file ansible/module_utils/compat/_selectors2.py
Including module_utils file ansible/module_utils/distro/__init__.py
Including module_utils file ansible/module_utils/distro/_distro.py
Including module_utils file ansible/module_utils/parsing/convert_bool.py
Including module_utils file ansible/module_utils/parsing/__init__.py
Including module_utils file ansible/module_utils/pycompat24.py
Including module_utils file ansible/module_utils/six/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/core.py
Including module_utils file ansible/module_utils/common/dict_transformations.py
Including module_utils file ansible_collections/__init__.py
Including module_utils file ansible_collections/amazon/__init__.py
Including module_utils file ansible_collections/amazon/aws/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/ec2.py
Including module_utils file ansible/module_utils/ansible_release.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/cloud.py
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-1852577oemcpu/tmpkbp_vswp TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685544.1425083-18529-77403463762762/ > /dev/null 2>&1 && sleep 0'

TASK [Allocate EIP to ENI] *********************************************************************************************************************************
task path: /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/poc_eip.yml:19
changed: [localhost] => (item=demo_EIP1) => {
    "allocation_id": "eipalloc-05eda43b2c90071c0",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": "eni-0101c767b231dae60",
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": "192.168.0.20",
            "profile": null,
            "public_ip": null,
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "EIP_Name": "demo_EIP1",
        "interface": "eni-0101c767b231dae60",
        "private_ip": "192.168.0.20",
        "region": "eu-west-1"
    },
    "public_ip": "52.215.73.214"
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972 `" && echo ansible-tmp-1607685546.9279625-18529-236897225035972="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-1852577oemcpu/tmph8htdsw8 TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685546.9279625-18529-236897225035972/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => (item=demo_EIP2) => {
    "allocation_id": "eipalloc-05eda43b2c90071c0",
    "ansible_loop_var": "item",
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": "eni-0101c767b231dae60",
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": "192.168.0.21",
            "profile": null,
            "public_ip": null,
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "EIP_Name": "demo_EIP2",
        "interface": "eni-0101c767b231dae60",
        "private_ip": "192.168.0.21",
        "region": "eu-west-1"
    },
    "public_ip": "52.215.73.214"
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703 `" && echo ansible-tmp-1607685548.2997587-18529-77152922726703="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-1852577oemcpu/tmpfgz54qy6 TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685548.2997587-18529-77152922726703/ > /dev/null 2>&1 && sleep 0'
ok: [localhost] => (item=demo_EIP3) => {
    "allocation_id": "eipalloc-05eda43b2c90071c0",
    "ansible_loop_var": "item",
    "changed": false,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": "eni-0101c767b231dae60",
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": "192.168.0.22",
            "profile": null,
            "public_ip": null,
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "EIP_Name": "demo_EIP3",
        "interface": "eni-0101c767b231dae60",
        "private_ip": "192.168.0.22",
        "region": "eu-west-1"
    },
    "public_ip": "52.215.73.214"
}
META: ran handlers
META: ran handlers

PLAY RECAP *************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Works

ansible-playbook 2.10.3
  config file = /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg
  configured module search path = ['/home/spriggsj/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/spriggsj/Ansible-2.10.3/lib/python3.8/site-packages/ansible
  executable location = /home/spriggsj/Ansible-2.10.3/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
Using /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory as it did not pass its verify_file() method
script declined parsing /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory as it did not pass its verify_file() method
auto declined parsing /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory as it did not pass its verify_file() method
Parsed /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory inventory source with ini plugin
Loading collection community.aws from /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws
Loading callback plugin default of type stdout, v2.0 from /home/spriggsj/Ansible-2.10.3/lib/python3.8/site-packages/ansible/plugins/callback/default.py
Attempting to use 'default' callback.
Skipping callback 'default', as we already have a stdout callback.
Attempting to use 'junit' callback.
Attempting to use 'minimal' callback.
Skipping callback 'minimal', as we already have a stdout callback.
Attempting to use 'oneline' callback.
Skipping callback 'oneline', as we already have a stdout callback.
Attempting to use 'tree' callback.

PLAYBOOK: poc_eip.yml **************************************************************************************************************************************
Positional arguments: poc_eip.yml
verbosity: 5
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/inventory',)
forks: 5
1 plays in poc_eip.yml

PLAY [Works] ***********************************************************************************************************************************************
META: ran handlers
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: spriggsj
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111 `" && echo ansible-tmp-1607685753.8644714-18655-16219781418111="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111 `" ) && sleep 0'
Loading collection amazon.aws from /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/amazon/aws
Including module_utils file ansible/__init__.py
Including module_utils file ansible/module_utils/__init__.py
Including module_utils file ansible/module_utils/basic.py
Including module_utils file ansible/module_utils/_text.py
Including module_utils file ansible/module_utils/common/_collections_compat.py
Including module_utils file ansible/module_utils/common/__init__.py
Including module_utils file ansible/module_utils/common/_json_compat.py
Including module_utils file ansible/module_utils/common/_utils.py
Including module_utils file ansible/module_utils/common/file.py
Including module_utils file ansible/module_utils/common/parameters.py
Including module_utils file ansible/module_utils/common/collections.py
Including module_utils file ansible/module_utils/common/process.py
Including module_utils file ansible/module_utils/common/sys_info.py
Including module_utils file ansible/module_utils/common/text/converters.py
Including module_utils file ansible/module_utils/common/text/__init__.py
Including module_utils file ansible/module_utils/common/text/formatters.py
Including module_utils file ansible/module_utils/common/validation.py
Including module_utils file ansible/module_utils/common/warnings.py
Including module_utils file ansible/module_utils/compat/selectors.py
Including module_utils file ansible/module_utils/compat/__init__.py
Including module_utils file ansible/module_utils/compat/_selectors2.py
Including module_utils file ansible/module_utils/distro/__init__.py
Including module_utils file ansible/module_utils/distro/_distro.py
Including module_utils file ansible/module_utils/parsing/convert_bool.py
Including module_utils file ansible/module_utils/parsing/__init__.py
Including module_utils file ansible/module_utils/pycompat24.py
Including module_utils file ansible/module_utils/six/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/core.py
Including module_utils file ansible/module_utils/common/dict_transformations.py
Including module_utils file ansible_collections/__init__.py
Including module_utils file ansible_collections/amazon/__init__.py
Including module_utils file ansible_collections/amazon/aws/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/ec2.py
Including module_utils file ansible/module_utils/ansible_release.py
Including module_utils file ansible_collections/amazon/aws/plugins/module_utils/cloud.py
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-186517elp1ba6/tmp7akioagw TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685753.8644714-18655-16219781418111/ > /dev/null 2>&1 && sleep 0'

TASK [Create EIPs] *****************************************************************************************************************************************
task path: /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/poc_eip.yml:19
changed: [localhost] => (item=demo_EIP1) => {
    "allocation_id": "eipalloc-007e6569a09a29eb3",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": null,
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": null,
            "profile": null,
            "public_ip": null,
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "EIP_Name": "demo_EIP1",
        "interface": "eni-0101c767b231dae60",
        "private_ip": "192.168.0.20",
        "region": "eu-west-1"
    },
    "public_ip": "52.215.73.214"
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736 `" && echo ansible-tmp-1607685755.2631514-18655-179071484040736="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-186517elp1ba6/tmpnjx90jdf TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685755.2631514-18655-179071484040736/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => (item=demo_EIP2) => {
    "allocation_id": "eipalloc-04ac512e79bc7b2b9",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": null,
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": null,
            "profile": null,
            "public_ip": null,
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "EIP_Name": "demo_EIP2",
        "interface": "eni-0101c767b231dae60",
        "private_ip": "192.168.0.21",
        "region": "eu-west-1"
    },
    "public_ip": "52.208.134.42"
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424 `" && echo ansible-tmp-1607685756.5287392-18655-92999893632424="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-186517elp1ba6/tmp_xpfskn0 TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685756.5287392-18655-92999893632424/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => (item=demo_EIP3) => {
    "allocation_id": "eipalloc-06a0361e79c69996c",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": null,
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": null,
            "profile": null,
            "public_ip": null,
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "EIP_Name": "demo_EIP3",
        "interface": "eni-0101c767b231dae60",
        "private_ip": "192.168.0.22",
        "region": "eu-west-1"
    },
    "public_ip": "54.78.131.18"
}
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: spriggsj
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474 `" && echo ansible-tmp-1607685757.7300916-18732-12667926890474="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-186517elp1ba6/tmpaqmaj5ao TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685757.7300916-18732-12667926890474/ > /dev/null 2>&1 && sleep 0'

TASK [Allocate EIP to ENI] *********************************************************************************************************************************
task path: /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/poc_eip.yml:28
changed: [localhost] => (item=demo_EIP1) => {
    "allocation_id": "eipalloc-007e6569a09a29eb3",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": "eni-0101c767b231dae60",
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": "192.168.0.20",
            "profile": null,
            "public_ip": "52.215.73.214",
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "allocation_id": "eipalloc-007e6569a09a29eb3",
        "ansible_loop_var": "item",
        "changed": true,
        "failed": false,
        "invocation": {
            "module_args": {
                "allow_reassociation": false,
                "aws_access_key": null,
                "aws_ca_bundle": null,
                "aws_config": null,
                "aws_secret_key": null,
                "debug_botocore_endpoint_logs": false,
                "device_id": null,
                "ec2_url": null,
                "in_vpc": true,
                "private_ip_address": null,
                "profile": null,
                "public_ip": null,
                "public_ipv4_pool": null,
                "region": "eu-west-1",
                "release_on_disassociation": false,
                "reuse_existing_ip_allowed": false,
                "security_token": null,
                "state": "present",
                "tag_name": null,
                "tag_value": null,
                "validate_certs": true,
                "wait_timeout": null
            }
        },
        "item": {
            "EIP_Name": "demo_EIP1",
            "interface": "eni-0101c767b231dae60",
            "private_ip": "192.168.0.20",
            "region": "eu-west-1"
        },
        "public_ip": "52.215.73.214"
    },
    "public_ip": "52.215.73.214"
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972 `" && echo ansible-tmp-1607685759.72233-18732-3575493571972="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-186517elp1ba6/tmpvundftlv TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685759.72233-18732-3575493571972/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => (item=demo_EIP2) => {
    "allocation_id": "eipalloc-04ac512e79bc7b2b9",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": "eni-0101c767b231dae60",
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": "192.168.0.21",
            "profile": null,
            "public_ip": "52.208.134.42",
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "allocation_id": "eipalloc-04ac512e79bc7b2b9",
        "ansible_loop_var": "item",
        "changed": true,
        "failed": false,
        "invocation": {
            "module_args": {
                "allow_reassociation": false,
                "aws_access_key": null,
                "aws_ca_bundle": null,
                "aws_config": null,
                "aws_secret_key": null,
                "debug_botocore_endpoint_logs": false,
                "device_id": null,
                "ec2_url": null,
                "in_vpc": true,
                "private_ip_address": null,
                "profile": null,
                "public_ip": null,
                "public_ipv4_pool": null,
                "region": "eu-west-1",
                "release_on_disassociation": false,
                "reuse_existing_ip_allowed": false,
                "security_token": null,
                "state": "present",
                "tag_name": null,
                "tag_value": null,
                "validate_certs": true,
                "wait_timeout": null
            }
        },
        "item": {
            "EIP_Name": "demo_EIP2",
            "interface": "eni-0101c767b231dae60",
            "private_ip": "192.168.0.21",
            "region": "eu-west-1"
        },
        "public_ip": "52.208.134.42"
    },
    "public_ip": "52.208.134.42"
}
<127.0.0.1> EXEC /bin/sh -c 'echo ~spriggsj && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/spriggsj/.ansible/tmp `"&& mkdir "` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137 `" && echo ansible-tmp-1607685762.0412364-18732-127819355277137="` echo /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137 `" ) && sleep 0'
Using module file /mnt/c/Users/SPRIGGSJ/Documents/01 Projects/2020-11-17 AWS VIP/collections/ansible_collections/community/aws/plugins/modules/ec2_eip.py
<127.0.0.1> PUT /home/spriggsj/.ansible/tmp/ansible-local-186517elp1ba6/tmpt6hpw1so TO /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137/AnsiballZ_ec2_eip.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137/ /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/home/spriggsj/Ansible-2.10.3/bin/python /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137/AnsiballZ_ec2_eip.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/spriggsj/.ansible/tmp/ansible-tmp-1607685762.0412364-18732-127819355277137/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => (item=demo_EIP3) => {
    "allocation_id": "eipalloc-06a0361e79c69996c",
    "ansible_loop_var": "item",
    "changed": true,
    "invocation": {
        "module_args": {
            "allow_reassociation": false,
            "aws_access_key": null,
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "device_id": "eni-0101c767b231dae60",
            "ec2_url": null,
            "in_vpc": true,
            "private_ip_address": "192.168.0.22",
            "profile": null,
            "public_ip": "54.78.131.18",
            "public_ipv4_pool": null,
            "region": "eu-west-1",
            "release_on_disassociation": false,
            "reuse_existing_ip_allowed": false,
            "security_token": null,
            "state": "present",
            "tag_name": null,
            "tag_value": null,
            "validate_certs": true,
            "wait_timeout": null
        }
    },
    "item": {
        "allocation_id": "eipalloc-06a0361e79c69996c",
        "ansible_loop_var": "item",
        "changed": true,
        "failed": false,
        "invocation": {
            "module_args": {
                "allow_reassociation": false,
                "aws_access_key": null,
                "aws_ca_bundle": null,
                "aws_config": null,
                "aws_secret_key": null,
                "debug_botocore_endpoint_logs": false,
                "device_id": null,
                "ec2_url": null,
                "in_vpc": true,
                "private_ip_address": null,
                "profile": null,
                "public_ip": null,
                "public_ipv4_pool": null,
                "region": "eu-west-1",
                "release_on_disassociation": false,
                "reuse_existing_ip_allowed": false,
                "security_token": null,
                "state": "present",
                "tag_name": null,
                "tag_value": null,
                "validate_certs": true,
                "wait_timeout": null
            }
        },
        "item": {
            "EIP_Name": "demo_EIP3",
            "interface": "eni-0101c767b231dae60",
            "private_ip": "192.168.0.22",
            "region": "eu-west-1"
        },
        "public_ip": "54.78.131.18"
    },
    "public_ip": "54.78.131.18"
}
META: ran handlers
META: ran handlers

PLAY RECAP *************************************************************************************************************************************************
localhost                  : ok=2    changed=2    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant