example42 / puppet-splunk

Splunk Puppet Module
http://www.example42.com
Other
12 stars 29 forks source link

Splunk Universal Forwarder service name incorrect in 7.2.x on new installs #41

Open anthonysomerset opened 5 years ago

anthonysomerset commented 5 years ago

Expected Behavior

Puppet can correctly start the splunk service

Actual Behavior

puppet has failed attempt to start the splunk forwarder service on every run

Steps to Reproduce the Problem

clean install new system, include the splunk class with a 7.2.x version package (i have tested 7.2.6)

The main issue is that on current systems (Ubuntu 18.04 and CentOS > 7) using systemd the service file is actually created as: SplunkForwarder.service (and does appear to be case sensitive)

and it would appear that the service definition in init.pp is just calling the service name as splunk so this would need to be dynamically determined or we must manage the actual service file fully

Specifications

Please add this info:

  1. Facter data
    os => {
    architecture => "amd64",
    distro => {
    codename => "bionic",
    description => "Ubuntu 18.04.2 LTS",
    id => "Ubuntu",
    release => {
      full => "18.04",
      major => "18.04"
    }
    },
    family => "Debian",
    hardware => "x86_64",
    name => "Ubuntu",
    release => {
    full => "18.04",
    major => "18.04"
    },
    selinux => {
    enabled => false
    }
    }
  2. Version of Puppet and of the module -

5.5.14 - running on master

  1. The relevant Puppet code and eventually Hiera data
    # THIS IS WIP to specifically move stuff to repo based install sources - the above code block will eventually disappear as will this
    case $operatingsystem {
        'ubuntu', 'debian': { include profiles::splunk::repo }
        'centos', 'redhat': { #NO OP TO NOT FAIL - repo is done in base YUM config already 
        }
        default: {  fail('Unrecognized operating system for Splunk Install') }
    }
    $install_source = ''

    class { 'splunk':
        install           => 'forwarder',
        deployment_server => $deployment_server,
        admin_password    => 'watchingthepuppet',
        install_source    => $install_source,
    }