Ask Your Question
0

manifest Error 400 on SERVER: Syntax error at '/'

asked 2014-07-18 15:21:07 -0500

ggustav gravatar image

I am fairly new to puppet and having trouble with one of my manifest files that handles splunk agent configuration. I cant seem to find the source of this error when running puppet agent -t --noop on a host with the classes applied

Here's the error

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at '/'; expected '}' at /etc/puppet/modules/splunk6/manifests/config.pp:39 on node pxy1bo-s1-inf.ssoqa-bo.mtv1.vrsn.com

And the code it erroring out on is this, line 39 is the section that starts with if $SPLUNK6_ROLE != /indexer/ {

    class splunk6::config {
      include splunk6::params

      case $::datacenter {
        /(?:mtv|ilg)/: {
          $dir_mode = '0755'
          $file_mode = '0644'
        }
        default: {
          $dir_mode = '0750'
          $file_mode = '0640'
        }
      }


      if $SPLUNK6_ROLE =~ /(indexer|forwarder)/ {
        file { "splunk6tcp_system_inputs_conf":
          path    => "$splunk6::params::install_path/splunkforwarder/etc/system/local/inputs.conf",
          content => template('splunk6/splunk6tcp_system_inputs_conf.erb'),
          owner   => splunk,
          group   => splunk,
          mode    => $file_mode,
          require => Package['splunk6'],
          notify  => Service['splunk6'],
         }
      }
      elsif $SPLUNK6_ROLE =~ /endpoint/ {
        file { "splunk6_system_inputs_conf":
          path    => "$splunk6::params::install_path/splunkforwarder/etc/system/local/inputs.conf",
          content => template('splunk6/splunk6_system_inputs_conf.erb'),
          owner   => splunk,
          group   => splunk,
          mode    => $file_mode,
          require => Package['splunk6'],
          notify  => Service['splunk6'],
         }
      }

      if $SPLUNK6_ROLE != /indexer/ {
        file { "splunk6_system_outputs_conf":
          path    => "$splunk6::params::install_path/splunkforwarder/etc/system/local/outputs.conf",
          content => template('splunk6/splunk6_system_outputs_conf.erb'),
          owner   => splunk,
          group   => splunk,
          mode    => $file_mode,
          require => Package['splunk6'],
          notify  => Service['splunk6'],
        }
      }
  if $SPLUNK6_ROLE =~ /(endpoint|forwarder)/ {
    file { "splunk6_suf_local_dir":
      path    => "$splunk6::params::install_path/splunkforwarder/etc/apps/SplunkUniversalForwarder/local",
      ensure  => directory,
      owner   => splunk,
      group   => splunk,
      mode    => $dir_mode,
      require => Package['splunk6'],
    }

    file { "splunk6_suf_app_conf":
      path    => "$splunk6::params::install_path/splunkforwarder/etc/apps/SplunkUniversalForwarder/local/app.conf",
      source  => 'puppet:///modules/splunk6/suf/local/app.conf',
      owner   => splunk,
      group   => splunk,
      mode    => $file_mode,
      require => File['splunk6_suf_local_dir'],
      notify  => Service['splunk6'],
    }

    file { "splunk6_suf_server_conf":
      path    => "$splunk6::params::install_path/splunkforwarder/etc/apps/SplunkUniversalForwarder/local/server.conf",
      source  => 'puppet:///modules/splunk6/suf/local/server.conf',
      owner   => splunk,
      group   => splunk,
      mode    => $file_mode,
      require => File['splunk6_suf_local_dir'],
    }

    file { "splunk6_slf_limits_conf":
      path    => "$splunk6::params::install_path/splunkforwarder/etc/apps/SplunkUniversalForwarder/local/limits.conf",
      source  => 'puppet:///modules/splunk6/suf/local/limits.conf',
      owner   => splunk,
      group   => splunk,
      mode    => $file_mode,
      require => File['splunk6_suf_local_dir'],
    }
  }
}
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-07-19 08:55:36 -0500

Looks like at line 39 you are trying to compare a string to a regular expression. In ruby the way to do that is !~, not sure if puppet supports it or not.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-07-18 15:21:07 -0500

Seen: 879 times

Last updated: Jul 18 '14