有没有办法将所有现有的 ssh 密钥从 /root/.ssh/authorized_keys 自动导入 puppet?例子:
如果我在 /root/.ssh/ssh_authorized_keys 中有以下内容:
ssh-rsa AAAAakljsehrkjysdfjkhasdkfhskjghg== userA@hostA
ssh-rsa AAAAajklrkljeykljrsyehkrjryekjdkj== userB@hostB
我想运行类似的东西:
puppet resource ssh_authorized_key
并获得以下输出:
ssh_authorized_key {'userA':
ensure => present,
key => 'AAAAakljsehrkjysdfjkhasdkfhskjghg==',
type => 'ssh-rsa',
name => 'userA@hostA',
user => 'root',
}
ssh_authorized_key {'userB':
ensure => present,
key => 'AAAAajklrkljeykljrsyehkrjryekjdkj==',
type => 'ssh-rsa',
name => 'userB@hostB',
user => 'root',
}
这有可能吗?