Fabric 需要提示输入连接或sudo密码(主机:10.10.1.10),但提示时中止设置为True';,)

Fabric 需要提示输入连接或sudo密码(主机:10.10.1.10),但提示时中止设置为True';,),fabric,cloudify,Fabric,Cloudify,我正在尝试使用cloudify fabric插件来运行一个简单的命令。当我安装蓝图时,我得到以下错误 Task failed 'fabric_plugin.tasks.run_commands' -> RecoverableError('FabricTaskError: Needed to prompt for a connection or sudo password (host: 10.10.1.10), but abort-on-prompts was set to True',)

我正在尝试使用cloudify fabric插件来运行一个简单的命令。当我安装蓝图时,我得到以下错误

Task failed 'fabric_plugin.tasks.run_commands' -> RecoverableError('FabricTaskError: Needed to prompt for a connection or sudo password (host: 10.10.1.10), but abort-on-prompts was set to True',)
下面是我的整个蓝图文件

tosca_definitions_version: cloudify_dsl_1_0

imports:  
  - http://www.getcloudify.org/spec/cloudify/3.2/types.yaml
  - http://www.getcloudify.org/spec/fabric-plugin/1.2/plugin.yaml

inputs:

  host_ip:
      description: >
        The ip of the host the application will be deployed on

  agent_user:
      description: >
        Agent User.

  agent_private_key_path:
      description: >
        agent key path        

node_templates:

  host:
      type: cloudify.nodes.Compute
      properties:
        ip: { get_input: host_ip }
        install_agent:
          default: false
        cloudify_agent:
          user: { get_input: agent_user }
          key: { get_input: agent_private_key_path }

  example_node:
    type: cloudify.nodes.WebServer
    interfaces:
      cloudify.interfaces.lifecycle:
          start:
            implementation: fabric.fabric_plugin.tasks.run_commands
            inputs:
              commands:
                - ls -lh > ~/list-of-files.txt
    relationships:
    - type: cloudify.relationships.contained_in
      target: host
我的朋友yaml是

agent_private_key_path: /root/.ssh/id_rsa
agent_user: vagrant
host_ip: 10.10.1.10
当我更新我的蓝图以使用以下内容时,它就起作用了。但这有必要吗?我的意思是主机中已经指定了此信息。为什么我需要再次使用fabric插件

     fabric_env:
        host_string: { get_input: host_ip }
        user: { get_input: agent_user }
        key_filename: { get_input: agent_private_key_path }

我做错什么了吗。我只是这方面的初学者,因此任何帮助都将不胜感激。

Fabric可能由于许多原因而失败,例如缺少密钥文件或错误的密钥文件。。。 一般来说,当应用程序VM中出现SSHing问题时,您会看到此类错误,其中使用私钥对的身份验证失败(因为缺少私钥对或是因为私钥对错误),在这种情况下,将回退到用户/密码身份验证


如果没有关于您安装的Cloudify版本和操作系统(Ubuntu、Centos等)的信息,我无法给出更详细的答案。

我使用的是Cloudify 3.2 GA和Ubuntu操作系统。当我将I/p详细信息提供给fabric插件时,Blueprint确实起作用。但当它只是在主机中指定时就不是了。请参阅,我已经用新发现更新了我的问题。fabric插件使用一个参数来确定在SSH身份验证期间要传递给主机的值。如果不提供fabric_env,那么对于用户,它会在引导上下文中查找,或者在引导上下文或环境变量中查找键。可能是其中一个位置指向的值与您在fabric_env中注入的值不同,例如,已更改的授权_密钥文件。