我在 CentOS 7 机器上安装了 Puppet 5。https://yum.puppet.com/puppet/
安装成功,我可以运行puppet apply
一个简单的清单,如下所示:
file {'/tmp/example-ip':
ensure => present,
mode => '0644',
content => "Here is my Public IP Address: ${ipaddress_eth0}.\n",
}
但如果我尝试通过 Puppet 创建用户和组,我总是收到以下错误消息:
Error: Could not find a suitable provider for user
Error: Could not find a suitable provider for group
以下是产生这些错误的清单:
group { 'team-berlin':
ensure => present,
}
group { 'team-london':
ensure => present,
}
根据输出,用户和组类型应该存在puppet resource
:
$ puppet resource --types
...
file
filebucket
group
host
...
tidy
user
...
为什么我会收到此错误消息?我错过了什么?
答案1
要使用用户/组之类的资源(依赖于 useradd/groupadd 之类的二进制文件),您必须puppet apply
以 root 身份或使用 root 权限运行。