使用ansible在azure中创建VM时出错

时间:2015-10-05 11:14:20

标签: azure ansible ansible-playbook

我正在使用azure = 0.11.1并且还在1.0.1版本中尝试并执行它但是我得到了同样的错误,如下所述,playbook在下面提到:

azurevm_yml

--- - local_action: module: "azure" name: 'vm_ubuntu1' role_size: Small image: '5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-67-20150815' password: "admin12345@" location: 'East US 2' user: admin wait: yes subscription_id: 'xxxxxxxxxxxxxx' management_cert_path: '/ansible-pbook/xxxx.pem' storage_account: 'storageacc01' endpoints: '22,8080,80' register: azure_vm

错误:

root@xxxxx:/ansible-pbook# ansible-playbook azure_vm.yml ERROR: password is not a legal parameter of an Ansible Play

请建议我......

1 个答案:

答案 0 :(得分:0)

任务的正确格式如下:

- local_action: azure
    name='vm_ubuntu1'
    role_size=Small
    image='5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-67-20150815'
    password="admin12345@"
    location='East US 2'
    user=admin
    wait=yes
    subscription_id='xxxxxxxxxxxxxx'
    management_cert_path='/ansible-pbook/xxxx.pem'
    storage_account='storageacc01'
    endpoints='22,8080,80'
  register: azure_vm

传递给模块的所有参数都应采用key=value格式,而属于任务/操作本身的属性(如registertagsignore_errors,等号)的格式为attribute: value