29 lines
737 B
YAML
29 lines
737 B
YAML
---
|
|
- name: Get info VM
|
|
hosts: localhost
|
|
become: false
|
|
gather_facts: false
|
|
vars:
|
|
vars_name: "dc01-ftpsrv01-it-infr.lab.loc"
|
|
# vars_name: "debian12-common-templ"
|
|
vars_files:
|
|
- /root/.secret/.ansible/vars_creds.yml
|
|
|
|
tasks:
|
|
- name: Get info VM
|
|
community.vmware.vmware_vm_info:
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
validate_certs: "{{ vcenter_validate_certs }}"
|
|
# datacenter: "{{ vcenter_datacenter }}"
|
|
vm_name: "{{ vars_name }}"
|
|
# vm_type: template
|
|
delegate_to: localhost
|
|
register: info_vm
|
|
|
|
|
|
- name: Print info {{ vars_name }}
|
|
debug:
|
|
msg: "{{ info_vm }}"
|