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

时间:2015-07-16 04:56:53

标签: 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',)

以下是我的整个蓝图文件。

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

我的inputs.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 }

我有什么问题吗?我只是这个领域的初学者,所以任何帮助都将受到赞赏。

1 个答案:

答案 0 :(得分:1)

Fabric可能由于许多原因而失败,例如缺少密钥文件或错误的密钥文件...... 一般来说,当有问题SSH进入应用程序虚拟机时,你会看到这种错误,其中使用私钥对的身份验证失败(因为它丢失或因为它是错误的),在这种情况下会有一个回退用户/密码验证。

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