On 01. juli 2016 05:20, foo wrote:
    - name: destroy default network
       virt_net: command=destroy name=default
       ignore_errors: true

     - name: undefine default network
       virt_net: command=undefine name=default
       ignore_errors: true

This works fine, but I had to put in the "ignore_errors: true" flag because
if i run this playbook more than once, the second time it will error out as
the "default" network does not exist.  On most other ansible tasks, for
example when creating a linux user account, ansible will skip over it if
the user account already exists and does not error out in the middle of the
playbook.

Is there a way to do the same for my destroy and undefine commands in
virt_net?  I'm not sure if what i'm doing is the cleanest method.  I know
in a perfect world, i would not be running this playbook more than once,
but I am running it multiple times testing different additions to the
playbook.

Remove command and add state=absent ?

- name: default network
  virt_net: state=absent name=default

--
Kai Stian Olstad

--
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/577677AE.4070208%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to