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.
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.