Ask Your Question
0

fileserver to agent

asked 2015-05-26 14:29:44 -0500

pup-master gravatar image

I want my agent download a rpm and execute "rpm -Uvh" on it.

My master's fileserver.conf has

[fs]
        path /etc/storage/
        allow *

and etc/storage has

storage]$ ls /etc/storage/
jdk-8u45-linux-x64.rpm  my.cnf

my pp has

    file { "/home/oracle/Downloads/jdk-8u45-linux-x64.rpm":
            owner => "root", 
            source => "puppet:///fs/jdk-8u45-linux-x64.rpm",
         }


   exec { 'java':
    command => "sudo rpm -Uvh jdk-8u45-linux-x64.rpm",
    path => "${srcdir}/",
    logoutput => "on_failure",
  } ->

agent errors as:

jira ~]$ sudo puppet agent --verbose --no-daemonize --onetime
sudo: /etc/sudoers.d/proxy is world writable
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for jira.oracle
Info: Applying configuration version '1432667489'
Error: Could not set 'file' on ensure: No such file or directory - /home/oracle/Downloads/jdk-8u45-linux-x64.rpm20150526-3191-1cphghf.lock at 16:/etc/puppet/environments/production/manifests/init.pp
Error: Could not set 'file' on ensure: No such file or directory - /home/oracle/Downloads/jdk-8u45-linux-x64.rpm20150526-3191-1cphghf.lock at 16:/etc/puppet/environments/production/manifests/init.pp
Wrapped exception:
No such file or directory - /home/oracle/Downloads/jdk-8u45-linux-x64.rpm20150526-3191-1cphghf.lock
Error: /Stage[main]/Fishcruc/File[/home/oracle/Downloads/jdk-8u45-linux-x64.rpm]/ensure: change from absent to file failed: Could not set 'file' on ensure: No such file or directory - /home/oracle/Downloads/jdk-8u45-linux-x64.rpm20150526-3191-1cphghf.lock at 16:/etc/puppet/environments/production/manifests/init.pp
Error: Could not find command 'sudo'
Error: /Stage[main]/Fishcruc/Exec[java]/returns: change from notrun to 0 failed: Could not find command 'sudo'
Notice: /Stage[main]/Fishcruc/File[/etc/environment]: Dependency Exec[java] has failures: true
Warning: /Stage[main]/Fishcruc/File[/etc/environment]: Skipping because of failed dependencies
Notice: /Stage[main]/Fishcruc/Wget::Fetch[ficr]/Exec[wget-ficr]: Dependency Exec[java] has failures: true
Warning: /Stage[main]/Fishcruc/Wget::Fetch[ficr]/Exec[wget-ficr]: Skipping because of failed dependencies
Notice: /Stage[main]/Fishcruc/Exec[ficr]: Dependency Exec[java] has failures: true
Warning: /Stage[main]/Fishcruc/Exec[ficr]: Skipping because of failed dependencies
Notice: /Stage[main]/Fishcruc/Exec[start]: Dependency Exec[java] has failures: true
Warning: /Stage[main]/Fishcruc/Exec[start]: Skipping because of failed dependencies
Notice: Finished catalog run in 57.12 seconds

What am I doing wrong here?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-05-26 15:55:21 -0500

lavaman gravatar image

It is likely that /home/oracle/Downloads does not exist. Also, instead of having exec run rpm, you should use the package type with a provider of rpm:

https://docs.puppetlabs.com/reference...

edit flag offensive delete link more

Comments

that did it. thanks for your time!!

pup-master gravatar imagepup-master ( 2015-05-26 16:47:13 -0500 )edit
0

answered 2015-09-30 10:52:53 -0500

Narahari gravatar image

This is more of a question for the custom mount point which is on the same lines as above.

I have the following on the puppet master

[service_misc]   path
/opt/service/scripts/misc
allow *

On the puppet agent I run the command

sudo puppet apply--write-catalog-summary -e "file {'/home/virtual/test.sh': ensure => file, recurse => remote, owner  => 'root', group => 'root', source => 'puppet:///service_misc/test.sh', mode => 755, replace => 'yes',}"

I see the following error

Error: /Stage[main]/Main/File[/home/virtual/test.sh]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///service_misc/test.sh

Not sure what I am doing wrong.

-Narahari

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: 2015-05-26 14:29:44 -0500

Seen: 363 times

Last updated: Sep 30 '15