winrm or requests is not installed: No module named winrm

2,335 views
Skip to first unread message

marcalfa1

unread,
Dec 11, 2017, 1:41:16 PM12/11/17
to Ansible Project
Has anyone properly documented the correct packages that needs to be installed to manage a windows host?

ansible 2.4.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]


WINHOST1 | FAILED! => {
    "failed": true,
    "msg": "winrm or requests is not installed: No module named winrm"
}
WINHOST2 | FAILED! => {
    "failed": true,
    "msg": "winrm or requests is not installed: No module named winrm"
}
WINHOST3 | FAILED! => {
    "failed": true,
    "msg": "winrm or requests is not installed: No module named winrm"
}
WINHOST4 | FAILED! => {
    "failed": true,
    "msg": "winrm or requests is not installed: No module named winrm"
}

[vagrant@localhost ~]$ sudo pip install paramiko PyYAML Jinja2 httplib2
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Requirement already satisfied: paramiko in /usr/lib/python2.6/site-packages
Requirement already satisfied: PyYAML in /usr/lib64/python2.6/site-packages
Requirement already satisfied: Jinja2 in /usr/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg
Requirement already satisfied: httplib2 in /usr/lib/python2.6/site-packages
Requirement already satisfied: pycrypto>=1.9 in /usr/lib64/python2.6/site-packages (from paramiko)
[vagrant@localhost ~]$ pip install "pywinrm>=0.1.1"
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting pywinrm>=0.1.1
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication)

extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a

newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents

urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see

https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Using cached pywinrm-0.2.2-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.9.1 in /usr/lib/python2.6/site-packages (from pywinrm>=0.1.1)
Requirement already satisfied: xmltodict in /usr/lib/python2.6/site-packages (from pywinrm>=0.1.1)
Requirement already satisfied: six in /usr/lib/python2.6/site-packages (from pywinrm>=0.1.1)
Collecting requests-ntlm>=0.3.0 (from pywinrm>=0.1.1)
  Using cached requests_ntlm-1.1.0-py2.py3-none-any.whl
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Collecting cryptography>=1.3 (from requests-ntlm>=0.3.0->pywinrm>=0.1.1)
  Using cached cryptography-2.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-U09GmM/cryptography/

[vagrant@localhost ~]$


[vagrant@localhost ~]$ pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting pywinrm from http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication)

extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a

newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents

urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see

https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents

urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see

https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading http://github.com/diyan/pywinrm/archive/master.zip
     / 40kB 172kB/s
Requirement already satisfied: xmltodict in /usr/lib/python2.6/site-packages (from pywinrm)
Requirement already satisfied: requests>=2.9.1 in /usr/lib/python2.6/site-packages (from pywinrm)
Collecting requests_ntlm>=0.3.0 (from pywinrm)
  Using cached requests_ntlm-1.1.0-py2.py3-none-any.whl
Requirement already satisfied: six in /usr/lib/python2.6/site-packages (from pywinrm)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm)
Collecting cryptography>=1.3 (from requests_ntlm>=0.3.0->pywinrm)
  Using cached cryptography-2.1.4.tar.gz
    Complete output from command python setup.py egg_info:
    error in cryptography setup command: Invalid environment marker: platform_python_implementation != 'PyPy'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-42Amwm/cryptography/

[vagrant@localhost ~]$ sudo pip install --upgrade setuptools
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication)

extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a

newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents

urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see

https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting setuptools
  Downloading setuptools-36.8.0-py2.py3-none-any.whl (482kB)
    100% |████████████████████████████████| 491kB 40kB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 18.0.1
    Uninstalling setuptools-18.0.1:
      Successfully uninstalled setuptools-18.0.1
Successfully installed setuptools-36.8.0
[vagrant@localhost ~]$ pip install "pywinrm>=0.1.1"
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting pywinrm>=0.1.1
  Using cached pywinrm-0.2.2-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.9.1 in /usr/lib/python2.6/site-packages (from pywinrm>=0.1.1)
Requirement already satisfied: xmltodict in /usr/lib/python2.6/site-packages (from pywinrm>=0.1.1)
Requirement already satisfied: six in /usr/lib/python2.6/site-packages (from pywinrm>=0.1.1)
Collecting requests-ntlm>=0.3.0 (from pywinrm>=0.1.1)
  Using cached requests_ntlm-1.1.0-py2.py3-none-any.whl
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib/python2.6/site-packages (from requests>=2.9.1->pywinrm>=0.1.1)
Collecting cryptography>=1.3 (from requests-ntlm>=0.3.0->pywinrm>=0.1.1)
  Using cached cryptography-2.1.4.tar.gz
Requirement already satisfied: ntlm-auth>=1.0.2 in /usr/lib/python2.6/site-packages (from requests-ntlm>=0.3.0->pywinrm>=0.1.1)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python2.6/site-packages (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm>=0.1.1)
Collecting cffi>=1.7 (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm>=0.1.1)
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication)

extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a

newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents

urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see

https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading cffi-1.11.2-cp26-cp26mu-manylinux1_x86_64.whl (405kB)
    100% |████████████████████████████████| 409kB 37kB/s
Requirement already satisfied: enum34 in /usr/lib/python2.6/site-packages (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm>=0.1.1)
Requirement already satisfied: ipaddress in /usr/lib/python2.6/site-packages (from cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm>=0.1.1)
Requirement already satisfied: ordereddict; python_version < "2.7" in /usr/lib64/python2.6/site-packages (from ntlm-auth>=1.0.2->requests-ntlm>=0.3.0->pywinrm>=0.1.1)
Collecting pycparser (from cffi>=1.7->cryptography>=1.3->requests-ntlm>=0.3.0->pywinrm>=0.1.1)
  Downloading pycparser-2.18.tar.gz (245kB)
    100% |████████████████████████████████| 256kB 42kB/s
Building wheels for collected packages: cryptography, pycparser
  Running setup.py bdist_wheel for cryptography ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zoe7X2/cryptography/setup.py';f=getattr(tokenize, 'open', open)

(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpOjty7jpip-wheel- --python-tag cp26:
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  compiling '_configtest.c':
  __thread int some_threadlocal_variable_42;
  unable to execute gcc: No such file or directory
  compiling '_configtest.c':
  int some_regular_variable_42;
  unable to execute gcc: No such file or directory

      No working compiler found, or bogus compiler options passed to
      the compiler from Python's standard "distutils" module.  See
      the error messages above.  Likely, the problem is not related
      to CFFI but generic to the setup.py of any Python package that
      tries to compile C code.  (Hints: on OS/X 10.8, for errors about
      -mno-fused-madd see http://stackoverflow.com/questions/22313407/
      Otherwise, see https://wiki.python.org/moin/CompLangPython or
      the IRC channel #python on irc.freenode.net.)
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-zoe7X2/cryptography/setup.py", line 307, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib/python2.6/site-packages/setuptools/__init__.py", line 128, in setup
      _install_setup_requires(attrs)
    File "/usr/lib/python2.6/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 453, in fetch_build_eggs
      replace_conflicting=True,
    File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 866, in resolve
      replace_conflicting=replace_conflicting
    File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 1146, in best_match
      return self.obtain(req, installer)
    File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 1158, in obtain
      return installer(requirement)
    File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 520, in fetch_build_egg
      return cmd.easy_install(req)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 672, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 698, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 879, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1118, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1106, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with 1

  ----------------------------------------
  Failed building wheel for cryptography
  Running setup.py clean for cryptography
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zoe7X2/cryptography/setup.py';f=getattr(tokenize, 'open', open)

(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  Package libffi was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libffi.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libffi' found
  compiling '_configtest.c':
  __thread int some_threadlocal_variable_42;
  unable to execute gcc: No such file or directory
  compiling '_configtest.c':
  int some_regular_variable_42;
  unable to execute gcc: No such file or directory

      No working compiler found, or bogus compiler options passed to
      the compiler from Python's standard "distutils" module.  See
      the error messages above.  Likely, the problem is not related
      to CFFI but generic to the setup.py of any Python package that
      tries to compile C code.  (Hints: on OS/X 10.8, for errors about
      -mno-fused-madd see http://stackoverflow.com/questions/22313407/
      Otherwise, see https://wiki.python.org/moin/CompLangPython or
      the IRC channel #python on irc.freenode.net.)
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-zoe7X2/cryptography/setup.py", line 307, in <module>
      **keywords_with_side_effects(sys.argv)
    File "/usr/lib/python2.6/site-packages/setuptools/__init__.py", line 128, in setup
      _install_setup_requires(attrs)
    File "/usr/lib/python2.6/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 453, in fetch_build_eggs
      replace_conflicting=True,
    File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 866, in resolve
      replace_conflicting=replace_conflicting
    File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 1146, in best_match
      return self.obtain(req, installer)
    File "/usr/lib/python2.6/site-packages/pkg_resources/__init__.py", line 1158, in obtain
      return installer(requirement)
    File "/usr/lib/python2.6/site-packages/setuptools/dist.py", line 520, in fetch_build_egg
      return cmd.easy_install(req)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 672, in easy_install
      return self.install_item(spec, dist.location, tmpdir, deps)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 698, in install_item
      dists = self.install_eggs(spec, download, tmpdir)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 879, in install_eggs
      return self.build_and_install(setup_script, setup_base)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1118, in build_and_install
      self.run_setup(setup_script, setup_base, args)
    File "/usr/lib/python2.6/site-packages/setuptools/command/easy_install.py", line 1106, in run_setup
      raise DistutilsError("Setup script exited with %s" % (v.args[0],))
  distutils.errors.DistutilsError: Setup script exited with 1

  ----------------------------------------
  Failed cleaning build dir for cryptography
  Running setup.py bdist_wheel for pycparser ... done
  Stored in directory: /home/vagrant/.cache/pip/wheels/95/14/9a/5e7b9024459d2a6600aaa64e0ba485325aff7a9ac7489db1b6
Successfully built pycparser
Failed to build cryptography
Installing collected packages: pycparser, cffi, cryptography, requests-ntlm, pywinrm
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/lib/python2.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/lib/python2.6/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/lib/python2.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/lib/python2.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python2.6/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/usr/lib/python2.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib64/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/pycparser'
[vagrant@localhost ~]$


[vagrant@localhost ~]$ sudo yum install python-requests
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.tzulo.com
 * epel: mirror.us.leaseweb.net
 * extras: reflector.westga.edu
 * updates: mirror.wdc1.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package python-requests.noarch 0:2.6.0-4.el6 will be installed
--> Processing Dependency: python-urllib3 >= 1.10.2-1 for package: python-requests-2.6.0-4.el6.noarch
--> Processing Dependency: python-chardet >= 2.2.1-1 for package: python-requests-2.6.0-4.el6.noarch
--> Running transaction check
---> Package python-chardet.noarch 0:2.2.1-1.el6 will be installed
---> Package python-urllib3.noarch 0:1.10.2-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================
 Package                               Arch                         Version                               Repository                  Size
===========================================================================================================================================
Installing:
 python-requests                       noarch                       2.6.0-4.el6                           base                        96 k
Installing for dependencies:
 python-chardet                        noarch                       2.2.1-1.el6                           base                       230 k
 python-urllib3                        noarch                       1.10.2-3.el6                          base                       103 k

Transaction Summary
===========================================================================================================================================
Install       3 Package(s)

Total download size: 429 k
Installed size: 1.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): python-chardet-2.2.1-1.el6.noarch.rpm                                                                        | 230 kB     00:00
(2/3): python-requests-2.6.0-4.el6.noarch.rpm                                                                       |  96 kB     00:00
(3/3): python-urllib3-1.10.2-3.el6.noarch.rpm                                                                       | 103 kB     00:00
-------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                      285 kB/s | 429 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : python-chardet-2.2.1-1.el6.noarch                                                                                       1/3
  Installing : python-urllib3-1.10.2-3.el6.noarch                                                                                      2/3
Error unpacking rpm package python-urllib3-1.10.2-3.el6.noarch
error: unpacking of archive failed on file /usr/lib/python2.6/site-packages/urllib3/packages/ssl_match_hostname: cpio: rename
  Installing : python-requests-2.6.0-4.el6.noarch                                                                                      3/3
  Verifying  : python-requests-2.6.0-4.el6.noarch                                                                                      1/3
  Verifying  : python-chardet-2.2.1-1.el6.noarch                                                                                       2/3
  Verifying  : python-urllib3-1.10.2-3.el6.noarch                                                                                      3/3

Installed:
  python-requests.noarch 0:2.6.0-4.el6

Dependency Installed:
  python-chardet.noarch 0:2.2.1-1.el6






Jordan Borean

unread,
Dec 11, 2017, 4:05:56 PM12/11/17
to Ansible Project
Hi

It's definitely possible to install the winrm requirements with Ansible, a few things to note regarding your outputs

* Look at upgrading your host to a new version so that it at least has Python 2.7 installed by default (2.6 is old and not supported by Python itself but it should still work)
* Instead of installing in the system Python, use a virtualenv so you don't have to play around with sudo https://docs.python.org/3/library/venv.html, really you should be doing this, it's as simple as running virtualenv ansible-venv; source ansible-venv/bin/activate
* pip install pywinrm and pip install http://github.com/diyan/pywinrm/archive/master.zip#egg=pywinrm didn't work because you pip and setuptools version is too old, run sudo pip install -U pip setuptools to make sure you are on the latest version (note you did this already but I would also try and upgrade pip at the same time)
* Finally your last error is because it needs root privileges to install the pycparser (and probably others) in the system Python packages, you would either run it with pip install --user ... or sudo pip install ..., or better yet use a venv and you won't have to worry about this issue
* Not related but it makes it a lot easier to see what commands you ran by using the code block formatting with Google Groups posts, the button with the 2 braces { } will do the highlighting for you and it is best to put each command in it's own code block

Looking at some of the warnings, it seems like SSL isn't configured correctly with the Python 2.6 install so I would really look at my first point and try a newer host, as you are using Vagrant I don't see why this should be avoided and you can potentially save yourself some more trouble down the road.

Thanks

Jordan
Reply all
Reply to author
Forward
0 new messages