Hello, I’ve just upgraded to Ansible 2.6 to use the vcenter_folder module and I’ve got a question on how is it working:
Should we use a Windows or Linux host an then connect on the vsphere? Or directly put the vcenter hostname?
###new_app.yml | calling main####
- name: Creating a new app ( vCenter side )
hosts: ???
gather_facts: false
roles:
- role: new_app
vCentActions: true
###new_app | main.yml###
- name: Creating a VM folder for EPAM/EPOC
vcenter_folder:
hostname: xxx.mydomain.fr
username: ‘{{ user_name }}’
password: ‘{{ user_password }}’
datacenter: xxxx
folder_name: ‘{{ item.new_folder }}’
parent_folder: ‘{{ item.parent_folder }}’
folder_type: vm
state: present
validate_certs: no
register: vm_folder_creation_result
with_items:
- { new_folder: “hi”, parent_folder: “an” }
- { new_folder: “this”, parent_folder: “example” }
- { new_folder: “is”, parent_folder: “true” }
when: ( zone_name | lower == ‘xxx’ ) or ( zone_name | lower == ‘xxx’ ) and ( zone_type | lower == ‘xxx’ )
When I put a Windows as the host i’e got this error =>
TASK [new_app : Creating a VM folder for EPAM/EPOC] ****************************
18:05:28
[WARNING]: FATAL ERROR DURING FILE TRANSFER: (u’http’, u’Bad HTTP response
returned from server. Code 500’)
fatal: [PW1BAST-RDS11]: FAILED! => {“msg”: "winrm send_input failed; \nstdout: Unable to initialize device PRN\r\nUnable to initialize device PRN\r\nUnable to initialize device PRN\r\n\nstderr ANSIBALLZ_WRAPPER : The term ‘ANSIBALLZ_WRAPPER’ is not recognized as the name \r\nof a cmdlet, function, script file, or operable program. Check the spelling of \r\nthe name, or if a path was included, verify that the path is correct and try \r\nagain.\r\nAt line:1 char:1\r\n+ ANSIBALLZ_WRAPPER = True # For test-module script to tell this is a \r\nANSIBALLZ_WR …\r\n+ ~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (ANSIBALLZ_WRAPPER:String) [], C \r\n ommandNotFoundException\r\n + FullyQualifiedErrorId : CommandNotFoundException\r\n \r\nimport : The term ‘import’ is not recognized as the name of a cmdlet, \r\nfunction, script file, or operable program. Check the spelling of the name, or \r\nif a path was included, verify that the path is correct and try again.\r\nAt line:1 char:1\r\n+ …3
Did someone have already tested this module and can help me to use it?
Thank’s
Best Regards
Julien.