python - Ansible 社区.general.ssh_config : ModuleNotFoundError: No module named 'storm'

标签 python ssh pip ansible

我正在这样做:

- name: Add Bitbucket in the SSH configuration
  community.general.ssh_config:
    user: "{{ jenkins_user }}"
    host: bitbucket
    remote_user: git
    hostname: "{{ bitbucket_hostname }}"
    port: '7999'
    identity_file: "/home/{{ jenkins_user }}/.ssh/{{ ssh_private_key }}"
    state: present

我收到此错误:

amazon-ebs: TASK [Add Bitbucket in the SSH configuration] **********************************
amazon-ebs: Friday 16 April 2021  14:35:03 +0200 (0:00:00.599)       0:17:50.265 **********
amazon-ebs: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'storm'
amazon-ebs: fatal: [default]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (stormssh) on ip-172-31-4-198's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

我已经这么做了

pip install storm

community.general.ssh_config 之前执行此操作时:

- name: Install storm python package
  pip:
    name: storm

我收到此错误:

amazon-ebs: TASK [Install storm python package] ********************************************[0m[0;32m
amazon-ebs: Friday 16 April 2021 15:17:06 +0200 (0:00:00.594) 0:18:14.936 **********[0m[0;32m
amazon-ebs: fatal: [default]: FAILED! => {"changed": false, "cmd": ["/usr/bin/pip3", "install", "storm"], "msg": "stdout: Collecting storm\n Downloading storm-0.24.tar.gz (281 kB)\nRequirement already satisfied: six in /usr/lib/python3/dist-packages (from storm) (1.14.0)\nBuilding wheels for collected packages: storm\n Building wheel for storm (setup.py): started\n Building wheel for storm (setup.py): finished with status 'error'\n Running setup.py clean for storm\nFailed to build storm\nInstalling collected packages: storm\n Running setup.py install for storm: started\n Running setup.py install for storm: finished with status 'error'\n\n:stderr: ERROR: Command errored out with exit status 1:\n command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nuqyzvzg/storm/setup.py'"'"'; file='"'"'/tmp/pip-install-nuqyzvzg/storm/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/pip-wheel-isx3tjl6\n cwd: /tmp/pip-install-nuqyzvzg/storm/\n Complete output (124 lines):\n running bdist_wheel\n running build\n running build_py\n creating build\n creating build/lib.linux-x86_64-3.8\n creating build/lib.linux-x86_64-3.8/storm\n copying storm/uri.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/database.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/exceptions.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/properties.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/locals.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/references.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/wsgi.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/xid.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/testing.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/store.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/sqlobject.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/compat.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/event.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/base.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/variables.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/expr.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/tracer.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/cache.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/info.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/init.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/tz.py -> build/lib.linux-x86_64-3.8/storm\n creating build/lib.linux-x86_64-3.8/storm/twisted\n copying storm/twisted/testing.py -> build/lib.linux-x86_64-3.8/storm/twisted\n copying storm/twisted/transact.py -> build/lib.linux-x86_64-3.8/storm/twisted\n copying storm/twisted/init.py -> build/lib.linux-x86_64-3.8/storm/twisted\n creating build/lib.linux-x86_64-3.8/storm/databases\n copying storm/databases/postgres.py -> build/lib.linux-x86_64-3.8/storm/databases\n copying storm/databases/sqlite.py -> build/lib.linux-x86_64-3.8/storm/databases\n copying storm/databases/init.py -> build/lib.linux-x86_64-3.8/storm/databases\n creating build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/uri.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/database.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/properties.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/wsgi.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/helper.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/sqlobject.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/event.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/base.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/variables.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/expr.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/tracer.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/mocker.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/cache.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/info.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/init.py -> build/lib.linux-x86_64-3.8/storm/tests\n creating build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/metaconfigure.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/metadirectives.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/testing.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/adapters.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/zstorm.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/schema.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/interfaces.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/init.py -> build/lib.linux-x86_64-3.8/storm/zope\n creating build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/conf.py -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/init.py -> build/lib.linux-x86_64-3.8/storm/docs\n creating build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/schema.py -> build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/sharding.py -> build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/patch.py -> build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/init.py -> build/lib.linux-x86_64-3.8/storm/schema\n creating build/lib.linux-x86_64-3.8/storm/tests/twisted\n copying storm/tests/twisted/transact.py -> build/lib.linux-x86_64-3.8/storm/tests/twisted\n copying storm/tests/twisted/init.py -> build/lib.linux-x86_64-3.8/storm/tests/twisted\n creating build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/postgres.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/sqlite.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/proxy.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/base.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/init.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n creating build/lib.linux-x86_64-3.8/storm/tests/django\n copying storm/tests/django/init.py -> build/lib.linux-x86_64-3.8/storm/tests/django\n creating build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/block.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/postgres.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/sqlite.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/base.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/init.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n creating build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/testing.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/adapters.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/zstorm.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/init.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n creating build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/schema.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/sharding.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/patch.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/init.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n running egg_info\n writing storm.egg-info/PKG-INFO\n writing dependency_links to storm.egg-info/dependency_links.txt\n writing requirements to storm.egg-info/requires.txt\n writing top-level names to storm.egg-info/top_level.txt\n reading manifest file 'storm.egg-info/SOURCES.txt'\n reading manifest template 'MANIFEST.in'\n no previously-included directories found matching 'storm/docs/_build'\n no previously-included directories found matching 'db'\n writing manifest file 'storm.egg-info/SOURCES.txt'\n copying storm/cextensions.c -> build/lib.linux-x86_64-3.8/storm\n copying storm/zope/configure.zcml -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/meta.zcml -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/docs/Makefile -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/api.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/index.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/infoheritance.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/tutorial.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/zope.rst -> build/lib.linux-x86_64-3.8/storm/docs\n running build_ext\n building 'storm.cextensions' extension\n creating build/temp.linux-x86_64-3.8\n creating build/temp.linux-x86_64-3.8/storm\n x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c storm/cextensions.c -o build/temp.linux-x86_64-3.8/storm/cextensions.o\n storm/cextensions.c:23:10: fatal error: Python.h: No such file or directory\n 23 | #include <Python.h>\n | ^~~~~~~~~~\n compilation terminated.\n error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n ----------------------------------------\n ERROR: Failed building wheel for storm\n ERROR: Command errored out with exit status 1:\n command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nuqyzvzg/storm/setup.py'"'"'; file='"'"'/tmp/pip-install-nuqyzvzg/storm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-3pa_d1bw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/storm\n cwd: /tmp/pip-install-nuqyzvzg/storm/\n Complete output (124 lines):\n running install\n running build\n running build_py\n creating build\n creating build/lib.linux-x86_64-3.8\n creating build/lib.linux-x86_64-3.8/storm\n copying storm/uri.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/database.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/exceptions.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/properties.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/locals.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/references.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/wsgi.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/xid.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/testing.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/store.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/sqlobject.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/compat.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/event.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/base.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/variables.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/expr.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/tracer.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/cache.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/info.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/init.py -> build/lib.linux-x86_64-3.8/storm\n copying storm/tz.py -> build/lib.linux-x86_64-3.8/storm\n creating build/lib.linux-x86_64-3.8/storm/twisted\n copying storm/twisted/testing.py -> build/lib.linux-x86_64-3.8/storm/twisted\n copying storm/twisted/transact.py -> build/lib.linux-x86_64-3.8/storm/twisted\n copying storm/twisted/init.py -> build/lib.linux-x86_64-3.8/storm/twisted\n creating build/lib.linux-x86_64-3.8/storm/databases\n copying storm/databases/postgres.py -> build/lib.linux-x86_64-3.8/storm/databases\n copying storm/databases/sqlite.py -> build/lib.linux-x86_64-3.8/storm/databases\n copying storm/databases/init.py -> build/lib.linux-x86_64-3.8/storm/databases\n creating build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/uri.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/database.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/properties.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/wsgi.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/helper.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/sqlobject.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/event.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/base.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/variables.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/expr.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/tracer.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/mocker.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/cache.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/info.py -> build/lib.linux-x86_64-3.8/storm/tests\n copying storm/tests/init.py -> build/lib.linux-x86_64-3.8/storm/tests\n creating build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/metaconfigure.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/metadirectives.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/testing.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/adapters.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/zstorm.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/schema.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/interfaces.py -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/init.py -> build/lib.linux-x86_64-3.8/storm/zope\n creating build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/conf.py -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/init.py -> build/lib.linux-x86_64-3.8/storm/docs\n creating build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/schema.py -> build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/sharding.py -> build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/patch.py -> build/lib.linux-x86_64-3.8/storm/schema\n copying storm/schema/init.py -> build/lib.linux-x86_64-3.8/storm/schema\n creating build/lib.linux-x86_64-3.8/storm/tests/twisted\n copying storm/tests/twisted/transact.py -> build/lib.linux-x86_64-3.8/storm/tests/twisted\n copying storm/tests/twisted/init.py -> build/lib.linux-x86_64-3.8/storm/tests/twisted\n creating build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/postgres.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/sqlite.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/proxy.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/base.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n copying storm/tests/databases/init.py -> build/lib.linux-x86_64-3.8/storm/tests/databases\n creating build/lib.linux-x86_64-3.8/storm/tests/django\n copying storm/tests/django/init.py -> build/lib.linux-x86_64-3.8/storm/tests/django\n creating build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/block.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/postgres.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/sqlite.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/base.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n copying storm/tests/store/init.py -> build/lib.linux-x86_64-3.8/storm/tests/store\n creating build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/testing.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/adapters.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/zstorm.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n copying storm/tests/zope/init.py -> build/lib.linux-x86_64-3.8/storm/tests/zope\n creating build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/schema.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/sharding.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/patch.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n copying storm/tests/schema/init.py -> build/lib.linux-x86_64-3.8/storm/tests/schema\n running egg_info\n writing storm.egg-info/PKG-INFO\n writing dependency_links to storm.egg-info/dependency_links.txt\n writing requirements to storm.egg-info/requires.txt\n writing top-level names to storm.egg-info/top_level.txt\n reading manifest file 'storm.egg-info/SOURCES.txt'\n reading manifest template 'MANIFEST.in'\n no previously-included directories found matching 'storm/docs/_build'\n no previously-included directories found matching 'db'\n writing manifest file 'storm.egg-info/SOURCES.txt'\n copying storm/cextensions.c -> build/lib.linux-x86_64-3.8/storm\n copying storm/zope/configure.zcml -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/zope/meta.zcml -> build/lib.linux-x86_64-3.8/storm/zope\n copying storm/docs/Makefile -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/api.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/index.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/infoheritance.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/tutorial.rst -> build/lib.linux-x86_64-3.8/storm/docs\n copying storm/docs/zope.rst -> build/lib.linux-x86_64-3.8/storm/docs\n running build_ext\n building 'storm.cextensions' extension\n creating build/temp.linux-x86_64-3.8\n creating build/temp.linux-x86_64-3.8/storm\n x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c storm/cextensions.c -o build/temp.linux-x86_64-3.8/storm/cextensions.o\n storm/cextensions.c:23:10: fatal error: Python.h: No such file or directory\n 23 | #include <Python.h>\n | ^~~~~~~~~~\n compilation terminated.\n error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n ----------------------------------------\nERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nuqyzvzg/storm/setup.py'"'"'; file='"'"'/tmp/pip-install-nuqyzvzg/storm/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-3pa_d1bw/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/storm Check the logs for full command output.\n"}[0m

最佳答案

stormssh 模块需要安装在运行该模块的远程主机上,而不是安装在运行 playbook 的本地主机上。在执行 ssh_config 任务之前,您可能需要一个 ansible 任务来在目标主机上安装 stormssh

可能是这样的:

- name: Install stormssh module
  pip:
    name: stormssh

- name: Add Bitbucket in the SSH configuration
  community.general.ssh_config:
    user: "{{ jenkins_user }}"
    host: bitbucket
    remote_user: git
    hostname: "{{ bitbucket_hostname }}"
    port: '7999'
    identity_file: "/home/{{ jenkins_user }}/.ssh/{{ ssh_private_key }}"
    state: present

关于python - Ansible 社区.general.ssh_config : ModuleNotFoundError: No module named 'storm' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67125450/

相关文章:

python - 当文件太大时,Flask 会重置连接而不是返回 413

git - 从vps克隆git

git - 无法推送到远程 git 存储库

python - 无法安装 PyZMP for Python -- 依赖项

python - Pip 不会在 virtualenv 中安装包

python - 安装枕头 - 错误 : ld returned 1 - windows

python - Python中使用优先级队列实现LRU缓存

python - FFMPEG 读取输入 h264 文件的 fps 错误,导致输出文件的持续时间错误

python - Google App Engine 在 Python/Flask API 上产生 502 错误

java - 如何为 j2ssh 特立独行启用调试日志?