Link to home
Start Free TrialLog in
Avatar of ittechlab
ittechlabFlag for Canada

asked on

Library issue - python

This mean the host you are running does not have the necessary Python library to run the nmcli module. Please open a new question for the library issue
Avatar of noci
noci

This mean the host you are running does not have the necessary Python library to run the nmcli module. Please open a new question for the library issue
And the error message was?

From a previous Q: https://www.experts-exchange.com/questions/29167865/Ansible-playbook-to-update-the-ip-address.html
You probably mean this:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: Namespace NMClient not available
fatal: [web03.cioft.com]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (NetworkManager glib API) on web03's Python /usr/bin/python. Please read module documentation and install in the appropriate location"}

There is a Hint in this error message:
Run ansible with -vvv which will show more info,
And the other one:  on web03 server python is missing some networkmanager / glib library.

So there is a prerequisite that you need to ensure to use some settings from ansible.
(Ansible is written in python).
Avatar of ittechlab

ASKER

[root@ansible playbooks]# ansible-playbook -vvv network.yml
ansible-playbook 2.8.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin

PLAYBOOK: network.yml ******************************************************************************************************************************************************
1 plays in network.yml

PLAY [webservers] **********************************************************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************************************************
task path: /opt/playbooks/network.yml:1
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<web03.cioft.com> (0, '/root\n', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870 `" && echo ansible-tmp-1577198013.36-159508396163870="` echo /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870 `" ) && sleep 0'"'"''
<web03.cioft.com> (0, 'ansible-tmp-1577198013.36-159508396163870=/root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870\n', '')
<web03.cioft.com> Attempting python interpreter discovery
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'echo PLATFORM; uname; echo FOUND; command -v '"'"'"'"'"'"'"'"'/usr/bin/python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.5'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/libexec/platform-python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python3'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python'"'"'"'"'"'"'"'"'; echo ENDFOUND && sleep 0'"'"''
<web03.cioft.com> (0, 'PLATFORM\nLinux\nFOUND\n/usr/bin/python\n/usr/bin/python2.7\n/usr/bin/python\nENDFOUND\n', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<web03.cioft.com> (0, '{"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.4.1708", "Core"]}\n', '')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<web03.cioft.com> PUT /root/.ansible/tmp/ansible-local-278919IbQZH/tmpN64oAq TO /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870/AnsiballZ_setup.py
<web03.cioft.com> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 '[web03.cioft.com]'
<web03.cioft.com> (0, 'sftp> put /root/.ansible/tmp/ansible-local-278919IbQZH/tmpN64oAq /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870/AnsiballZ_setup.py\n', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870/ /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870/AnsiballZ_setup.py && sleep 0'"'"''
<web03.cioft.com> (0, '', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 -tt web03.cioft.com '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870/AnsiballZ_setup.py && sleep 0'"'"''
<web03.cioft.com> (0, '\r\n{"invocation": {"module_args": {"filter": "*", "gather_subset": ["all"], "fact_path": "/etc/ansible/facts.d", "gather_timeout": 10}}, "ansible_facts": {"ansible_fibre_channel_wwn": [], "module_setup": true, "ansible_distribution_version": "7.4", "ansible_distribution_file_variety": "RedHat", "ansible_env": {"LANG": "en_US.UTF-8", "TERM": "xterm", "SHELL": "/bin/bash", "XDG_RUNTIME_DIR": "/run/user/0", "SHLVL": "2", "SSH_TTY": "/dev/pts/0", "_": "/usr/bin/python", "LESSOPEN": "||/usr/bin/lesspipe.sh %s", "PWD": "/root", "SELINUX_LEVEL_REQUESTED": "", "PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin", "SELINUX_ROLE_REQUESTED": "", "SELINUX_USE_CURRENT_RANGE": "", "LOGNAME": "root", "USER": "root", "HOME": "/root", "MAIL": "/var/mail/root", "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:", "XDG_SESSION_ID": "76", "SSH_CLIENT": "192.168.2.147 45298 22", "SSH_CONNECTION": "192.168.2.147 45298 192.168.2.152 22"}, "ansible_userspace_bits": "64", "ansible_architecture": "x86_64", "ansible_default_ipv4": {"macaddress": "00:0c:29:9d:fa:33", "network": "192.168.2.0", "mtu": 1500, "broadcast": "192.168.2.255", "alias": "ens160", "netmask": "255.255.255.0", "address": "192.168.2.152", "interface": "ens160", "type": "ether", "gateway": "192.168.2.1"}, "ansible_swapfree_mb": 1639, "ansible_default_ipv6": {}, "ansible_cmdline": {"LANG": "en_US.UTF-8", "BOOT_IMAGE": "/vmlinuz-3.10.0-693.el7.x86_64", "quiet": true, "rhgb": true, "rd.lvm.lv": "centos_ansible/swap", "crashkernel": "auto", "ro": true, "root": "/dev/mapper/centos_ansible-root"}, "ansible_machine_id": "9396f772b28d464193a4ba20bbd4d738", "ansible_userspace_architecture": "x86_64", "ansible_product_uuid": "564DA022-068F-42E3-6057-8BE1A29DFA33", "ansible_pkg_mgr": "yum", "ansible_distribution": "CentOS", "ansible_iscsi_iqn": "", "ansible_all_ipv6_addresses": ["fe80::20c:29ff:fe9d:fa33"], "ansible_uptime_seconds": 229293, "ansible_kernel": "3.10.0-693.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": false, "ansible_hostnqn": "", "ansible_user_shell": "/bin/bash", "ansible_product_serial": "VMware-56 4d a0 22 06 8f 42 e3-60 57 8b e1 a2 9d fa 33", "ansible_form_factor": "Other", "ansible_distribution_file_parsed": true, "ansible_fips": false, "ansible_user_id": "root", "ansible_selinux_python_present": true, "ansible_local": {}, "ansible_processor_vcpus": 1, "ansible_processor": ["0", "GenuineIntel", "Intel(R) Xeon(R) CPU           X5680  @ 3.33GHz"], "ansible_ssh_host_key_ecdsa_public": "AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJiw5fymJo4Q+so3BQ+qjj1CMc1AR2fTBcN+H4i1ylwLtT80DszbvW3Xt1GiFv/QiMLgtRRxXqqquZKgygEKXj4=", "ansible_user_gid": 0, "ansible_system_vendor": "VMware, Inc.", "ansible_swaptotal_mb": 1639, "ansible_distribution_major_version": "7", "ansible_real_group_id": 0, "ansible_lsb": {}, "ansible_machine": "x86_64", "ansible_ssh_host_key_rsa_public": "AAAAB3NzaC1yc2EAAAADAQABAAABAQDrgIlUCfuyU/3CA3tUhhNJ63tHXtU2lfDhRInVDFH1a69Ugfwk2om8plw8NTbSC2LnCUkzYAjFT4DJxa789JRESkvL6po7VKuohRDntD2beCaTN/LK3lW07/NJqnNsPHZ5zRyPvR4nto5AlOwk3rZZQ4lh+2RsrlcgT1hw9SRzMPgUyvZIP50xTmrrH8QT5tcOUL5szFmMZ3PjTTV0dR8inNLP3KRWsOSiFuuCE1vHSLtC/056R87hKz85h+3YkZ1tkHD/nC5eD+BkGNUfMcLp4sIPNdWmfkWKFYGarHe0YaHeCJRK2kzA12ncBiS5oINrHY7XDIg3QVv8WKh4TUBl", "ansible_user_gecos": "root", "ansible_processor_threads_per_core": 1, "ansible_product_name": "VMware Virtual Platform", "ansible_all_ipv4_addresses": ["192.168.2.152"], "ansible_python_version": "2.7.5", "ansible_product_version": "None", "ansible_service_mgr": "systemd", "ansible_memory_mb": {"real": {"total": 1839, "used": 283, "free": 1556}, "swap": {"cached": 0, "total": 1639, "free": 1639, "used": 0}, "nocache": {"used": 164, "free": 1675}}, "ansible_user_dir": "/root", "gather_subset": ["all"], "ansible_real_user_id": 0, "ansible_virtualization_role": "guest", "ansible_dns": {"nameservers": ["192.168.2.187"]}, "ansible_effective_group_id": 0, "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", "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_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_mpls_segmentation": "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": "host", "netmask": "255.0.0.0", "network": "127.0.0.0", "address": "127.0.0.1"}, "ipv6": [{"scope": "host", "prefix": "128", "address": "::1"}], "active": true, "type": "loopback"}, "ansible_memtotal_mb": 1839, "ansible_device_links": {"masters": {"sda2": ["dm-0", "dm-1"]}, "labels": {}, "ids": {"sr0": ["ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001"], "sda2": ["lvm-pv-uuid-L5jdKu-sbC7-CCmc-3jmK-4Fa9-nYAe-7lrcvg"], "dm-0": ["dm-name-centos_ansible-root", "dm-uuid-LVM-rJr0R5SsP402Hxt386AScRO85WiB2Sz2RVwGXQrWs3FWlOCmYAfKgTHKs3nwUCFq"], "dm-1": ["dm-name-centos_ansible-swap", "dm-uuid-LVM-rJr0R5SsP402Hxt386AScRO85WiB2Sz2b34J8gsavo0hNKvFcynpW7bnbXjBdIDc"]}, "uuids": {"sda1": ["74a7d310-8355-43bf-a4c1-f73d4b6cbeb2"], "dm-0": ["1ee81761-186d-4ab6-b422-f803a00e2e13"], "dm-1": ["9389f98b-1fa2-4ca2-94d1-ce23750aef66"]}}, "ansible_apparmor": {"status": "disabled"}, "ansible_proc_cmdline": {"LANG": "en_US.UTF-8", "BOOT_IMAGE": "/vmlinuz-3.10.0-693.el7.x86_64", "quiet": true, "rhgb": true, "rd.lvm.lv": ["centos_ansible/root", "centos_ansible/swap"], "crashkernel": "auto", "ro": true, "root": "/dev/mapper/centos_ansible-root"}, "ansible_memfree_mb": 1556, "ansible_processor_count": 1, "ansible_hostname": "web03", "ansible_interfaces": ["ens160", "lo"], "ansible_selinux": {"status": "enabled", "policyvers": 28, "type": "targeted", "mode": "enforcing", "config_mode": "enforcing"}, "ansible_fqdn": "web03", "ansible_mounts": [{"block_used": 36430, "uuid": "74a7d310-8355-43bf-a4c1-f73d4b6cbeb2", "size_total": 1063256064, "block_total": 259584, "mount": "/boot", "block_available": 223154, "size_available": 914038784, "fstype": "xfs", "inode_total": 524288, "options": "rw,seclabel,relatime,attr2,inode64,noquota", "device": "/dev/sda1", "inode_used": 328, "block_size": 4096, "inode_available": 523960}, {"block_used": 229985, "uuid": "1ee81761-186d-4ab6-b422-f803a00e2e13", "size_total": 14371782656, "block_total": 3508736, "mount": "/", "block_available": 3278751, "size_available": 13429764096, "fstype": "xfs", "inode_total": 7022592, "options": "rw,seclabel,relatime,attr2,inode64,noquota", "device": "/dev/mapper/centos_ansible-root", "inode_used": 25749, "block_size": 4096, "inode_available": 6996843}], "ansible_nodename": "web03", "ansible_lvm": {"pvs": {"/dev/sda2": {"free_g": "0", "size_g": "15.00", "vg": "centos_ansible"}}, "lvs": {"root": {"size_g": "13.39", "vg": "centos_ansible"}, "swap": {"size_g": "1.60", "vg": "centos_ansible"}}, "vgs": {"centos_ansible": {"free_g": "0", "size_g": "15.00", "num_lvs": "2", "num_pvs": "1"}}}, "ansible_domain": "", "ansible_distribution_file_path": "/etc/redhat-release", "ansible_virtualization_type": "VMware", "ansible_ssh_host_key_ed25519_public": "AAAAC3NzaC1lZDI1NTE5AAAAIAQFTsHfUEuh77loD3TapmiLySCjgFtZSwSiHRol/sAi", "ansible_processor_cores": 1, "ansible_bios_version": "6.00", "ansible_date_time": {"weekday_number": "2", "iso8601_basic_short": "20191224T093334", "tz": "EST", "weeknumber": "51", "hour": "09", "year": "2019", "minute": "33", "tz_offset": "-0500", "month": "12", "epoch": "1577198014", "iso8601_micro": "2019-12-24T14:33:34.804710Z", "weekday": "Tuesday", "time": "09:33:34", "date": "2019-12-24", "iso8601": "2019-12-24T14:33:34Z", "day": "24", "iso8601_basic": "20191224T093334804617", "second": "34"}, "ansible_distribution_release": "Core", "ansible_os_family": "RedHat", "ansible_effective_user_id": 0, "ansible_system": "Linux", "ansible_devices": {"fd0": {"scheduler_mode": "deadline", "rotational": "1", "vendor": null, "sectors": "8", "links": {"masters": [], "labels": [], "ids": [], "uuids": []}, "sas_device_handle": null, "sas_address": null, "virtual": 1, "host": "", "sectorsize": "512", "removable": "1", "support_discard": "0", "model": null, "partitions": {}, "holders": [], "size": "4.00 KB"}, "sr0": {"scheduler_mode": "cfq", "rotational": "1", "vendor": "NECVMWar", "sectors": "2097151", "links": {"masters": [], "labels": [], "ids": ["ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001"], "uuids": []}, "sas_device_handle": null, "sas_address": null, "virtual": 1, "host": "", "sectorsize": "512", "removable": "1", "support_discard": "0", "model": "VMware IDE CDR10", "partitions": {}, "holders": [], "size": "1024.00 MB"}, "sda": {"scheduler_mode": "deadline", "rotational": "1", "vendor": "VMware", "sectors": "33554432", "links": {"masters": [], "labels": [], "ids": [], "uuids": []}, "sas_device_handle": null, "sas_address": null, "virtual": 1, "host": "", "sectorsize": "512", "removable": "0", "support_discard": "0", "model": "Virtual disk", "partitions": {"sda2": {"sectorsize": 512, "uuid": null, "links": {"masters": ["dm-0", "dm-1"], "labels": [], "ids": ["lvm-pv-uuid-L5jdKu-sbC7-CCmc-3jmK-4Fa9-nYAe-7lrcvg"], "uuids": []}, "sectors": "31455232", "start": "2099200", "holders": ["centos_ansible-root", "centos_ansible-swap"], "size": "15.00 GB"}, "sda1": {"sectorsize": 512, "uuid": "74a7d310-8355-43bf-a4c1-f73d4b6cbeb2", "links": {"masters": [], "labels": [], "ids": [], "uuids": ["74a7d310-8355-43bf-a4c1-f73d4b6cbeb2"]}, "sectors": "2097152", "start": "2048", "holders": [], "size": "1.00 GB"}}, "holders": [], "size": "16.00 GB"}, "dm-0": {"scheduler_mode": "", "rotational": "1", "vendor": null, "sectors": "28090368", "links": {"masters": [], "labels": [], "ids": ["dm-name-centos_ansible-root", "dm-uuid-LVM-rJr0R5SsP402Hxt386AScRO85WiB2Sz2RVwGXQrWs3FWlOCmYAfKgTHKs3nwUCFq"], "uuids": ["1ee81761-186d-4ab6-b422-f803a00e2e13"]}, "sas_device_handle": null, "sas_address": null, "virtual": 1, "host": "", "sectorsize": "512", "removable": "0", "support_discard": "0", "model": null, "partitions": {}, "holders": [], "size": "13.39 GB"}, "dm-1": {"scheduler_mode": "", "rotational": "1", "vendor": null, "sectors": "3358720", "links": {"masters": [], "labels": [], "ids": ["dm-name-centos_ansible-swap", "dm-uuid-LVM-rJr0R5SsP402Hxt386AScRO85WiB2Sz2b34J8gsavo0hNKvFcynpW7bnbXjBdIDc"], "uuids": ["9389f98b-1fa2-4ca2-94d1-ce23750aef66"]}, "sas_device_handle": null, "sas_address": null, "virtual": 1, "host": "", "sectorsize": "512", "removable": "0", "support_discard": "0", "model": null, "partitions": {}, "holders": [], "size": "1.60 GB"}}, "ansible_user_uid": 0, "ansible_bios_date": "09/30/2014", "ansible_system_capabilities": ["cap_chown", "cap_dac_override", "cap_dac_read_search", "cap_fowner", "cap_fsetid", "cap_kill", "cap_setgid", "cap_setuid", "cap_setpcap", "cap_linux_immutable", "cap_net_bind_service", "cap_net_broadcast", "cap_net_admin", "cap_net_raw", "cap_ipc_lock", "cap_ipc_owner", "cap_sys_module", "cap_sys_rawio", "cap_sys_chroot", "cap_sys_ptrace", "cap_sys_pacct", "cap_sys_admin", "cap_sys_boot", "cap_sys_nice", "cap_sys_resource", "cap_sys_time", "cap_sys_tty_config", "cap_mknod", "cap_lease", "cap_audit_write", "cap_audit_control", "cap_setfcap", "cap_mac_override", "cap_mac_admin", "cap_syslog", "35", "36+ep"], "ansible_ens160": {"macaddress": "00:0c:29:9d:fa:33", "features": {"tx_checksum_ipv4": "off [fixed]", "generic_receive_offload": "on", "tx_checksum_ipv6": "off [fixed]", "tx_scatter_gather_fraglist": "off [fixed]", "rx_all": "off [fixed]", "highdma": "on", "rx_fcs": "off [fixed]", "tx_lockless": "off [fixed]", "tx_tcp_ecn_segmentation": "off [fixed]", "tx_tcp6_segmentation": "on", "tx_gso_robust": "off [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_vlan_stag_filter": "off [fixed]", "large_receive_offload": "on", "tx_scatter_gather": "on", "rx_checksumming": "on", "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": "on", "ntuple_filters": "off [fixed]", "tx_gre_csum_segmentation": "off [fixed]", "tx_nocache_copy": "off", "tx_mpls_segmentation": "off [fixed]", "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": "on", "tx_fcoe_segmentation": "off [fixed]", "rx_vlan_filter": "on [fixed]", "tx_vlan_offload": "on", "receive_hashing": "off [fixed]", "tx_gre_segmentation": "off [fixed]"}, "type": "ether", "pciid": "0000:03:00.0", "module": "vmxnet3", "mtu": 1500, "device": "ens160", "promisc": false, "timestamping": ["rx_software", "software"], "ipv4": {"broadcast": "192.168.2.255", "netmask": "255.255.255.0", "network": "192.168.2.0", "address": "192.168.2.152"}, "ipv6": [{"scope": "link", "prefix": "64", "address": "fe80::20c:29ff:fe9d:fa33"}], "active": true, "speed": 10000, "hw_timestamp_filters": []}}}\r\n', 'Shared connection to web03.cioft.com closed.\r\n')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'rm -f -r /root/.ansible/tmp/ansible-tmp-1577198013.36-159508396163870/ > /dev/null 2>&1 && sleep 0'"'"''
<web03.cioft.com> (0, '', '')
ok: [web03.cioft.com]
META: ran handlers

TASK [IP configuration] ****************************************************************************************************************************************************
task path: /opt/playbooks/network.yml:3
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<web03.cioft.com> (0, '/root\n', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352 `" && echo ansible-tmp-1577198014.95-219416752956352="` echo /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352 `" ) && sleep 0'"'"''
<web03.cioft.com> (0, 'ansible-tmp-1577198014.95-219416752956352=/root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352\n', '')
Using module file /usr/lib/python2.7/site-packages/ansible/modules/net_tools/nmcli.py
<web03.cioft.com> PUT /root/.ansible/tmp/ansible-local-278919IbQZH/tmp_mJMib TO /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352/AnsiballZ_nmcli.py
<web03.cioft.com> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 '[web03.cioft.com]'
<web03.cioft.com> (0, 'sftp> put /root/.ansible/tmp/ansible-local-278919IbQZH/tmp_mJMib /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352/AnsiballZ_nmcli.py\n', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352/ /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352/AnsiballZ_nmcli.py && sleep 0'"'"''
<web03.cioft.com> (0, '', '')
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 -tt web03.cioft.com '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352/AnsiballZ_nmcli.py && sleep 0'"'"''
<web03.cioft.com> (1, '\r\n{"msg": "Failed to import the required Python library (NetworkManager glib API) on web03\'s Python /usr/bin/python. Please read module documentation and install in the appropriate location", "failed": true, "exception": "Traceback (most recent call last):\\n  File \\"/tmp/ansible_nmcli_payload_eUKo9B/__main__.py\\", line 568, in <module>\\n    gi.require_version(\'NMClient\', \'1.0\')\\n  File \\"/usr/lib64/python2.7/site-packages/gi/__init__.py\\", line 99, in require_version\\n    raise ValueError(\'Namespace %s not available\' % namespace)\\nValueError: Namespace NMClient not available\\n", "invocation": {"module_args": {"conn_name": "my-eth1", "ingress": null, "ip_tunnel_local": null, "slavepriority": 32, "vxlan_id": null, "path_cost": 100, "vlandev": null, "forwarddelay": 15, "primary": null, "hairpin": true, "egress": null, "ageingtime": 300, "mtu": null, "vxlan_remote": null, "dns4_search": null, "hellotime": 2, "dhcp_client_id": null, "maxage": 20, "vlanid": null, "priority": 128, "gw4": "192.168.2.1", "state": "present", "gw6": null, "master": null, "stp": true, "ifname": "ens160", "type": "ethernet", "miimon": null, "ip_tunnel_remote": null, "vxlan_local": null, "mac": null, "ip6": null, "ip_tunnel_dev": null, "ip4": "192.168.2.153/24", "arp_ip_target": null, "downdelay": null, "autoconnect": true, "dns6_search": null, "dns6": null, "dns4": null, "arp_interval": null, "flags": null, "mode": "balance-rr", "updelay": null}}}\r\n', 'Shared connection to web03.cioft.com closed.\r\n')
<web03.cioft.com> Failed to connect to the host via ssh: Shared connection to web03.cioft.com closed.
<web03.cioft.com> ESTABLISH SSH CONNECTION FOR USER: None
<web03.cioft.com> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/a4e4c77fb9 web03.cioft.com '/bin/sh -c '"'"'rm -f -r /root/.ansible/tmp/ansible-tmp-1577198014.95-219416752956352/ > /dev/null 2>&1 && sleep 0'"'"''
<web03.cioft.com> (0, '', '')
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_nmcli_payload_eUKo9B/__main__.py", line 568, in <module>
    gi.require_version('NMClient', '1.0')
  File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 99, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace NMClient not available

fatal: [web03.cioft.com]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "ageingtime": 300,
            "arp_interval": null,
            "arp_ip_target": null,
            "autoconnect": true,
            "conn_name": "my-eth1",
            "dhcp_client_id": null,
            "dns4": null,
            "dns4_search": null,
            "dns6": null,
            "dns6_search": null,
            "downdelay": null,
            "egress": null,
            "flags": null,
            "forwarddelay": 15,
            "gw4": "192.168.2.1",
            "gw6": null,
            "hairpin": true,
            "hellotime": 2,
            "ifname": "ens160",
            "ingress": null,
            "ip4": "192.168.2.153/24",
            "ip6": null,
            "ip_tunnel_dev": null,
            "ip_tunnel_local": null,
            "ip_tunnel_remote": null,
            "mac": null,
            "master": null,
            "maxage": 20,
            "miimon": null,
            "mode": "balance-rr",
            "mtu": null,
            "path_cost": 100,
            "primary": null,
            "priority": 128,
            "slavepriority": 32,
            "state": "present",
            "stp": true,
            "type": "ethernet",
            "updelay": null,
            "vlandev": null,
            "vlanid": null,
            "vxlan_id": null,
            "vxlan_local": null,
            "vxlan_remote": null
        }
    },
    "msg": "Failed to import the required Python library (NetworkManager glib API) on web03's Python /usr/bin/python. Please read module documentation and install in the appropriate location"
}

PLAY RECAP *****************************************************************************************************************************************************************
web03.cioft.com            : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
Fromthe previous answer you apparantly missed this part:
And the other one:  on web03 server python is missing some networkmanager / glib library.

So there is a prerequisite that you need to ensure to use some settings from ansible.
(Ansible is written in python).

Did you install the  networkmanager? and other prerequisites?...
It needs to be present to configure web03.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.