Action Plugins Development and handling potential

11 views
Skip to first unread message

Wei-Yen Tan

unread,
Jul 4, 2022, 5:41:46 AM7/4/22
to Ansible Development
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 


the full block of code is here . 

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.
Reply all
Reply to author
Forward
0 new messages