服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

从特定variables/ fact / hiera-value加载hiera文件

我正在试图根据一个特定的标志加载一个hiera文件。 Hiera hierarachyconfiguration是 :hierarchy: – "%{environment}/%{::fqdn}" – "%{environment}/%{nodetype}" – "%{environment}/%{calling_module}" – "%{environment}" – "common/%{calling_module}" – "common" 事实上,想要在“节点types”级别上分解一些configuration。 目标是避免在文件中放置相同的hiera“块”: 环境/testing/ myhost1.example.com.yaml 环境/testing/ myhost2.example.com.yaml 环境/testing/ myhost3.example.com.yaml 但相反,但共同的部分在: environment / test / nfs-server.yaml为所有与nfs服务器相关的常用configuration 环境/testing/后端服务器.yaml所有后端服务器相关的共同点 之后,所有的服务器都会通过fqdn yaml文件获得自己的特定值。 (这部分是确定的) 目前,我不知道如何将“nodetype”数据提供给hiera上下文。 我试图把它放在主要的清单文件中(是​​的,我读了文档,我知道这是一个坏主意,但即使绝望的尝试,它不工作) node 'nfs1.example.com', 'nfs2.example.com' { $nodetype= 'nfs-server' 但文件environment / test / nfs-server.yaml不是由hiera加载的。 我也尝试使用自定义事实,但使用自定义的事实 modules/hosts/facts.d/host-fact-test.txt 文件发送到代理的主机,但在这里,hiera不使用专用文件。 Notice: /File[/var/lib/puppet/facts.d/host-fact-test.txt]/ensure: defined content as […]