Fails to install splunkforwarder.rpm

asked 2017-04-22 04:58:04 -0600

updated 2017-04-24 06:27:23 -0600

puser gravatar image

Somehow it fails to install the rpm thus preventing to installing the files under /opt/spunkforwarder/*.

Can anyone point me to this issue? I been at it for few hours but its time to ask for some help. New to puppet here..

enter code here
enter code here

Debug: Prefetching rpm resources for package

Debug: Executing '/bin/rpm --version' Debug: Executing '/bin/rpm -qa --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'' Error: Could not set 'file' on ensure: No such file or directory - /opt/splunkforwarder/etc/system/local/deploymentclient.conf20170422-17960-iqoq5j.lock at 90:/etc/puppetlabs/code/environments/development/modules/splunkuf/manifests/init.pp Error: Could not set 'file' on ensure: No such file or directory - /opt/splunkforwarder/etc/system/local/deploymentclient.conf20170422-17960-iqoq5j.lock at 90:/etc/puppetlabs/code/environments/development/modules/splunkuf/manifests/init.pp Wrapped exception: No such file or directory - /opt/splunkforwarder/etc/system/local/deploymentclient.conf20170422-17960-iqoq5j.lock Error: /Stage[main]/Splunkuf/File[/opt/splunkforwarder/etc/system/local/deploymentclient.conf]/ensure: change from absent to file failed: Could not set 'file' on ensure: No such file or directory - /opt/splunkforwarder/etc/system/local/deploymentclient.conf20170422-17960-iqoq5j.lock at 90:/etc/puppetlabs/code/environments/development/modules/splunkuf/manifests/init.pp Notice: /Stage[main]/Splunkuf/Service[splunkforwarder]: Dependency File[/opt/splunkforwarder/etc/system/local/deploymentclient.conf] has failures: true Warning: /Stage[main]/Splunkuf/Service[splunkforwarder]: Skipping because of failed dependencies Debug:

class splunkuf (
$targeturi    = $::splunkuf::params::targeturi,      # I believe this is the server it will forward the information too.

$systemd = $::splunkuf::params::systemd, $systemuser = $::splunkuf::params::systemuser, # default user is 'splunk' & can verify from the /etc/shadow $mgmthostport = $::splunkuf::params::mgmthostport, # default management port is 8089 ) inherits splunkuf::params {

# Install splunkforwarder rpm files

file { ['/opt/splunkforwarder-6.5.2-67571ef4b87d-linux-2.6-x8664.rpm']: # Where the rpm will be placed in the host source => 'puppet:///modules/splunkuf/splunkforwarder-6.5.2-67571ef4b87d-linux-2.6-x8664.rpm', # Where to fetch the file }

package { ['splunkforwarder']: ensure => present, provider => 'rpm', source => '/opt/splunkforwarder-6.5.2-67571ef4b87d-linux-2.6-x8664.rpm', # Where the RPM is on the node require => File['/opt/splunkforwarder-6.5.2-67571ef4b87d-linux-2.6-x8664.rpm'], # Checks to see if this file is on the host }

service { 'splunkforwarder': ensure => 'running', enable => true,

hasrestart => true, # added for testing

}

# End splunkforwarder

# CentOS 7 - Systemd startup configuration # Enables start, stop, and enable splunkforwarder on boot case $systemd { true: { file { '/usr/lib/systemd/system/splunkforwarder.service': owner => 'root', group => 'root', mode => '0755', content => template('splunkuf/splunkforwarder.service.erb'), } }

# CentOS 6 - /etc/init.d/splunkforwarder [start,stop] default: { file { '/etc/init.d/splunkforwarder': owner => 'root', group => 'root', mode => '0755', content => template('splunkuf/splunkforwarder.erb'), } } }

# Only Root user should have access to this folder 0700 # Find out how to change the splunkforwarder folder to only 0700 # Bug found file { '/opt/splunkforwarder': ensure => directory, owner => $systemuser, group => $systemuser, recurse => true, require => Package['splunkforwarder'], } -> file { '/opt/splunkforwarder/etc/system/local/deploymentclient.conf': owner => $systemuser, group => $systemuser, mode => '0644', content => template('splunkuf/deploymentclient.conf.erb'), notify => Service['splunkforwarder'], }

if $mgmthostport != undef ... (more)

edit retag flag offensive close merge delete

Comments

Holy Shit

puser gravatar imagepuser ( 2017-04-24 06:29:04 -0600 )edit

If I am not mistaken all this code above is the syntax for rspec. Which again if I am not mistaken will test your module code. I don't see any substantial module code here. Where did you get your rpm? Splunk? package { 'splunk': ensure => installed, }

puser gravatar imagepuser ( 2017-04-24 06:31:49 -0600 )edit