ansible-collections / amazon.aws

Ansible Collection for Amazon AWS
GNU General Public License v3.0
310 stars 341 forks source link

ec2_metadata_facts: "'NoneType' object is not callable" for EL7 instances #1048

Open pfuntner opened 2 years ago

pfuntner commented 2 years ago

Summary

When I try to use the ec2_metadata_facts module against an EL7 instance such as CentOS 7, I get this an exception:

Traceback (most recent call last):
  File "<stdin>", line 107, in <module>
  File "<stdin>", line 99, in _ansiballz_main
  File "<stdin>", line 48, in invoke_module
  File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_ec2_metadata_facts_payload_7scmZE/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 598, in <module>
  File "/tmp/ansible_ec2_metadata_facts_payload_7scmZE/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 591, in main
  File "/tmp/ansible_ec2_metadata_facts_payload_7scmZE/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 568, in run
  File "/tmp/ansible_ec2_metadata_facts_payload_7scmZE/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 515, in fetch
  File "/tmp/ansible_ec2_metadata_facts_payload_7scmZE/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 521, in fetch
  File "/tmp/ansible_ec2_metadata_facts_payload_7scmZE/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 481, in _fetch
TypeError: 'NoneType' object is not callable

Issue Type

Bug Report

Component Name

ec2_metadata_facts

Ansible Version

jenkins@da845f528eb6:~$ ansible --version
ansible [core 2.13.4]
  config file = /home/jenkins/.ansible.cfg
  configured module search path = ['/home/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/jenkins/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
jenkins@da845f528eb6:~$

Collection Versions

jenkins@da845f528eb6:~$ ansible-galaxy collection list

# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    3.4.0
ansible.netcommon             3.1.1
ansible.posix                 1.4.0
ansible.utils                 2.6.1
ansible.windows               1.11.1
arista.eos                    5.0.1
awx.awx                       21.5.0
azure.azcollection            1.13.0
check_point.mgmt              2.3.0
chocolatey.chocolatey         1.3.0
cisco.aci                     2.2.0
cisco.asa                     3.1.0
cisco.dnac                    6.6.0
cisco.intersight              1.0.19
cisco.ios                     3.3.1
cisco.iosxr                   3.3.1
cisco.ise                     2.5.3
cisco.meraki                  2.11.0
cisco.mso                     2.0.0
cisco.nso                     1.0.3
cisco.nxos                    3.1.1
cisco.ucs                     1.8.0
cloud.common                  2.1.2
cloudscale_ch.cloud           2.2.2
community.aws                 3.5.0
community.azure               1.1.0
community.ciscosmb            1.0.5
community.crypto              2.5.0
community.digitalocean        1.21.0
community.dns                 2.3.2
community.docker              2.7.1
community.fortios             1.0.0
community.general             5.6.0
community.google              1.0.0
community.grafana             1.5.2
community.hashi_vault         3.2.0
community.hrobot              1.5.2
community.libvirt             1.2.0
community.mongodb             1.4.2
community.mysql               3.5.1
community.network             4.0.1
community.okd                 2.2.0
community.postgresql          2.2.0
community.proxysql            1.4.0
community.rabbitmq            1.2.2
community.routeros            2.3.0
community.sap                 1.0.0
community.sap_libs            1.3.0
community.skydive             1.0.0
community.sops                1.4.0
community.vmware              2.9.1
community.windows             1.11.0
community.zabbix              1.8.0
containers.podman             1.9.4
cyberark.conjur               1.2.0
cyberark.pas                  1.0.14
dellemc.enterprise_sonic      1.1.2
dellemc.openmanage            5.5.0
dellemc.os10                  1.1.1
dellemc.os6                   1.0.7
dellemc.os9                   1.0.4
f5networks.f5_modules         1.19.0
fortinet.fortimanager         2.1.5
fortinet.fortios              2.1.7
frr.frr                       2.0.0
gluster.gluster               1.0.2
google.cloud                  1.0.2
hetzner.hcloud                1.8.2
hpe.nimble                    1.1.4
ibm.qradar                    2.1.0
ibm.spectrum_virtualize       1.9.0
infinidat.infinibox           1.3.3
infoblox.nios_modules         1.3.0
inspur.ispim                  1.0.1
inspur.sm                     2.0.0
junipernetworks.junos         3.1.0
kubernetes.core               2.3.2
mellanox.onyx                 1.0.0
netapp.aws                    21.7.0
netapp.azure                  21.10.0
netapp.cloudmanager           21.19.0
netapp.elementsw              21.7.0
netapp.ontap                  21.23.0
netapp.storagegrid            21.11.0
netapp.um_info                21.8.0
netapp_eseries.santricity     1.3.1
netbox.netbox                 3.7.1
ngine_io.cloudstack           2.2.4
ngine_io.exoscale             1.0.0
ngine_io.vultr                1.1.2
openstack.cloud               1.9.1
openvswitch.openvswitch       2.1.0
ovirt.ovirt                   2.2.3
purestorage.flasharray        1.13.0
purestorage.flashblade        1.10.0
purestorage.fusion            1.1.0
sensu.sensu_go                1.13.1
servicenow.servicenow         1.0.6
splunk.es                     2.1.0
t_systems_mms.icinga_director 1.31.0
theforeman.foreman            3.6.0
vmware.vmware_rest            2.2.0
vultr.cloud                   1.1.0
vyos.vyos                     3.0.1
wti.remote                    1.0.4
jenkins@da845f528eb6:~$

AWS SDK versions

jenkins@da845f528eb6:~$ pip show boto boto3 botocore
WARNING: Package(s) not found: boto
Name: boto3
Version: 1.24.76
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email:
License: Apache License 2.0
Location: /usr/local/lib/python3.8/dist-packages
Requires: botocore, jmespath, s3transfer
Required-by:
---
Name: botocore
Version: 1.27.76
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email:
License: Apache License 2.0
Location: /usr/local/lib/python3.8/dist-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: awscli, boto3, s3transfer
jenkins@da845f528eb6:~$

Configuration

jenkins@da845f528eb6:~$ ansible-config dump --only-changed
CALLBACKS_ENABLED(/home/jenkins/.ansible.cfg) = ['profile_tasks']
DEFAULT_GATHER_TIMEOUT(/home/jenkins/.ansible.cfg) = 30
DEFAULT_ROLES_PATH(/home/jenkins/.ansible.cfg) = ['/home/jenkins/.ansible/roles']
DEFAULT_TIMEOUT(/home/jenkins/.ansible.cfg) = 90
HOST_KEY_CHECKING(/home/jenkins/.ansible.cfg) = False
USE_PERSISTENT_CONNECTIONS(/home/jenkins/.ansible.cfg) = True
jenkins@da845f528eb6:~$

OS / Environment

Steps to Reproduce

Playbook

- name: 'Try ec2_metadata_facts module on CentOS 7'
  hosts: all
  tasks:
    - name: "Gather AWS metadata facts to get Instance ID"
      ec2_metadata_facts:

Expected Results

The module should not throw an exception.

Actual Results

jenkins@da845f528eb6:~$ ansible-playbook -vvvv aws-facts.yml
ansible-playbook [core 2.13.4]
  config file = /home/jenkins/.ansible.cfg
  configured module search path = ['/home/jenkins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/jenkins/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/jenkins/.ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
redirecting (type: modules) ansible.builtin.ec2_metadata_facts to amazon.aws.ec2_metadata_facts
Loading collection amazon.aws from /usr/local/lib/python3.8/dist-packages/ansible_collections/amazon/aws
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.8/dist-packages/ansible/plugins/callback/default.py
redirecting (type: callback) ansible.builtin.profile_tasks to ansible.posix.profile_tasks
Loading collection ansible.posix from /usr/local/lib/python3.8/dist-packages/ansible_collections/ansible/posix
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Loading callback plugin ansible.posix.profile_tasks of type aggregate, v2.0 from /usr/local/lib/python3.8/dist-packages/ansible_collections/ansible/posix/plugins/callback/profile_tasks.py

PLAYBOOK: aws-facts.yml *********************************************************************************************************************************************************************************************************************
Positional arguments: aws-facts.yml
verbosity: 4
connection: smart
timeout: 90
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in aws-facts.yml

PLAY [Try ec2_metadata_facts module on CentOS 7] ********************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
task path: /home/jenkins/aws-facts.yml:1
Wednesday 21 September 2022  13:00:06 +0000 (0:00:00.029)       0:00:00.029 ***
<aws-centos7> Attempting python interpreter discovery
<107.21.86.7> ESTABLISH SSH CONNECTION FOR USER: centos
<107.21.86.7> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/jenkins/.ssh/pfuntner-aws.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="centos"' -o ConnectTimeout=90 -o 'ControlPath="/home/jenkins/.ansible/cp/ce7bbdef1e"' 107.21.86.7 '/bin/sh -c '"'"'echo PLATFORM; uname; echo FOUND; command -v '"'"'"'"'"'"'"'"'python3.10'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.9'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.8'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.5'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python3'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/libexec/platform-python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python'"'"'"'"'"'"'"'"'; echo ENDFOUND && sleep 0'"'"''
<107.21.86.7> (0, b'PLATFORM\nLinux\nFOUND\n/usr/libexec/platform-python\n/usr/bin/python2.7\n/usr/bin/python\n/usr/bin/python\nENDFOUND\n', b'OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /home/jenkins/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 107.21.86.7 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/jenkins/.ansible/cp/ce7bbdef1e" does not exist\r\ndebug2: ssh_connect_direct\r\ndebug1: Connecting to 107.21.86.7 [107.21.86.7] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 89992 ms remain after connect\r\ndebug1: identity file /home/jenkins/.ssh/pfuntner-aws.pem type -1\r\ndebug1: identity file /home/jenkins/.ssh/pfuntner-aws.pem-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_7.4\r\ndebug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: Authenticating to 107.21.86.7:22 as \'centos\'\r\ndebug3: hostkeys_foreach: reading file "/home/jenkins/.ssh/known_hosts"\r\ndebug3: record_hostkey: found key type ECDSA in file /home/jenkins/.ssh/known_hosts:75\r\ndebug3: load_hostkeys: loaded 1 keys from 107.21.86.7\r\ndebug3: order_hostkeyalgs: prefer hostkeyalgs: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521\r\ndebug3: send packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug3: receive packet: type 20\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: local client KEXINIT proposal\r\ndebug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c\r\ndebug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa\r\ndebug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com\r\ndebug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com\r\ndebug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: compression ctos: none,zlib@openssh.com,zlib\r\ndebug2: compression stoc: none,zlib@openssh.com,zlib\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug2: peer server KEXINIT proposal\r\ndebug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519\r\ndebug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc\r\ndebug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,cast128-cbc,3des-cbc\r\ndebug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1\r\ndebug2: compression ctos: none,zlib@openssh.com\r\ndebug2: compression stoc: none,zlib@openssh.com\r\ndebug2: languages ctos: \r\ndebug2: languages stoc: \r\ndebug2: first_kex_follows 0 \r\ndebug2: reserved 0 \r\ndebug1: kex: algorithm: curve25519-sha256\r\ndebug1: kex: host key algorithm: ecdsa-sha2-nistp256\r\ndebug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none\r\ndebug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none\r\ndebug3: send packet: type 30\r\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\r\ndebug3: receive packet: type 31\r\ndebug1: Server host key: ecdsa-sha2-nistp256 SHA256:TMw+SbH3MUNLi4d92+5SxbOwy47G+ahyu6ULNuXQYs0\r\ndebug3: hostkeys_foreach: reading file "/home/jenkins/.ssh/known_hosts"\r\ndebug3: record_hostkey: found key type ECDSA in file /home/jenkins/.ssh/known_hosts:75\r\ndebug3: load_hostkeys: loaded 1 keys from 107.21.86.7\r\ndebug1: Host \'107.21.86.7\' is known and matches the ECDSA host key.\r\ndebug1: Found key in /home/jenkins/.ssh/known_hosts:75\r\ndebug3: send packet: type 21\r\ndebug2: set_newkeys: mode 1\r\ndebug1: rekey out after 134217728 blocks\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug3: receive packet: type 21\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug2: set_newkeys: mode 0\r\ndebug1: rekey in after 134217728 blocks\r\ndebug1: Will attempt key: /home/jenkins/.ssh/pfuntner-aws.pem  explicit\r\ndebug2: pubkey_prepare: done\r\ndebug3: send packet: type 5\r\ndebug3: receive packet: type 7\r\ndebug1: SSH2_MSG_EXT_INFO received\r\ndebug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>\r\ndebug3: receive packet: type 6\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug3: send packet: type 50\r\ndebug3: receive packet: type 51\r\ndebug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic\r\ndebug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic\r\ndebug3: preferred gssapi-with-mic,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_lookup gssapi-with-mic\r\ndebug3: remaining preferred: gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_is_enabled gssapi-with-mic\r\ndebug1: Next authentication method: gssapi-with-mic\r\ndebug1: Unspecified GSS failure.  Minor code may provide more information\nNo Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)\n\n\r\ndebug1: Unspecified GSS failure.  Minor code may provide more information\nNo Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)\n\n\r\ndebug2: we did not send a packet, disable method\r\ndebug3: authmethod_lookup gssapi-keyex\r\ndebug3: remaining preferred: hostbased,publickey\r\ndebug3: authmethod_lookup publickey\r\ndebug3: remaining preferred: ,publickey\r\ndebug3: authmethod_is_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Trying private key: /home/jenkins/.ssh/pfuntner-aws.pem\r\ndebug3: sign_and_send_pubkey: RSA SHA256:l/0DNgv4i/6QVMlBJQ+IsRkPsQObhVJlcvA5U/dZ1tc\r\ndebug3: sign_and_send_pubkey: signing using rsa-sha2-512 SHA256:l/0DNgv4i/6QVMlBJQ+IsRkPsQObhVJlcvA5U/dZ1tc\r\ndebug3: send packet: type 50\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug3: receive packet: type 52\r\ndebug1: Authentication succeeded (publickey).\r\nAuthenticated to 107.21.86.7 ([107.21.86.7]:22).\r\ndebug1: setting up multiplex master socket\r\ndebug3: muxserver_listen: temporary control path /home/jenkins/.ansible/cp/ce7bbdef1e.lVgJU3fb76xVtCTp\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug3: fd 4 is O_NONBLOCK\r\ndebug1: channel 0: new [/home/jenkins/.ansible/cp/ce7bbdef1e]\r\ndebug3: muxserver_listen: mux listener channel 0 fd 4\r\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug3: ssh_packet_set_tos: set IP_TOS 0x08\r\ndebug1: control_persist_detach: backgrounding master process\r\ndebug2: control_persist_detach: background process is 615\r\ndebug2: fd 4 setting O_NONBLOCK\r\ndebug1: forking to background\r\ndebug1: Entering interactive session.\r\ndebug1: pledge: id\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug1: multiplexing control connection\r\ndebug2: fd 5 setting O_NONBLOCK\r\ndebug3: fd 5 is O_NONBLOCK\r\ndebug1: channel 1: new [mux-control]\r\ndebug3: channel_post_mux_listener: new mux channel 1 fd 5\r\ndebug3: mux_master_read_cb: channel 1: hello sent\r\ndebug2: set_control_persist_exit_time: cancel scheduled exit\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x00000001 len 4\r\ndebug2: mux_master_process_hello: channel 1 slave version 4\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000004 len 4\r\ndebug2: mux_master_process_alive_check: channel 1: alive check\r\ndebug3: mux_client_request_alive: done pid = 617\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_master_read_cb: channel 1 packet type 0x10000002 len 514\r\ndebug2: mux_master_process_new_session: channel 1: request tty 0, X 0, agent 0, subsys 0, term "xterm", cmd "/bin/sh -c \'echo PLATFORM; uname; echo FOUND; command -v \'"\'"\'python3.10\'"\'"\'; command -v \'"\'"\'python3.9\'"\'"\'; command -v \'"\'"\'python3.8\'"\'"\'; command -v \'"\'"\'python3.7\'"\'"\'; command -v \'"\'"\'python3.6\'"\'"\'; command -v \'"\'"\'python3.5\'"\'"\'; command -v \'"\'"\'/usr/bin/python3\'"\'"\'; command -v \'"\'"\'/usr/libexec/platform-python\'"\'"\'; command -v \'"\'"\'python2.7\'"\'"\'; command -v \'"\'"\'/usr/bin/python\'"\'"\'; command -v \'"\'"\'python\'"\'"\'; echo ENDFOUND && sleep 0\'", env 1\r\ndebug3: mux_master_process_new_session: got fds stdin 6, stdout 7, stderr 8\r\ndebug2: fd 7 setting O_NONBLOCK\r\ndebug2: fd 8 setting O_NONBLOCK\r\ndebug1: channel 2: new [client-session]\r\ndebug2: mux_master_process_new_session: channel_new: 2 linked to control channel 1\r\ndebug2: channel 2: send open\r\ndebug3: send packet: type 90\r\ndebug3: receive packet: type 80\r\ndebug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0\r\ndebug3: receive packet: type 91\r\ndebug2: channel_input_open_confirmation: channel 2: callback start\r\ndebug2: client_session2_setup: id 2\r\ndebug1: Sending environment.\r\ndebug1: Sending env LC_CTYPE = C.UTF-8\r\ndebug2: channel 2: request env confirm 0\r\ndebug3: send packet: type 98\r\ndebug1: Sending command: /bin/sh -c \'echo PLATFORM; uname; echo FOUND; command -v \'"\'"\'python3.10\'"\'"\'; command -v \'"\'"\'python3.9\'"\'"\'; command -v \'"\'"\'python3.8\'"\'"\'; command -v \'"\'"\'python3.7\'"\'"\'; command -v \'"\'"\'python3.6\'"\'"\'; command -v \'"\'"\'python3.5\'"\'"\'; command -v \'"\'"\'/usr/bin/python3\'"\'"\'; command -v \'"\'"\'/usr/libexec/platform-python\'"\'"\'; command -v \'"\'"\'python2.7\'"\'"\'; command -v \'"\'"\'/usr/bin/python\'"\'"\'; command -v \'"\'"\'python\'"\'"\'; echo ENDFOUND && sleep 0\'\r\ndebug2: channel 2: request exec confirm 1\r\ndebug3: send packet: type 98\r\ndebug3: mux_session_confirm: sending success reply\r\ndebug2: channel_input_open_confirmation: channel 2: callback done\r\ndebug2: channel 2: open confirm rwindow 0 rmax 32768\r\ndebug2: channel 2: rcvd adjust 2097152\r\ndebug3: receive packet: type 99\r\ndebug2: channel_input_status_confirm: type 99 id 2\r\ndebug2: exec request accepted on channel 2\r\ndebug2: channel 2: rcvd ext data 94\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\ndebug2: channel 2: written 94 to efd 8\r\ndebug3: receive packet: type 98\r\ndebug1: client_input_channel_req: channel 2 rtype exit-status reply 0\r\ndebug3: mux_exit_message: channel 2: exit message, exitval 0\r\ndebug3: receive packet: type 98\r\ndebug1: client_input_channel_req: channel 2 rtype eow@openssh.com reply 0\r\ndebug2: channel 2: rcvd eow\r\ndebug2: channel 2: chan_shutdown_read (i0 o0 sock -1 wfd 6 efd 8 [write])\r\ndebug2: channel 2: input open -> closed\r\ndebug3: receive packet: type 96\r\ndebug2: channel 2: rcvd eof\r\ndebug2: channel 2: output open -> drain\r\ndebug2: channel 2: obuf empty\r\ndebug2: channel 2: chan_shutdown_write (i3 o1 sock -1 wfd 7 efd 8 [write])\r\ndebug2: channel 2: output drain -> closed\r\ndebug3: receive packet: type 97\r\ndebug2: channel 2: rcvd close\r\ndebug3: channel 2: will not send data after close\r\ndebug2: channel 2: send close\r\ndebug3: send packet: type 97\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: gc: notify user\r\ndebug3: mux_master_session_cleanup_cb: entering for channel 2\r\ndebug2: channel 1: rcvd close\r\ndebug2: channel 1: output open -> drain\r\ndebug2: channel 1: chan_shutdown_read (i0 o1 sock 5 wfd 5 efd -1 [closed])\r\ndebug2: channel 1: input open -> closed\r\ndebug2: channel 2: gc: user detached\r\ndebug2: channel 2: is dead\r\ndebug2: channel 2: garbage collecting\r\ndebug1: channel 2: free: client-session, nchannels 3\r\ndebug3: channel 2: status: The following connections are open:\r\n  #1 mux-control (t16 nr0 i3/0 o1/16 e[closed]/0 fd 5/5/-1 sock 5 cc -1)\r\n  #2 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/8 sock -1 cc -1)\r\n\r\ndebug2: channel 1: obuf empty\r\ndebug2: channel 1: chan_shutdown_write (i3 o1 sock 5 wfd 5 efd -1 [closed])\r\ndebug2: channel 1: output drain -> closed\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: gc: notify user\r\ndebug3: mux_master_control_cleanup_cb: entering for channel 1\r\ndebug2: channel 1: gc: user detached\r\ndebug2: channel 1: is dead (local)\r\ndebug2: channel 1: garbage collecting\r\ndebug1: channel 1: free: mux-control, nchannels 2\r\ndebug3: channel 1: status: The following connections are open:\r\n  #1 mux-control (t16 nr0 i3/0 o3/0 e[closed]/0 fd 5/5/-1 sock 5 cc -1)\r\n\r\ndebug2: set_control_persist_exit_time: schedule exit in 60 seconds\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<107.21.86.7> ESTABLISH SSH CONNECTION FOR USER: centos
<107.21.86.7> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/jenkins/.ssh/pfuntner-aws.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="centos"' -o ConnectTimeout=90 -o 'ControlPath="/home/jenkins/.ansible/cp/ce7bbdef1e"' 107.21.86.7 '/bin/sh -c '"'"'/usr/libexec/platform-python && sleep 0'"'"''
<107.21.86.7> (0, b'{"osrelease_content": "NAME=\\"CentOS Linux\\"\\nVERSION=\\"7 (Core)\\"\\nID=\\"centos\\"\\nID_LIKE=\\"rhel fedora\\"\\nVERSION_ID=\\"7\\"\\nPRETTY_NAME=\\"CentOS Linux 7 (Core)\\"\\nANSI_COLOR=\\"0;31\\"\\nCPE_NAME=\\"cpe:/o:centos:centos:7\\"\\nHOME_URL=\\"https://www.centos.org/\\"\\nBUG_REPORT_URL=\\"https://bugs.centos.org/\\"\\n\\nCENTOS_MANTISBT_PROJECT=\\"CentOS-7\\"\\nCENTOS_MANTISBT_PROJECT_VERSION=\\"7\\"\\nREDHAT_SUPPORT_PRODUCT=\\"centos\\"\\nREDHAT_SUPPORT_PRODUCT_VERSION=\\"7\\"\\n\\n", "platform_dist_result": ["centos", "7.9.2009", "Core"]}\n', b'OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /home/jenkins/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 107.21.86.7 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 617\r\ndebug3: mux_client_request_session: session request sent\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/setup.py
Pipelining is enabled.
<107.21.86.7> ESTABLISH SSH CONNECTION FOR USER: centos
<107.21.86.7> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/jenkins/.ssh/pfuntner-aws.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="centos"' -o ConnectTimeout=90 -o 'ControlPath="/home/jenkins/.ansible/cp/ce7bbdef1e"' 107.21.86.7 '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<107.21.86.7> (0, b'\n{"invocation": {"module_args": {"filter": [], "gather_subset": ["all"], "fact_path": "/etc/ansible/facts.d", "gather_timeout": 30}}, "ansible_facts": {"ansible_fibre_channel_wwn": [], "module_setup": true, "ansible_distribution_version": "7.9", "ansible_board_name": "NA", "ansible_distribution_file_variety": "RedHat", "ansible_env": {"LANG": "en_US.utf8", "LC_ALL": "en_US.utf8", "SHELL": "/bin/bash", "XDG_RUNTIME_DIR": "/run/user/1000", "SHLVL": "2", "SELINUX_ROLE_REQUESTED": "", "HOME": "/home/centos", "_": "/usr/bin/python", "LC_CTYPE": "C.UTF-8", "LESSOPEN": "||/usr/bin/lesspipe.sh %s", "PWD": "/home/centos", "SELINUX_USE_CURRENT_RANGE": "", "LOGNAME": "centos", "USER": "centos", "PATH": "/usr/local/bin:/usr/bin", "SSH_CONNECTION": "64.102.189.72 33148 172.31.60.9 22", "MAIL": "/var/mail/centos", "SELINUX_LEVEL_REQUESTED": "", "XDG_SESSION_ID": "5", "SSH_CLIENT": "64.102.189.72 33148 22", "LC_MESSAGES": "en_US.utf8"}, "ansible_userspace_bits": "64", "ansible_architecture": "x86_64", "ansible_default_ipv4": {"macaddress": "12:22:91:d2:6f:03", "network": "172.31.48.0", "netmask": "255.255.240.0", "mtu": 9001, "broadcast": "172.31.63.255", "alias": "eth0", "prefix": "20", "address": "172.31.60.9", "interface": "eth0", "type": "ether", "gateway": "172.31.48.1"}, "ansible_swapfree_mb": 0, "ansible_default_ipv6": {}, "ansible_cmdline": {"LANG": "en_US.UTF-8", "console": "ttyS0", "net.ifnames": "0", "crashkernel": "auto", "BOOT_IMAGE": "/boot/vmlinuz-3.10.0-1160.el7.x86_64", "ro": true, "root": "UUID=9cff3d69-3769-4ad9-8460-9c54050583f9"}, "ansible_ssh_host_key_ed25519_public_keytype": "ssh-ed25519", "ansible_machine_id": "cc2c86fe566741e6a2ff6d399c5d5daa", "ansible_userspace_architecture": "x86_64", "ansible_product_uuid": "NA", "ansible_pkg_mgr": "yum", "ansible_distribution": "CentOS", "ansible_iscsi_iqn": "", "ansible_all_ipv6_addresses": ["fe80::1022:91ff:fed2:6f03"], "ansible_uptime_seconds": 2482, "ansible_kernel": "3.10.0-1160.el7.x86_64", "ansible_system_capabilities_enforced": "True", "ansible_python": {"executable": "/usr/bin/python", "version": {"micro": 5, "major": 2, "releaselevel": "final", "serial": 0, "minor": 7}, "type": "CPython", "has_sslcontext": true, "version_info": [2, 7, 5, "final", 0]}, "ansible_is_chroot": true, "gather_subset": ["all"], "ansible_board_asset_tag": "NA", "ansible_user_shell": "/bin/bash", "ansible_product_serial": "NA", "ansible_form_factor": "Other", "ansible_distribution_file_parsed": true, "ansible_fips": false, "ansible_user_id": "centos", "ansible_selinux_python_present": true, "ansible_board_serial": "NA", "ansible_kernel_version": "#1 SMP Mon Oct 19 16:18:59 UTC 2020", "ansible_local": {}, "ansible_processor_vcpus": 2, "ansible_processor": ["0", "GenuineIntel", "Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz", "1", "GenuineIntel", "Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz"], "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHzTqOrK9Etr9a/08vxuXN3SIbFJIp3I9+wwZD0a0ap4shnFr4gK21kLznjB5PgcyjWLtfWIfv7SrVg++ZW8fKE=", "ansible_user_gid": 1000, "ansible_system_vendor": "Xen", "ansible_swaptotal_mb": 0, "ansible_distribution_major_version": "7", "ansible_real_group_id": 1000, "ansible_lsb": {}, "ansible_machine": "x86_64", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDC7aa4rQFPO0M1cXTZxBJsr9XWzD2tkRrAVCbUIYnGKBnUwMQsyo+zmUeHSGuvx+MGfjOi9+7kS5qd3C1joVbe99g/HQhZSz5j04QsEqO0tg0djPMfQ7d4YQu13NK51Z1L++A01rLCAgJoeJIvvsRKrIPRIzmprX8anvSd0lhDuvPUuVdZzKGyyJYRLCVcYf3Rujk1kEISJ2Lid6XtNnwUVw6vjjWFirF5Za8nlF5EQARfkl544VNjn3Vhyf+Yk2Rr2sB80J0PL9b260RfY5c/nCMxrZfqhXmDXLvMeX9x+mXSonVGTszlfnlFjC/aBzQW9CSUbPO7MpgIG/4R23m3", "ansible_user_gecos": "Cloud User", "ansible_processor_threads_per_core": 1, "ansible_eth0": {"macaddress": "12:22:91:d2:6f:03", "features": {"tx_checksum_ipv4": "on [fixed]", "generic_receive_offload": "on", "tx_checksum_ipv6": "on", "tx_scatter_gather_fraglist": "off [fixed]", "rx_all": "off [fixed]", "highdma": "off [fixed]", "rx_fcs": "off [fixed]", "tx_lockless": "off [fixed]", "tx_tcp_ecn_segmentation": "off [fixed]", "rx_udp_tunnel_port_offload": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_gso_robust": "on [fixed]", "tx_ipip_segmentation": "off [fixed]", "tx_tcp_mangleid_segmentation": "off", "tx_checksumming": "on", "vlan_challenged": "off [fixed]", "loopback": "off [fixed]", "fcoe_mtu": "off [fixed]", "scatter_gather": "on", "tx_checksum_sctp": "off [fixed]", "tx_vlan_stag_hw_insert": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "tx_gso_partial": "off [fixed]", "rx_gro_hw": "off [fixed]", "rx_vlan_stag_filter": "off [fixed]", "large_receive_offload": "off [fixed]", "tx_scatter_gather": "on", "rx_checksumming": "on [fixed]", "tx_tcp_segmentation": "on", "netns_local": "off [fixed]", "busy_poll": "off [fixed]", "generic_segmentation_offload": "on", "tx_udp_tnl_segmentation": "off [fixed]", "tcp_segmentation_offload": "on", "l2_fwd_offload": "off [fixed]", "rx_vlan_offload": "off [fixed]", "ntuple_filters": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_nocache_copy": "off", "tx_udp_tnl_csum_segmentation": "off [fixed]", "udp_fragmentation_offload": "off [fixed]", "tx_sctp_segmentation": "off [fixed]", "tx_sit_segmentation": "off [fixed]", "tx_checksum_fcoe_crc": "off [fixed]", "hw_tc_offload": "off [fixed]", "tx_checksum_ip_generic": "off [fixed]", "tx_fcoe_segmentation": "off [fixed]", "rx_vlan_filter": "off [fixed]", "tx_vlan_offload": "off [fixed]", "receive_hashing": "off [fixed]", "tx_gre_segmentation": "off [fixed]"}, "pciid": "vif-0", "module": "xen_netfront", "mtu": 9001, "device": "eth0", "promisc": false, "timestamping": ["rx_software", "software"], "ipv4": {"broadcast": "172.31.63.255", "netmask": "255.255.240.0", "address": "172.31.60.9", "prefix": "20", "network": "172.31.48.0"}, "ipv6": [{"scope": "link", "prefix": "64", "address": "fe80::1022:91ff:fed2:6f03"}], "active": true, "type": "ether", "hw_timestamp_filters": []}, "ansible_system": "Linux", "ansible_processor_nproc": 2, "ansible_bios_vendor": "Xen", "ansible_all_ipv4_addresses": ["172.31.60.9"], "ansible_python_version": "2.7.5", "ansible_virtualization_tech_guest": ["xen"], "ansible_product_version": "4.2.amazon", "ansible_service_mgr": "systemd", "ansible_memory_mb": {"real": {"total": 3787, "used": 409, "free": 3378}, "swap": {"cached": 0, "total": 0, "free": 0, "used": 0}, "nocache": {"used": 240, "free": 3547}}, "ansible_user_dir": "/home/centos", "ansible_hostnqn": "", "ansible_real_user_id": 1000, "ansible_virtualization_role": "guest", "ansible_dns": {"nameservers": ["172.31.0.2"], "search": ["ec2.internal"]}, "ansible_effective_group_id": 1000, "ansible_lo": {"features": {"tx_checksum_ipv4": "off [fixed]", "generic_receive_offload": "on", "tx_checksum_ipv6": "off [fixed]", "tx_scatter_gather_fraglist": "on [fixed]", "rx_all": "off [fixed]", "highdma": "on [fixed]", "rx_fcs": "off [fixed]", "tx_lockless": "on [fixed]", "tx_tcp_ecn_segmentation": "on", "rx_udp_tunnel_port_offload": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_gso_robust": "off [fixed]", "tx_ipip_segmentation": "off [fixed]", "tx_tcp_mangleid_segmentation": "on", "tx_checksumming": "on", "vlan_challenged": "on [fixed]", "loopback": "on [fixed]", "fcoe_mtu": "off [fixed]", "scatter_gather": "on", "tx_checksum_sctp": "on [fixed]", "tx_vlan_stag_hw_insert": "off [fixed]", "rx_vlan_stag_hw_parse": "off [fixed]", "tx_gso_partial": "off [fixed]", "rx_gro_hw": "off [fixed]", "rx_vlan_stag_filter": "off [fixed]", "large_receive_offload": "off [fixed]", "tx_scatter_gather": "on [fixed]", "rx_checksumming": "on [fixed]", "tx_tcp_segmentation": "on", "netns_local": "on [fixed]", "busy_poll": "off [fixed]", "generic_segmentation_offload": "on", "tx_udp_tnl_segmentation": "off [fixed]", "tcp_segmentation_offload": "on", "l2_fwd_offload": "off [fixed]", "rx_vlan_offload": "off [fixed]", "ntuple_filters": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_nocache_copy": "off [fixed]", "tx_udp_tnl_csum_segmentation": "off [fixed]", "udp_fragmentation_offload": "on", "tx_sctp_segmentation": "on", "tx_sit_segmentation": "off [fixed]", "tx_checksum_fcoe_crc": "off [fixed]", "hw_tc_offload": "off [fixed]", "tx_checksum_ip_generic": "on [fixed]", "tx_fcoe_segmentation": "off [fixed]", "rx_vlan_filter": "off [fixed]", "tx_vlan_offload": "off [fixed]", "receive_hashing": "off [fixed]", "tx_gre_segmentation": "off [fixed]"}, "hw_timestamp_filters": [], "mtu": 65536, "device": "lo", "promisc": false, "timestamping": ["rx_software", "software"], "ipv4": {"broadcast": "", "netmask": "255.0.0.0", "address": "127.0.0.1", "prefix": "8", "network": "127.0.0.0"}, "ipv6": [{"scope": "host", "prefix": "128", "address": "::1"}], "active": true, "type": "loopback"}, "ansible_memtotal_mb": 3787, "ansible_device_links": {"masters": {}, "labels": {}, "ids": {}, "uuids": {"xvda1": ["9cff3d69-3769-4ad9-8460-9c54050583f9"]}}, "ansible_apparmor": {"status": "disabled"}, "ansible_board_vendor": "NA", "ansible_bios_date": "08/24/2006", "ansible_memfree_mb": 3378, "ansible_board_version": "NA", "ansible_chassis_vendor": "Xen", "ansible_virtualization_tech_host": [], "ansible_processor_count": 1, "ansible_hostname": "ip-172-31-60-9", "ansible_interfaces": ["lo", "eth0"], "ansible_selinux": {"status": "enabled", "policyvers": 31, "type": "targeted", "mode": "enforcing", "config_mode": "enforcing"}, "ansible_fqdn": "ip-172-31-60-9.ec2.internal", "ansible_mounts": [{"block_used": 217595, "uuid": "9cff3d69-3769-4ad9-8460-9c54050583f9", "size_total": 8578400256, "block_total": 2094336, "mount": "/", "block_available": 1876741, "size_available": 7687131136, "fstype": "xfs", "inode_total": 4193792, "options": "rw,seclabel,relatime,attr2,inode64,noquota", "device": "/dev/xvda1", "inode_used": 25614, "block_size": 4096, "inode_available": 4168178}], "ansible_ssh_host_key_rsa_public_keytype": "ssh-rsa", "ansible_nodename": "ip-172-31-60-9.ec2.internal", "ansible_domain": "ec2.internal", "ansible_distribution_file_path": "/etc/redhat-release", "ansible_virtualization_type": "xen", "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIBpS/0LwdJufk5gBH/JduuZFGOnU5VBJ8jxAk0wvQeQ6", "ansible_processor_cores": 2, "ansible_chassis_serial": "NA", "ansible_bios_version": "4.2.amazon", "ansible_date_time": {"weekday_number": "3", "iso8601_basic_short": "20220921T130009", "tz": "UTC", "weeknumber": "38", "hour": "13", "year": "2022", "epoch_int": "1663765209", "tz_offset": "+0000", "month": "09", "epoch": "1663765209", "iso8601_micro": "2022-09-21T13:00:09.600645Z", "weekday": "Wednesday", "minute": "00", "time": "13:00:09", "date": "2022-09-21", "iso8601": "2022-09-21T13:00:09Z", "tz_dst": "UTC", "day": "21", "iso8601_basic": "20220921T130009600645", "second": "09"}, "ansible_distribution_release": "Core", "ansible_os_family": "RedHat", "ansible_effective_user_id": 1000, "ansible_ssh_host_key_ecdsa_public_keytype": "ecdsa-sha2-nistp256", "ansible_product_name": "HVM domU", "ansible_devices": {"xvda": {"scheduler_mode": "deadline", "rotational": "0", "vendor": null, "sectors": "16777216", "links": {"masters": [], "labels": [], "ids": [], "uuids": []}, "sas_device_handle": null, "sas_address": null, "virtual": 1, "host": "", "sectorsize": "512", "removable": "0", "support_discard": "0", "model": null, "partitions": {"xvda1": {"sectorsize": 512, "uuid": "9cff3d69-3769-4ad9-8460-9c54050583f9", "links": {"masters": [], "labels": [], "ids": [], "uuids": ["9cff3d69-3769-4ad9-8460-9c54050583f9"]}, "sectors": "16775168", "start": "2048", "holders": [], "size": "8.00 GB"}}, "holders": [], "size": "8.00 GB"}}, "ansible_user_uid": 1000, "ansible_proc_cmdline": {"LANG": "en_US.UTF-8", "console": ["tty0", "ttyS0,115200n8", "ttyS0"], "net.ifnames": "0", "crashkernel": "auto", "BOOT_IMAGE": "/boot/vmlinuz-3.10.0-1160.el7.x86_64", "ro": true, "root": "UUID=9cff3d69-3769-4ad9-8460-9c54050583f9"}, "ansible_chassis_version": "NA", "ansible_system_capabilities": [""], "ansible_chassis_asset_tag": "NA"}}\n', b'OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /home/jenkins/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 107.21.86.7 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 617\r\ndebug3: mux_client_request_session: session request sent\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
ok: [aws-centos7]
META: ran handlers

TASK [Gather AWS metadata facts to get Instance ID] *****************************************************************************************************************************************************************************************
task path: /home/jenkins/aws-facts.yml:4
Wednesday 21 September 2022  13:00:09 +0000 (0:00:02.758)       0:00:02.788 ***
redirecting (type: modules) ansible.builtin.ec2_metadata_facts to amazon.aws.ec2_metadata_facts
redirecting (type: modules) ansible.builtin.ec2_metadata_facts to amazon.aws.ec2_metadata_facts
Using module file /usr/local/lib/python3.8/dist-packages/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py
Pipelining is enabled.
<107.21.86.7> ESTABLISH SSH CONNECTION FOR USER: centos
<107.21.86.7> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/jenkins/.ssh/pfuntner-aws.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="centos"' -o ConnectTimeout=90 -o 'ControlPath="/home/jenkins/.ansible/cp/ce7bbdef1e"' 107.21.86.7 '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<107.21.86.7> (1, b'', b'OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /home/jenkins/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 107.21.86.7 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 617\r\ndebug3: mux_client_request_session: session request sent\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\nTraceback (most recent call last):\n  File "<stdin>", line 107, in <module>\n  File "<stdin>", line 99, in _ansiballz_main\n  File "<stdin>", line 48, in invoke_module\n  File "/usr/lib64/python2.7/runpy.py", line 176, in run_module\n    fname, loader, pkg_name)\n  File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code\n    mod_name, mod_fname, mod_loader, pkg_name)\n  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code\n    exec code in run_globals\n  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 598, in <module>\n  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 591, in main\n  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 568, in run\n  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 515, in fetch\n  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 521, in fetch\n  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 481, in _fetch\nTypeError: \'NoneType\' object is not callable\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n')
<107.21.86.7> Failed to connect to the host via ssh: OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/jenkins/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 107.21.86.7 is address
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 617
debug3: mux_client_request_session: session request sent
/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)
Traceback (most recent call last):
  File "<stdin>", line 107, in <module>
  File "<stdin>", line 99, in _ansiballz_main
  File "<stdin>", line 48, in invoke_module
  File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 598, in <module>
  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 591, in main
  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 568, in run
  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 515, in fetch
  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 521, in fetch
  File "/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py", line 481, in _fetch
TypeError: 'NoneType' object is not callable
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
fatal: [aws-centos7]: FAILED! => {
    "changed": false,
    "module_stderr": "OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f  31 Mar 2020\r\ndebug1: Reading configuration data /home/jenkins/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 107.21.86.7 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 617\r\ndebug3: mux_client_request_session: session request sent\r\n/etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (C.UTF-8)\nTraceback (most recent call last):\n  File \"<stdin>\", line 107, in <module>\n  File \"<stdin>\", line 99, in _ansiballz_main\n  File \"<stdin>\", line 48, in invoke_module\n  File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n    fname, loader, pkg_name)\n  File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\n    mod_name, mod_fname, mod_loader, pkg_name)\n  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py\", line 598, in <module>\n  File \"/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py\", line 591, in main\n  File \"/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py\", line 568, in run\n  File \"/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py\", line 515, in fetch\n  File \"/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py\", line 521, in fetch\n  File \"/tmp/ansible_ec2_metadata_facts_payload_J23767/ansible_ec2_metadata_facts_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_metadata_facts.py\", line 481, in _fetch\nTypeError: 'NoneType' object is not callable\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
aws-centos7                : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Wednesday 21 September 2022  13:00:10 +0000 (0:00:00.647)       0:00:03.435 ***
===============================================================================
Gathering Facts ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.76s
/home/jenkins/aws-facts.yml:1 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Gather AWS metadata facts to get Instance ID ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0.65s
/home/jenkins/aws-facts.yml:4 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jenkins@da845f528eb6:~$

Code of Conduct

ansibullbot commented 2 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 2 years ago

cc @jillr @roadmapper @s-hertel @silviud @tremble click here for bot help

pfuntner commented 2 years ago

I believe Ansible is installed in the container with:

pip install ansible==6.4.0 ansible-core==2.13.4

I upgraded amazon.aws but it didn't help:

jenkins@da845f528eb6:~$ ansible-galaxy collection install amazon.aws
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/amazon-aws-4.2.0.tar.gz to /home/jenkins/.ansible/tmp/ansible-local-719yuij_o2r/tmp0nzcvmaf/amazon-aws-4.2.0-_fj1uw6f
Installing 'amazon.aws:4.2.0' to '/home/jenkins/.ansible/collections/ansible_collections/amazon/aws'
amazon.aws:4.2.0 was installed successfully
jenkins@da845f528eb6:~$
pfuntner commented 2 years ago

I noticed that the target is running Python 2.7 so I did the following:

  1. Installed Python 3
  2. Replaced the /usr/bin/python symlink to point to Python 3
  3. Ran the playbook
  4. Observed the module was successful!

So it appears the module is having trouble with Python 2.

madrover commented 2 years ago

Same behavior has been observed on Centos 7 as well. This is my fix:

    - name: Ensure python3 is installed
      ansible.builtin.yum:
        name: python3
        state: present

    - name: Get instance ec2 facts
      ec2_metadata_facts:
      vars:
        ansible_python_interpreter: python3
gravesm commented 2 years ago

@pfuntner @madrover I believe https://github.com/ansible-collections/amazon.aws/pull/943 may fix this. It has been backported to both 3.x and 4.x but neither have a new release, yet. 5.0.0 was just released today, however.