I know how to create a windows service by doing,
salt service.create "servicename" "c:\executable.exe" display="serviceIcreated"
How can I incorportate this into a state?
c:\temp\somedir:
file.recurse:
-source: salt:/d/ser
I know how to create a windows service by doing,
salt service.create "servicename" "c:\executable.exe" display="serviceIcreated"
How can I incorportate this into a state?
c:\temp\somedir:
file.recurse:
-source: salt:/d/ser
As the
service.create
is not available in Salt States you will need to run the execution module from within your own state or sls file.You could do it this way:
About the piece of code in your question I did not understand how it adds value to your question.
If it is relevant, please make an edit in order to make it easier to understand.