![](/img/trans.png)
[英]Could not set unknown property 's' for source set main of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet
[英]Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/toolchain
我正在嘗試編寫一個簡單的資源來將可怕的內容從傀儡大師復制到傀儡代理。
file { "/usr/local/scaligent/" :
ensure => 'directory',
source => "puppet:///modules/toolchain",
recurse => 'true',
#owner => 'root',
#group => 'root',
#mode => '0755',
}
源是 /etc/puppetlabs/code/environments/production/modules/files/toolchain/ 在 puppet master 中,目標是 /usr/local/scaligent/ 在 puppet agent 中。
在傀儡代理中出現以下錯誤:
[~]$ sudo puppet agent -tv --noop
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Applying configuration version '1600365429'
Error: /Stage[main]/Main/File[/usr/local/scaligent/]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/toolchain
Notice: Applied catalog in 0.04 seconds
[ ~]$
根據 Puppet 資源類型參考, puppet:
URI 的形式是
puppet:///modules/<MODULE NAME>/<FILE PATH>
它指的是模塊中文件或目錄的內容,Puppet 將在該模塊的files
目錄中查找它。 文件系統路徑類似於/etc/puppetlabs/code/environments/production/modules/<MODULE NAME>/files/toolchain
您嘗試使用的 URI puppet:///modules/toolchain
格式不正確,並且您嘗試引用的路徑不在任何模塊的files/
目錄中。
盡管不是必需的,但將“ toolchain
”目錄放在包含資源聲明的模塊的文件中是常規的,盡管不是必需的。 但是,將File
聲明放在一個類中、一個模塊中也是慣例,而您還沒有這樣做。 在大約零種情況下,在頂級范圍內聲明該資源是一種很好的風格,就像您所做的那樣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.