27 lines
705 B
YAML
27 lines
705 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_guest:
|
|
hostname: "{{ vcenter_hostname }}"
|
|
username: "{{ vcenter_username }}"
|
|
password: "{{ vcenter_password }}"
|
|
validate_certs: "{{ vcenter_validate_certs }}"
|
|
datacenter: "{{ vcenter_datacenter }}"
|
|
name: "{{ vars_name }}"
|
|
delegate_to: localhost
|
|
register: gather_info_vm
|
|
|
|
- name: Print info {{ vars_name }}
|
|
msg: "{{ gather_info_vm }}"
|
|
|