Hi JCBollinger, Thank you so much for your suggestions.

Here goes my manifests:


#init.pp

class rabbitmq {
    include rabbitmq::source, rabbitmq::service
} 


#source.pp

class rabbitmq::source {
    file { "/home/user": ensure => directory }
    file { "/home/user/rabbitmq-server-generic-unix-2.8.7.tar.gz":
source => 
"puppet:///modules/rabbitmq/rabbitmq-server-generic-unix-2.8.7.tar.gz",
alias => "rabbitmq-source-tgz",
before => Exec["untar-rabbitmq-source"]
    }
    exec { "/bin/tar xzvf rabbitmq-server-generic-unix-2.8.7.tar.gz":
cwd => "/home/user/",
creates => "/home/user/rabbitmq_server-2.8.7",
alias => "untar-rabbitmq-source",
subscribe => File["rabbitmq-source-tgz"]
    }
} 

#service.pp

class rabbitmq::service  {
  exec { "rabbitmq_service":
      environment => "HOME=/home/user",
      command=> "/home/user/rabbitmq_server-2.8.7/sbin/rabbitmq-server 
-detached ",
      require => Class["rabbitmq::source"]
   }
  }

We dont have root permissions, as we are hosting it in the Cloud.

But when I do extract the unix.tar.gz in user mode without any root 
permissions manually ,  and execute the ./sbin/rabbitmq-server, it gets 
executed.

I really appreciate your suggestions and thoughts.

Thanks again,

Dominic.




On Monday, October 22, 2012 6:54:47 AM UTC-7, jcbollinger wrote:
>
>
>
> On Friday, October 19, 2012 9:38:25 AM UTC-5, Dominic wrote:
>>
>> Hi everyone,
>>
>> Here is the task, I just need to get the file from master, untar it and 
>> execute a file.
>>
>> Step 1: 
>>
>> Working as a root user,having the default puppet.conf for root and the 
>> agent could get the source file  from master , untar it and execute it.
>>
>> Step 2: 
>>
>> Moving to non-root user, I have a different puppet.conf with the conf the 
>> master validates the agent and gets me the source , and untar it to the 
>> agent , but on the agent side I got the error. 
>>
>>
>> Here is my puppet.conf
>>
>> [main]
>>     logdir = /home/user/var/log/puppet
>>     rundir = /home/user/var/run/puppet
>>     vardir = /home/user/var/lib/puppet
>>     ssldir = $vardir/ssl
>>  
>>     server=puppetmaster.example.com
>> [agent]
>>     classfile = $vardir/classes.txt
>>     localconfig = $vardir/localconfig
>> [master]
>>     certname=puppetmaster.example.com
>>
>> On executing, 
>>
>> puppet agent --confdir-/home/user/etc -t, 
>>
>> Error: Failed to set group to '0': Operation not permitted - 
>> /home/user/unix.tar.gz
>> Error: /File[/home/user/unix.tar.gz]/ensure: change from absent to file 
>> failed: Failed to set group to '0': Operation not permitted - 
>> /home/user/.tar.gz
>>
>> Though I set the tarball of the source in master to 777 permissions, I 
>> get the same error.
>>
>> Your help is great appreciated, please let me know if you need any 
>> further info.
>>
>>
> This problem is not directly related to puppet.conf.  It is probably in 
> issue in your init.pp file on the master (because that appears to be where 
> you declare File[/home/user/unix.tar.gz]).  The manifest leads Puppet to 
> believe that the target file is supposed to have group 0, but changing the 
> downloaded file's group requires the agent to run as root.
>
> If you post the declaration of that file, then we may be able to tell you 
> more.
>
> I have a question, though: what is the purpose of having this run by an 
> unprivileged user in the first place?
>
>
> John
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/pW5PcOypT24J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to