Puppet 当主机文件具有非标准位置时,如何清除非托管主机条目?
我正在使用资源主机。在我的实验中,如果主机资源使用非标准目标,则资源类型“resources”没有影响Puppet 当主机文件具有非标准位置时,如何清除非托管主机条目?,puppet,hosts,Puppet,Hosts,我正在使用资源主机。在我的实验中,如果主机资源使用非标准目标,则资源类型“resources”没有影响 resources { 'host': purge => true, } host { 'localhost.localdomain': ip => '127.0.0.1', target => '/chroot/etc/hosts', } 当我使用target/etc/hosts并删除或重命名主机资源时,输出为: Info:
resources { 'host':
purge => true,
}
host { 'localhost.localdomain':
ip => '127.0.0.1',
target => '/chroot/etc/hosts',
}
当我使用target/etc/hosts并删除或重命名主机资源时,输出为:
Info: Applying configuration version '1560267493'
Notice: /Stage[main]/Profile:abc:Hosts/Host[localhost.localdomain]/ensure: removed
Info: Computing checksum on file /etc/hosts
Notice: /Stage[main]/Profile::abc:Hosts/Host[localhost.localdomain]/ensure: created
当我使用非标准目标时,例如/chroot/etc/hosts,什么都不会发生。(如果重命名该条目,则只创建另一个主机条目)
另一个奇怪的行为是,当代理节点上没有/etc/hosts文件时,会抛出一个错误:(即使我使用的是不同的目标)
错误:找不到适用于主机的提供程序
版本:Puppetserver:5.3.8,puppet agent:4.10.8
我正在使用资源主机。在我的实验中,如果主机资源使用非标准目标,则资源类型“resources”没有影响
resources { 'host':
purge => true,
}
host { 'localhost.localdomain':
ip => '127.0.0.1',
target => '/chroot/etc/hosts',
}
这并不奇怪。resources
资源类型只能清除指定资源类型“预取”的资源实例。对于主机
资源类型,这是默认主机文件中记录的主机。这就是有文档记录的限制的原因,Resources
无法清除typessh\u authorized\u key
。因此,对于其他目标文件中的主机,Puppet无法识别要清除的资源
另一个奇怪的行为是当服务器上没有/etc/hosts文件时
代理节点将抛出一个错误:(即使我使用的是不同的
目标。)错误:找不到适用于主机的提供程序
我认为这是一个错误。你可以考虑。