Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: localhost
- gather_facts: false
- connection: local
- vars_files:
- - envanswer.yml
- vars:
- folder: "{{ folder }}"
- tasks:
- - name: Gather VM information for all VMs present
- vmware_vm_facts:
- hostname: "{{ vcenter }}"
- username: "{{ vcenter_user }}"
- password: "{{ vcenter_pass }}"
- validate_certs: False
- delegate_to: localhost
- register: vmfacts
- when: vmfacts.virtual_machines | search("masters")
- - debug:
- var: vmfacts.virtual_machines
- fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check 'vmfacts.virtual_machines | search("masters")' failed. The error was: error while evaluating conditional (vmfacts.virtual_machines | search("masters")): 'vmfacts' is undefinednnThe error appears to have been in '/home/deploy/ansible/vmfacts.yml': line 12, column 5, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nn tasks:n - name: Gather VM information for all VMs presentn ^ heren"}
Add Comment
Please, Sign In to add comment