2016-08-09 3 views
-2

저는 여전히 많은 어려움을 겪었습니다.ansible - ESXi에서 VM을 배포하려고 시도합니다.

--- 
- hosts: localhost 
    connection: local 
    tasks: 
- vsphere_guest: 
    vcenter_hostname: emea-esx-s18t.sddc-hwl-family.net 
    username: root 
    password: HWL-sddc 
    guest: newvm001 
    state: powered_off 
    vm_extra_config: 
     vcpu.hotadd: yes 
     mem.hotadd: yes 
     notes: This is a test VM 
    vm_disk: 
     disk1: 
     size_gb: 10 
     type: thin 
     datastore: gmh-040-data-esx-sddc 
    vm_nic: 
     nic1: 
     type: vmxnet3 
     network: VM Network 
     network_type: standard 
    vm_hardware: 
     memory_mb: 4096 
     num_cpus: 4 
     osid: windows7Server64Guest 
     scsi: paravirtual 
    esxi: 
     datacenter: MyDatacenter 
     hostname: esx-s18t.sddc-hwl-family.net 

난을 예수님이 도구는 나를 아프게 ... 그러나, 나는 다음 줄을 작성한이 작전의 이름이 ".yml"파일 그래서 "vmware2.yml" 을 가지고 있습니다 내가 다시 다음과 같은 메시지를 받고 한 작전을 실행 : 이미 과거에이 질문을

[email protected]:~/ansible# ansible-playbook vmware2.yml 
ERROR! 'vsphere_guest' is not a valid attribute for a Play 

The error appears to have been in '/root/ansible/vmware2.yml': line 5, column 3, but may 
be elsewhere in the file depending on the exact syntax problem. 

The offending line appears to be: 

    tasks: 
- vsphere_guest: 
^here 

->

trouble with pysphere - ansible 그렇게는 ESXi를 모듈 또는 명령을 잘 모릅니다 것 같다. 왜냐하면 나는 거기에서 그것을 실행하려고하기 때문이다. 내 ESXi 호스트의 Ansible을 통해 VM을 배포하려고합니다.

내가 도와 줄 수 있습니까? :/

+0

오, 이런 ... 왜 읽지 않는 오류 메시지를? YAML 기초? '- vsphere_guest :'의 들여 쓰기가 잘못되었습니다 -'tasks :'아래에 전체 블록을 옮깁니다. –

+0

읽을 수 있습니다. 아무 걱정도;) 나는 벌써 이것을했고, 같은 오류 메시지를 다시 얻는다. .. thats 내가 묻고있는 thats. 나는 프로그래머가 아니므로 매우 유감 스럽다.) 왜 내가 여기에 친구를 물어보고 가능한 경우 도움을 청한다는 .. that is –

답변

0

이 시도 :

--- 
- hosts: localhost 
    connection: local 
    tasks: 
    - vsphere_guest: 
     vcenter_hostname: emea-esx-s18t.sddc-hwl-family.net 
     username: root 
     password: HWL-sddc 
     guest: newvm001 
     state: powered_off 
     vm_extra_config: 
      vcpu.hotadd: yes 
      mem.hotadd: yes 
      notes: This is a test VM 
     vm_disk: 
      disk1: 
      size_gb: 10 
      type: thin 
      datastore: gmh-040-data-esx-sddc 
     vm_nic: 
      nic1: 
      type: vmxnet3 
      network: VM Network 
      network_type: standard 
     vm_hardware: 
      memory_mb: 4096 
      num_cpus: 4 
      osid: windows7Server64Guest 
      scsi: paravirtual 
     esxi: 
      datacenter: MyDatacenter 
      hostname: esx-s18t.sddc-hwl-family.net 
+0

이 코드는 작동하지만 이제는 다른 오류 메시지가 나타납니다. '루트 @의 ansible1 : ~/ansible # ansible - 각본 vmware2.yml '.... TASK [vsphere_guest] *********************** *********************************** 작업 실행 중에 예외가 발생했습니다. 전체 추적을 보려면 -vvv를 사용하십시오. 오류 : ssl.SSLError : [SSL : CERTIFICATE_VERIFY_FAILED] 인증서 확인 실패 (_ssl.c : 590) 치명적 : [localhost] : FAILED! => { "changed": false, "failed": true, "parsed": false} ....' 그래서 나는 이것을 얻고 있습니까? SSL 인증서가 있습니다. –

+0

'validate_certs : no' 시도, http://docs.ansible.com/ansible/vsphere_guest_module.html –

+0

"vcenter_hostname : .."줄 앞에 추가했습니다. 이제 오류가 발생합니다. '태스킹 [vsphere_guest] ********************************************* ************* 치명적인 : [localhost] : FAILED! "msg": "모듈에 대해 지원되지 않는 매개 변수 : validate_certs"} ' –