首页 > 解决方案 > 在本地系统上使用 unarchive 模块时出现 ansible 错误

问题描述

请。帮助我有这个剧本:

---
- name: Install service
  hosts: some_host
  vars:
    app: "{{ app_name }}-{{ tag }}.war"
    app_folder: "{{ client_dir }}/{{ app_name }}"

  tasks:
   - name: Unpack archive Java
     unarchive:
      src={{ java_distrib }}
      dest={{ app_folder }}
      creates="{{ app_folder }}/{{ java_home }}"
      mode=0555

当我在远程主机上安装时一切正常。但是当我运行 ansible-playbook 的主机是同一台机器时,我收到了这个错误:

        TASK [Unpack archive Java] *********************************************************************************************************
fatal: [10.2.9.6]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 10.2.9.6 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/stend/.ansible/tmp/ansible-tmp-1586175452.58-42679814338845/AnsiballZ_unarchive.py\", line 114, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/stend/.ansible/tmp/ansible-tmp-1586175452.58-42679814338845/AnsiballZ_unarchive.py\", line 106, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/stend/.ansible/tmp/ansible-tmp-1586175452.58-42679814338845/AnsiballZ_unarchive.py\", line 49, in invoke_module\r\n    imp.load_module('__main__', mod, module, MOD_DESC)\r\n  File \"/tmp/ansible_unarchive_payload_f_poEj/__main__.py\", line 157, in <module>\r\n  File \"/tmp/ansible_unarchive_payload_f_poEj/ansible_unarchive_payload.zip/ansible/module_utils/urls.py\", line 402, in <module>\r\nAttributeError: 'module' object has no attribute 'HTTPSConnection'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

m not understand whats going on. Why connection closed? i尝试取消归档到本地机器。我哪里错了?请帮忙!

标签: ansible

解决方案


问题解决了,我重新安装python和库libssl1.1


推荐阅读