Why is apache installing?

asked 2016-04-05 13:47:40 -0500

alex.barylski gravatar image

This is such odd behavior

  1. I am invoking puppet through vagrant provisioner
  2. I am using puppetlabs/debian-7.8-64-puppet as the base image

The host machine in my case is Windows 7 - the following code worked fine:

file_line { "Append required NGINX parameters":       
  path  => "/etc/nginx/fastcgi_params",  
  line => file("nginx/params.conf"),  
}

But when running under windows 10 (or 8) puppet failed and complained about file paths - so we changed it to this:

file_line { "Append required NGINX parameters":
  require => Package["nginx"],
  path => "/etc/nginx/fastcgi_params",
  line => file("/var/www/.vagrant/puppet/modules/nginx/files/params.conf"),
}

This seems to have corrected the issue in getting puppet to complete in Windows 7,8 and 10 - but now I have another issue cropping up and it has to do with Apache actually loading (even though there is no reference to apache anywhere in my puppet script.

Here is the entire puppet script:

#
# Install all required packages
#

$packages = [
    "curl",

    "nginx",

    #"php5-gd",        
    #"php5-cli", 
    "php5-fpm", 
    "php5-ldap",
    #"php5-mysql",

    "mysql-server",

    "htmldoc",
]

package { $packages:
    ensure => present,
}

#
# Configure PHP-FPM
#

service { "php5-fpm":
    ensure => running,
    require => Package['php5-fpm'],
}

#
# Configure NGINX
#

service { "nginx":
  require => Package["nginx"],
  ensure => running,
  enable => true
}

file { "/etc/nginx/sites-available/default":
  ensure => "file",
  require => Package["nginx"],
  content => file("/var/www/.vagrant/puppet/modules/nginx/files/aerospace"),
}

file_line { "Append required Cadorath Aerospace NGINX parameters":
  require => Package["nginx"],
  path => "/etc/nginx/fastcgi_params",
  line => file("/var/www/.vagrant/puppet/modules/nginx/files/params.conf"),
}

Whenever I uncomment php5-gd or php5-mysql - Apache is somehow magically loaded and takes precedence over NGINX???

I literally will uncomment that line - rebuild machine SSH and run a ps -aux and suddenly I see Apache not NGINX serving my pages

Why is this suddenly happening? Why is Apache being installed period? Is the base-image buggy? I used a newer version and it solved the original problem above - but ships with a version of PHP which deprecates an API which our still depends on - so I couldn't go down that path.

Ideas?

edit retag flag offensive close merge delete

Comments

If you're using wheezy, php5-gd etc. needs phpapi as dependency which then will default install libapache2-mod-php5 and of course apache2.
So it should work, when you install php5-fpm at first as it provides phpapi too. Link: https://packages.debian.org/wheezy/phpapi-20100525.

FranzCC gravatar imageFranzCC ( 2016-04-06 00:50:00 -0500 )edit