I have a puppet class 'php' which looks like the following:
class php { case $operatingsystem { debian: { package {'php5-common': ensure => latest, provider => apt, } package {'php5-mysql': ensure => latest, provider => apt} package {'php5-gd': ensure => latest, provider => apt} package {'php5-fpm': ensure => latest, provider => apt} package {'php5-mcrypt': ensure => latest, provider => apt} package {'php5-memcache': ensure => latest, provider => apt} } } service { 'php5-fpm': ensure => running, enable => true, } }
I include the php class in the node configuration in /etc/puppet/manifests/site.pp
It looks like
node 'example' { include php }
When I run puppet agent -t on the client it installs the packages, but it installs kind of too much. It also installs apache and I don't know where it gets it from. I don't have any config in puppet for apache.
I guess it's using the debian recommendations or suggestions, but I'm not sure, because I disabled that on the server.
cat > /etc/apt/apt.conf.d/01norecommendThe log output on the client is
Info: Retrieving plugin Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb Info: Loading facts in /var/lib/puppet/lib/facter/last_run.rb Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb Info: Loading facts in /var/lib/puppet/lib/facter/puppi_projects.rb Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb Info: Caching catalog for eample Info: Applying configuration version '1383041633' Error: Could not prefetch package provider 'apt': invalid byte sequence in US-ASCII Notice: /Stage[main]/Php/Package[php5-mysql]/ensure: ensure changed 'purged' to 'latest' Notice: /Stage[main]/Php/Package[php5-gd]/ensure: ensure changed 'purged' to 'latest' Notice: /Stage[main]/Php/Package[php5-mcrypt]/ensure: ensure changed 'purged' to 'latest' Notice: /Stage[main]/Php/Package[php5-memcache]/ensure: ensure changed 'purged' to 'latest' Notice: /Stage[main]/Php/Package[php5-fpm]/ensure: ensure changed 'purged' to 'latest' Notice: Finished catalog run in 11.31 secondsThe following packages are installed after that
ii apache2-mpm-prefork 2.2.22-13 amd64 Apache HTTP Server - traditional non-threaded model ii apache2-utils 2.2.22-13 amd64 utility programs for webservers ii apache2.2-bin 2.2.22-13 amd64 Apache HTTP Server common binary files ii apache2.2-common 2.2.22-13 amd64 Apache HTTP Server common files ii libapache2-mod-php5filter 5.4.4-14+deb7u5 amd64 server-side, HTML-embedded scripting language (apache 2 filter module) ii libapache2-mod-php5filter 5.4.4-14+deb7u5 amd64 server-side, HTML-embedded scripting language (apache 2 filter module) ii php5-common 5.4.4-14+deb7u5 amd64 Common files for packages built from the php5 source ii php5-fpm 5.4.4-14+deb7u5 amd64 server-side, HTML-embedded scripting language (FPM-CGI binary) ii php5-gd 5.4.4-14+deb7u5 amd64 GD module for php5 ii php5-mcrypt 5.4.4-14+deb7u5 amd64 MCrypt module for php5 ii php5-memcache 3.0.6-6 amd64 memcache extension module for PHP5 ii php5-mysql 5.4.4-14+deb7u5 amd64 MySQL module for php5
When I run apt-get install $php-package-names it won't install apache, just when I use apache. That's kind of annoying, because I'm going to use nginx.
Do you have an idea how I can get puppet to install the packages normally without apache as dependency?