Just a example but there is a lot out there:   
https://petri.com/use-powercli-create-snapshot/ 

 

Examples of the plays that I run:

 

- name: Check the servers in the cluster to ensure none are offline

  ansible.builtin.shell: |

    Connect-VIServer -Server "{{ inventory_hostname }}" -User "{{ Admin_Acct 
}}" -Password "{{ Admin_Pass }}" | Out-Null

    $NotRespondingHost = (Get-Cluster | Get-VMHost | ? { $_.ConnectionState 
-match "NotResponding"}).Name

    ForEach ($NotRespondingHost in $NotRespondingHosts) {

       $pos = $NotRespondingHost.IndexOf(".")

       $ESXi_name = $NotRespondingHost.Substring(0, $pos)

       $domain_name = $NotRespondingHost.Substring($pos+1)

       $ESXi_name + "._ilo." + $domain_name

    }

  args:

    executable: /usr/bin/pwsh

  register: NotRespondingHostILO_Pre

  delegate_to: localhost

 

 

From: [email protected] <[email protected]> On 
Behalf Of kyle jones
Sent: Sunday, March 12, 2023 10:14 PM
To: [email protected]
Subject: Re: [ansible-project] Vmware.Collection: vmware_guest_snapshot setting 
expiration

 

Ah! Okay then it’s not just me. Mind pointing out some documentation on the 
powershell script? 

 

On Sun, Mar 12, 2023 at 5:38 PM <[email protected] 
<mailto:[email protected]> > wrote:

Hey Kyle – I have done a bit of ansible playbooks for the VI environment I work 
in…I had found that ansible is someone limit with the VI module.    I have 
accomplished everything with PowerCLI with ansible.windows.win_shell module.    
 I run it all from the Ansible server by installing Powershell on the RHEL 
ansible server.    This setup allows us to run deeper/more complicated plays.   
 
 
My 2 cents…

 

 

From: [email protected] 
<mailto:[email protected]>  <[email protected] 
<mailto:[email protected]> > On Behalf Of kyle jones
Sent: Sunday, March 12, 2023 6:00 PM
To: Ansible Project <[email protected] 
<mailto:[email protected]> >
Subject: [ansible-project] Vmware.Collection: vmware_guest_snapshot setting 
expiration

 

Hello,

 

Does anyone have any documentation or know what parameters to use when using 
vmware_guest_snapshot to take snapshot, but adding an expiration period? 

 

I looked over the ansible docs a few times and I did not see it.

 

 

-- 
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] 
<mailto:[email protected]> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ed094263-70fd-49c7-b140-7dfc408f3239n%40googlegroups.com
 
<https://groups.google.com/d/msgid/ansible-project/ed094263-70fd-49c7-b140-7dfc408f3239n%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Ansible Project" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/ansible-project/WeN4U0Rcgic/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
[email protected] 
<mailto:[email protected]> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/214101d95533%2467e00d10%2437a02730%24%40gmail.com
 
<https://groups.google.com/d/msgid/ansible-project/214101d95533%2467e00d10%2437a02730%24%40gmail.com?utm_medium=email&utm_source=footer>
 .

-- 
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] 
<mailto:[email protected]> .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAP2pnAegRe_HhsipuuK1Twjqn1enfNhNLNdM3ZML%3DmnLv8krcw%40mail.gmail.com
 
<https://groups.google.com/d/msgid/ansible-project/CAP2pnAegRe_HhsipuuK1Twjqn1enfNhNLNdM3ZML%3DmnLv8krcw%40mail.gmail.com?utm_medium=email&utm_source=footer>
 .

-- 
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/262c01d95684%24f56bba10%24e0432e30%24%40gmail.com.

Reply via email to