Reputation: 437
I'm working with RHEL 6 OS, and im trying to write a script that installs packages, that i would install by using the command 'yum install ...'
package { "install-nginx" :
ensure => installed,
name => "nginx",
}
I have several declarations like the above and i even have some exec declarations
exec {"install-git" :
command => "yum install git"
}
neither of these declarations install anything. To do an installation i'm using puppet apply (path to module)
Upvotes: 0
Views: 3347
Reputation: 2199
Your exec will most likely timeout, waiting for the user to input a "y" at the command line. You should have used:
exec {"install-git" :
command => "/bin/yum install git -y"
}
But this is the wrong way to install packages with puppet. Your first code should have worked. Are you sure you don't have nginx installed on the machine already?
If you want to update the packages, you need to use 'latest' for the version:
package { [
'nginx',
'git',
]:
ensure => 'latest',
provider => 'yum',
}
Upvotes: 0