Chef LWRP for creating and deleting Windows Services
Windows 2008R2 |
---|
Windows 2012 |
Windows 2012R2 |
Key | Type | Description | Default |
---|---|---|---|
name | String | Name of the service | nil |
bin_path | String | Full path to the executable | nil |
start_type | String | Start type of the service | disabled |
display_name | String | Display name of the windows service | nil |
run_as_user | String | User to run the service | LocalSystem |
run_as_password | String | Password for user, if other than LocalSystem | nil |
Place a dependency on the winservice cookbook in your cookbook's metadata.rb
depends 'winservice'
Then, in a recipe:
win_service "Create Window Service" do
name MyService
bin_path C:\\My\\Awesome\\Path
display_name MyAwesomeService
run_as_user Foo\\Bar
run_as_password MySuperSecretPassword
action :create
end
win_service "Create Window Service" do
name MyService
action :delete
end
Author:: Amitraj Budhu (abudhu@gmail.com)