2016-04-07 89 views
0

我最近開始使用Vagrant和Puppet,而且我很難讓puppet工作。配置vagrant的puppetlabs/apache模塊問題

與傀儡我想改變apache用戶和羣體vagrant解決共享文件夾時的權限問題。

我想通過做以下木偶配置

class { "apache": 
    user => "vagrant", 
    group => "vagrant", 
} 

參考:http://ryansechrest.com/2014/04/unable-set-permissions-within-shared-folder-using-vagrant-virtualbox/

爲此,我安裝了傀儡我的主機和客戶機上,主機上,我增加以下cofig在Vagrantfile

config.vm.provision :puppet do |puppet| 
    puppet.manifests_path = 'puppet/manifests' 
    puppet.module_path = 'puppet/modules' 
end 

並在主機上創建文件puppet/manifests/default.pp,內容如下

node 'node1' { 

    include apache 

    class { "apache": 
     user => "vagrant", 
     group => "vagrant", 
    } 
} 

當我運行流浪漢規定,我得到以下錯誤

==> default: Error: Could not find default node or by name with 'localhost' on node localhost 
==> default: Error: Could not find default node or by name with 'localhost' on node localhost 
The SSH command responded with a non-zero exit status. Vagrant 
assumes that this means the command failed. The output for this command 
should be in the log above. Please read the output to determine what 
went wrong. 

我在哪裏去了?

回答

1

只要保持它的簡單:

爲此,我安裝了傀儡我的主機和客戶機上,

你只需要木偶被你的客戶機上安裝,你可以保持您的主機清潔

您引用和定義puppet/manifests/default.pp這是很好的,只是刪除節點部分

Package { 
    allow_virtual => true, 
} 

class { "apache": 
    user => "vagrant", 
    group => "vagrant", 
} 

include apache 

你可以確認你有一個apache模塊在你的主機puppet/modules或安裝在客戶機 - 你可以有條文,運行類似

#!/bin/bash 

mkdir -p /etc/puppet/modules; 

if [ ! -d /etc/puppet/modules/puppetlabs-apache ]; then 
    puppet module install puppetlabs-apache 
fi 

假設你談this apache模塊,否則與模塊你」取代重新使用,如果它來自僞造

+0

我有模塊安裝,我得到它的工作前一段時間,但它給了我一些通知說少數語法不推薦使用,這是正常的嗎? –

+0

哦對,可能需要添加'allow_virtual => true',編輯我的答案,它應該像這樣通過 –