Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 6.0.4
- Ruby:
ruby 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32]
- Distribution:
- Module version: mod 'puppet-winlogbeat', '0.2.2'
How to reproduce (e.g Puppet code you use)
- Stop the winlogbeat service if it is already installed
- delete the service entry on cmd by '
sc delete winlogbeat'
- Run the puppet to get winlogbeat installed on target node
puppet agent -t
Below is the excerpt of puppet class
class { '::winlogbeat':
download_url => $url,
major_version => $version,
package_ensure => $package,
outputs => {
'logstash' => {
'hosts' => $logstash_hosts,
'loadbalance' => $load_balance,
},
},
event_logs => {
'Application' => {
'ignore_older' => '1h',
},
},
}
What are you seeing
Notice: /Stage[main]/Winlogbeat::Install/Archive[C:/Windows/Temp/winlogbeat-6.4.2-windows-x86_64.zip]/ensure: download archive from https://artifacts.elastic.co/downloads/beats/winlogbe
at/winlogbeat-6.4.2-windows-x86_64.zip to C:/Windows/Temp/winlogbeat-6.4.2-windows-x86_64.zip without cleanup
Notice: /Stage[main]/Winlogbeat::Install/Exec[unzip winlogbeat-6.4.2-windows-x86_64]/returns: executed successfully
Notice: /Stage[main]/Winlogbeat::Install/File[C:/Windows/Temp/winlogbeat-6.4.2-windows-x86_64.zip]/ensure: removed
Notice: /Stage[main]/Winlogbeat::Install/Exec[rename winlogbeat-6.4.2-windows-x86_64]/returns: executed successfully
Notice: /Stage[main]/Winlogbeat::Install/Exec[mark winlogbeat-6.4.2-windows-x86_64]/returns: executed successfully
Info: /Stage[main]/Winlogbeat::Install/Exec[mark winlogbeat-6.4.2-windows-x86_64]: Scheduling refresh of Exec[install winlogbeat-6.4.2-windows-x86_64]
Notice: /Stage[main]/Winlogbeat::Install/Exec[install winlogbeat-6.4.2-windows-x86_64]: Triggered 'refresh' from 1 event
Notice: /Stage[main]/Winlogbeat::Config/File[winlogbeat.yml]/content:
Info: Computing checksum on file C:/Program Files/Winlogbeat/winlogbeat.yml
Info: /Stage[main]/Winlogbeat::Config/File[winlogbeat.yml]: Filebucketed C:/Program Files/Winlogbeat/winlogbeat.yml to puppet with sum 30476c559dfafdd93b3a43384cb52979
Notice: /Stage[main]/Winlogbeat::Config/File[winlogbeat.yml]/content: content changed '{md5}30476c559dfafdd93b3a43384cb52979' to '{md5}e87d9990a8bbf238c39d67bb5e419271'
Info: /Stage[main]/Winlogbeat::Config/File[winlogbeat.yml]: Scheduling refresh of Service[winlogbeat]
Error: Cannot enable winlogbeat, error was: Failed to open a handle to the service: The specified service does not exist as an installed service.
Wrapped exception:
Failed to open a handle to the service: The specified service does not exist as an installed service.
Error: /Stage[main]/Winlogbeat::Service/Service[winlogbeat]/ensure: change from 'stopped' to 'running' failed: Cannot enable winlogbeat, error was: Failed to open a handle to the servic
e: The specified service does not exist as an installed service.
Notice: /Stage[main]/Winlogbeat::Service/Service[winlogbeat]: Triggered 'refresh' from 1 event
Info: Class[Winlogbeat::Service]: Unscheduling all events on Class[Winlogbeat::Service]
Notice: /Stage[main]/Winlogbeat/Anchor[winlogbeat::end]: Dependency Service[winlogbeat] has failures: true
What behaviour did you expect instead
Puppet should able to install winlogbeat without any failures.
Output log
Puppet run failing with service not avaialble

Any additional information you'd like to impart
If I add the service manually with the following command and run puppet , it is not failing.
Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo -Command New-Service -name filebeat -displayName Filebeat -binaryPathName '\"C:\Program Files\Filebeat\Filebeat.exe\" -c \"C:\Program Files\Filebeat\filebeat.yml\" -path.home \"C:\Program Files\Filebeat\" -path.data \"C:\ProgramData\filebeat\" -path.logs \"C:\ProgramData\filebeat\logs\"'
Affected Puppet, Ruby, OS and module versions/distributions
ruby 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32]How to reproduce (e.g Puppet code you use)
sc delete winlogbeat'puppet agent -tBelow is the excerpt of puppet class
What are you seeing
What behaviour did you expect instead
Puppet should able to install winlogbeat without any failures.
Output log
Puppet run failing with service not avaialble

Any additional information you'd like to impart
If I add the service manually with the following command and run puppet , it is not failing.
Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo -Command New-Service -name filebeat -displayName Filebeat -binaryPathName '\"C:\Program Files\Filebeat\Filebeat.exe\" -c \"C:\Program Files\Filebeat\filebeat.yml\" -path.home \"C:\Program Files\Filebeat\" -path.data \"C:\ProgramData\filebeat\" -path.logs \"C:\ProgramData\filebeat\logs\"'