我的目标是设置一个包含某种http服务器(lighttpd atm),PHP 5.2,一些SQL数据库(MySQL)和PhpMyAdmin的Vagrant Box。
我使用trusty64框并且为了满足PHP 5.2的要求,我已经导入了旧的ubuntu存储库。
以下是我的文件:
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 3306, host: 3306
config.vm.provision "shell",
inline: "sudo add-apt-repository 'deb http://old-releases.ubuntu.com/ubuntu karmic main'"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "start.pp"
puppet.module_path = "puppet/modules"
puppet.options = "--verbose"
end
end
木偶/舱单/ start.pp
# Puppet configurations
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
include aptupdate
include lighttpd
include php52
#include mysql
#include phpmyadmin
木偶/模块/ aptupdate /舱单/ init.pp
class aptupdate {
exec {"apt-get-update":
command => "apt-get update",
path => "/usr/bin"
}
}
木偶/模块/ aptupdate /舱单/ init.pp
class lighttpd{
package {
'lighttpd':
ensure => installed
}
service {
'lighttpd':
ensure => running,
enable => true,
require => Package['lighttpd']
}
}
木偶/模块/ aptupdate /舱单/ init.pp
class php52{
$phpversion = "5.2.10.dfsg.1-2ubuntu6"
package { "php5":
ensure => $phpversion,
}
package { "php5-common":
ensure => $phpversion,
require => Package["php5"],
}
package { "php5-mysql":
ensure => $phpversion,
require => Package["php5", "php5-common"],
}
}
问题
我添加了一个很好的MySQL模块,最后是一个PhpMyAdmin模块,你可以在start.pp中看到。 PhpMyAdmin要求php5-mysql作为依赖项,所以我已将它添加到php5 / init.pp中。这导致php5-mysql的常见依赖,也是我添加的。之后它需要php5,所以我已将它添加到require =>包列。 但现在,再次询问第一个要求,我不知道如何通过安装php 5.2来改变成功
以下是错误消息
==> default: Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-mysql=5.2.10.dfsg.1-2ubuntu6' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: Some packages could not be installed. This may mean that you have
==> default: requested an impossible situation or if you are using the unstable
==> default: distribution that some required packages have not yet been created
==> default: or been moved out of Incoming.
==> default: The following information may help to resolve the situation:
==> default:
==> default: The following packages have unmet dependencies:
==> default: php5-mysql : Depends: php5 but it is not going to be installed or
==> default: phpapi-20060613
==> default: E: Unable to correct problems, you have held broken packages.
==> default: Error: /Stage[main]/Php52/Package[php5-mysql]/ensure: change from purged to 5.2.10.dfsg.1-2ubuntu6 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install php5-mysql=5.2.10.dfsg.1-2ubuntu6' returned 100: Reading package lists...
==> default: Building dependency tree...
==> default: Reading state information...
==> default: Some packages could not be installed. This may mean that you have
==> default: requested an impossible situation or if you are using the unstable
==> default: distribution that some required packages have not yet been created
==> default: or been moved out of Incoming.
==> default: The following information may help to resolve the situation:
==> default:
==> default: The following packages have unmet dependencies:
==> default: php5-mysql : Depends: php5 but it is not going to be installed or
==> default: phpapi-20060613
==> default: E: Unable to correct problems, you have held broken packages.
对于提示,我非常感激