i want to copy ip address of VM in local file (localhost)
- hosts: localhost
gather_facts: false
vars_files:
- vars.yml
tasks:
- name: provisioning vm
vmware_guest:
hostname: '{{ vsphere_hostname }}'
username: '{{ vsphere_username }}'
password: '{{ vsphere_password }}'
validate_certs: no
datacenter: '{{ vsphere_datacenter }}'
cluster: '{{ vsphere_cluster }}'
folder: '{{ vsphere_folder }}'
name: "{{ inventory_hostname }}"
state: poweredon
guest_id: '{{ vm_id }}'
template: '{{ vm_template }}'
networks:
- name: '{{ vm_network_US }}'
ip: '{{ vm_IP }}'
netmask: '{{ vm_netmask}}'
gateway: '{{ vm_gateway}}'
dns_servers: '{{ vm_dns }}'
start_connected: yes
connected: yes
wait_for_ip_address: yes
state: poweredon
delegate_to: localhost
register: vm
Le samedi 21 novembre 2020 à 11:23:49 UTC+1, [email protected] a écrit :
> Please explain a bit more why what etc
> And share a playbook
>
> On Sat, 21 Nov 2020 at 09:32, blue fox <[email protected]> wrote:
>
>> Hello ,
>>
>> how I can specify a host in each task.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/98965131-1426-4e91-8537-01bdee198e4bn%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/98965131-1426-4e91-8537-01bdee198e4bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Sent from a mobile device - please excuse the brevity, spelling and
> punctuation.
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/64870408-bde0-4845-ad38-fa95a14accden%40googlegroups.com.