you can probably provide a list to name:

On Tue, Aug 14, 2018 at 3:38 PM Dimitri Yioulos <[email protected]> wrote:

> Hello, all.
>
> I need to create a playbook which will include shutting down, then
> restarting, six virtual machines.  The shut-downs/start-ups must be done on
> the machines in specific order (start-ups in reverse order of shut-downs).
> Since they are virtual, I was thinking of using the vmware_guest module.  I
> know that it works for a single machine at a time, such as:
>
> ---
>
> - hosts: localhost
>   gather_facts: false
>
>   vars:
>     vsphere_host: 10.0.101.17
>     vsphere_username: user
>     vsphere_password: password
>     vsphere_guestname: vmname
>     vm_state: restarted #poweredon shutdownguest restarted
>
>   tasks:
>     - name: boot vmware guest
>       vmware_guest:
>          hostname: "{{ vsphere_host }}"
>          username: "{{ vsphere_username }}"
>          password: "{{ vsphere_password }}"
>          validate_certs: no
>          name: "{{ vsphere_guestname }}"
>          wait_for_ip_address: no
>          state: "{{ vm_state }}"
>
> But, is there a way to specify all the machines to be shut down/brought
> up, in the order that I'd like that to happen?  If so, how?
>
> Thanks.
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7dc743f3-1857-49f0-b29c-83c8e92ad2ce%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/7dc743f3-1857-49f0-b29c-83c8e92ad2ce%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Jonathan lozada de la matta

AUTOMATION CONSULTANT - AUTOMATION PRACTICE

Red Hat Consulting Services <https://www.redhat.com/>

[email protected]

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFYJA%2BKgrKH0yJTCsW7Xsy1AxU1msG4W8MW%2BkOY-kBXArn5G1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to