I am exploring writing Action Plugins.

What I am writing is a custom action plugin that runs a 'compliance' module 
on the destination Windowd host to determine whether a certain task has 
been completed or not. The reason why I have it in an action plugin and not 
a module is that the destination host may reboot and if it reboots then the 
module will break.  I have a timeout feature.

Anyway I was wondering how to handle when the server reboots, and the 
action plugin is running the self.execute_module there will be a connection 
error.

I am accounting for a AnsibleConnectionFailure error. 

The gist for it is here 

https://gist.github.com/weiyentan/b793bddd1c949940f044f337715f6b6d

the full block of code is here . 

apfw_win_update_ansible_collection/apfw_wait.py at develop ยท 
weiyentan/apfw_win_update_ansible_collection (github.com) 
<https://github.com/weiyentan/apfw_win_update_ansible_collection/blob/develop/plugins/action/apfw_wait.py>
Is this the right way to handle it?

Many thanks for any guidance.

Its my first time giving this a go and I am learning a lot along the way.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/b3b6d906-a71a-4370-a936-e1dfef0d71b4n%40googlegroups.com.

Reply via email to