cannot run command from puppet to update servers for puppet agent using puppet enterprise

StackOverflow https://stackoverflow.com/questions/22510706

  •  17-06-2023
  •  | 
  •  

Question

I can run almost every other command via Puppet Enterprise Master to Agent, but the update command will not run. PE does run as root as far as I know.

Can someone please suggest how to get this command working on Linux from Puppet.

exec { "sudocmd" :
        cwd => "/usr/bin/",
        path => ["/usr/bin/","/usr/sbin/","/bin"],
    command => "yum update -y",
    timeout => "-1",
    logoutput => "on_failure",
     }
Was it helpful?

Solution

Either run puppet agent as root (which as far as I know is a common practice) or add suid on yum to allow others to run it as root (risky!) or run "sudo yum update -y" and add your puppet agent user to sudoers without password prompt.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top