Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
win_service recovery actions support #56445
This is a new feature for the win_service Ansible module.
These settings can also be set with the sc.exe program, but I wanted to have something that was idempotent.
As far as variables naming, etc... I'm open to making changes you deem necessary. I commented as much as I saw fit, but if you feel like it's lacking, please do tell.
I've seen two schools when it comes to passing stuff to Powershell modules, either separate variables or a string that represents an Ansible dictionary, I went with the former. (Although I wished we could just pass a dict to a powershell script, it'd be more readable)
I did this for a personal need, so I'm using it in my local Ansible library directory.
referenced this pull request
May 17, 2019
nitzmahone left a comment
I like the idea of adding support for this to round out Ansible's Windows service management capability, but I do have concerns (some conceptual, some with the specific implementation here):
@jborean93 any other thoughts?
@nitzmahone thank you for reviewing this PR!
Not sure I understand the sub dictionary part. I wanted to do that, but powershell doesn’t seem to be handling a dictionary passed by Ansible too well (maybe I didn’t do it properly), but with a bit more guidance I’d be happy to change that too.
As for the testing, I wasn’t sure I had found the appropriate playbook to update, so again, if you have a tip, I’d be happy to add tests to make it this PR better.