gpt4 book ai didi

apache - 在 Vagrant 上从 Puppetlabs 安装 Apache

转载 作者:行者123 更新时间:2023-12-04 05:41:50 25 4
gpt4 key购买 nike

我是新手,我想我只是错过了一件事来了解问题的真正含义。

我知道我可以创建自己的 puppet 模块,将某些包页面安装到 vagrant 实例。还有一些现成的,像这样apache .我跑了vagrant ssh 并使用 puppet module install puppetlabs/apache 安装它。它现在位于 /etc/puppet/modules/apache 下。但是,没有安装 apache。

那么,如何安装 apache

在我的 Vagrantfile 中有

config.vm.provision :puppet do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.module_path = "puppet/modules"
puppet.manifest_file = "init.pp"
puppet.options="--verbose --debug"
end

另外,在主 vagrant 目录中,在 puppet/modules/apache/manifests/init.pp 下:

class apache2::install {
package { 'apache2':
ensure => present,
}
}

然而,在 vagrant provisionvagrant reload 之后没有安装 apache,或者我猜,安装过程甚至没有开始。在 vagrant provision 之后登录,其消息在我看来完全神秘。

[default] Running provisioner: puppet...
Running Puppet with init.pp...
debug: Creating default schedules
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not exist
debug: Puppet::Type::User::ProviderUser_role_add: file rolemod does not exist
debug: Puppet::Type::User::ProviderLdap: true value when expecting false
debug: Puppet::Type::User::ProviderPw: file pw does not exist
debug: Failed to load library 'ldap' for feature 'ldap'
debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/facts]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]
debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/lib/puppet/state]
debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet]
debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
debug: Finishing transaction 70208664910260
debug: Loaded state in 0.00 seconds
debug: Loaded state in 0.00 seconds
info: Applying configuration version '1389652562'
debug: /Schedule[daily]: Skipping device resources because running on a host
debug: /Schedule[monthly]: Skipping device resources because running on a host
debug: /Schedule[hourly]: Skipping device resources because running on a host
debug: /Schedule[never]: Skipping device resources because running on a host
debug: /Schedule[weekly]: Skipping device resources because running on a host
debug: /Schedule[puppet]: Skipping device resources because running on a host
debug: Finishing transaction 70208665347780
debug: Storing state
debug: Stored state in 0.00 seconds
notice: Finished catalog run in 0.05 seconds
debug: Finishing transaction 70208665012580
debug: Received report to process from localhost.localdomain
debug: Processing report from localhost.localdomain with processor Puppet::Reports::Store

最佳答案

你告诉 Vagrant 它应该在 puppet/manifests(相对于你的 Vagrant 目录)中寻找 list ,并且它应该根据 init 中的任何内容配置机器。 pp,它将在 puppet/manifests 中查找(根据您的说明)。也就是说,Vagrant 将安装 puppet/manifests/init.pp 中的任何内容。它不会查看 puppet/modules/apache/manifests/init.pp(至少一开始不会)。

puppet/manifests/init.pp 中加入类似以下的内容,它应该可以正确安装。

class {'apache':}

除了 apache 模块之外,请确保您的 puppet/modules 目录中也安装了所有依赖项(本例中是 Puppetlabs 中的 stdlib 和 concat 模块)。

关于apache - 在 Vagrant 上从 Puppetlabs 安装 Apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21102696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com