1
我是新來的木偶和計劃在我們的環境中實施它。在木偶中使用因素事實
我有在不同版本的Redhat上運行的puppet代理。
現在,我打算推動來自木偶大師的回購文件,我需要你的指導來實現它。
我有以下清單。
file { 'local_repo':
ensure => file,
path => '/etc/yum.repos.d/local.repo',
mode => "600",
source => 'puppet:///modules/repo/rhel7.1',
}
file { 'local_repo':
ensure => file,
path => '/etc/yum.repos.d/local.repo',
mode => "600",
source => 'puppet:///modules/repo/rhel6.7',
}
當我執行Facter CLI時,我得到下面的輸出。
[[email protected] ~]# facter os
{
architecture => "x86_64",
family => "RedHat",
hardware => "x86_64",
name => "RedHat",
release => {
full => "7.2",
major => "7",
minor => "2"
}
}
我想利用上面的輸出並相應地執行我的清單。也就是說,如果puppet代理在Redhat 7.1上執行,那麼Puppet master使用相應的文件。
非常感謝馬特,小錯誤是您錯過了添加版本。 source =>「puppet:/// modules/repo/rhel $ {facts ['os'] ['release'] ['full']}」, – sagar
@sagar真的,我誤解了上面的事實散列。爲此編輯答案。如果這個答案對你有幫助,那麼請接受它。 –
我沒有找到答案。請標記爲已解決 – sagar