Articles of 傀儡

木偶无法安装正常安装的Rubygem

我正在使用以下方法来尝试使用Puppet安装Rubygem。 package { 'reaper': ensure => 'installed', provider => 'gem', source => 'http://192.168.1.101:9292/', install_options => ['–no-ri', '–no-rdoc'] } 当我运行puppet agent –test我得到以下错误。 Error: Execution of '/usr/bin/gem install –source http://192.168.1.101:9292/ reaper' returned 1: ERROR: While executing gem … (NameError) uninitialized constant Gem::RemoteFetcher::OpenSSL Error: /Package[reaper]/ensure: change from absent to present failed: Execution of '/usr/bin/gem install –source http://192.168.1.101:9292/ reaper' […]

手动设置MD5哈希后,用户无法login

我正在使用Puppet来pipe理用户密码。 (是的,我知道LDAP比较好,但是我从上级被告知使用Puppet)。我有这个类,当以root身份运行时,将bob的密码更改为“bobs_new_password”。 当bob运行它的时候,理想情况下应该提示input一个新的密码,但是我应该可以在以后添加这个function。 当我以puppet agent –test root puppet agent –test运行它时,它表示一切正常,并通知我新的散列,所以我知道它已经在/etc/shadow文件中正确设置了。 现在,我只和虚拟机上的testing用户合作,所以我并不担心通知散列的安全风险; 该行显然将被取代为工作版本的代码。 我到目前为止是这样的: class pwdchange ($newpwd = 'bobs_new_password', $targetuser = "bob") { $temp = inline_template("<%= Digest::MD5.digest(scope.lookupvar('newpwd'))%>") $hashtypeidentifier = '$1$' #'$1' for MD5, '$6' for sha512. user {"$targetuser": ensure => present, password => "${hashtypeidentifier}${temp}", } notify {"${temp}":} } 但是,当我以sob的身份login到虚拟机时,旧密码或新密码都不被接受。 我究竟做错了什么? 为什么不接受任何一个密码,我能做些什么来解决它?

木偶通知:current_value缺席,应该存在

我试图通过puppet(v 3.2.4)添加一个用户,并在–noop上得到这个通知: 注意:/ stage [main] / usergroup / group [user_one] / ensure:current_value不存在,应该存在(noop) 这是我的清单: # usersgroups class usergroup { group { "user_one": ensure => present, gid => 500, } group { "dev_website_1": ensure => present, gid => 501, } group { "dev_website_2": ensure => present, gid => 502, } user { "user_one": ensure => present, uid […]

“/ usr / bin / env:bash:在puppet exec命令中没有这样的文件或目录”

我正在开始傀儡的第一步。 我正在设置ambari 。 这是我的木偶configuration: exec { "ambari-repo": command => "curl http://public-repo-1.hortonworks.com/ambari/suse11/1.x/updates/1.4.4.23/ambari.repo > /etc/yum.repos.d/ambari.repo", path => ["/usr/bin", "/usr/sbin"] } package {"ambari-server": ensure => installed, require => Exec["ambari-repo"] } file { "hadoop-dir": path => "/hadoop", ensure => "directory" } exec { "ambari-server-setup": command => "ambari-server setup -s", path => ["/usr/bin", "/usr/sbin"], cwd => "/hadoop", user => "root", […]

在MacOS X上,我可以从Puppet或命令行configurationWifi吗?

我想通过Puppet在每个Mac上为公司的Wifi创build条目。 这可能吗? (或者如果可以从命令行,我可以弄清楚如何在Puppet中做到这一点)

如何使用Hiera实例化相同资源的多个实例

使用Hiera,是否有可能实例化具有不同属性的两个类? 我知道我可以添加到我的节点声明: user{'francois': uid => 1000, # … } user{'julien': uid => 1001, # … } 有没有办法从Hiera做到这一点?

迁移到木偶4.5.2

我们正在迁移到更高版本的puppet。 新版本: # puppet –version 4.5.2 现有版本: #puppet-3.8.7 我们现有的site.pp如下: #A default site.pp to do a quick test run import "../classes/*" import "../nodes/*" file { 'testfile': path => '/home/test/testfile', ensure => present, mode => 0755, content => "A test file to check a different manifestdir" , } Exec { path => ["/bin" , "/sbini/", "/usr/bin" , […]

使用puppet创build多个目录

我正在尝试使用下列清单创build多个目录 class app { $dirs = app8 $appdirs = ['/data/tomcat/app8/conf', '/data/tomcat/app8/config', '/data/tomcat/app8/libs', '/data/tomcat/app8/deploy', '/data/tomcat /app8/webapps', '/data/tomcat/app8/temp', '/data/tomcat/app8/work'] file { "/data/tomcat/$dirs": path => "/data/tomcat/$dirs", ensure => directory, owner => root, group => root, } file { "$appdirs": path => '$appdirs', ensure => directory, owner => root, group => root, mode => 0644, } } 但是,当我执行它是失败与下面的错误 # […]

木偶saz / sudo模块implmentation

我试图部署saz / sudo模块来pipe理我们的sudoconfiguration(我对puppet(〜3day)很新,所以请原谅我的潜在无知)。 我们目前的sudoconfiguration都包含在一个单独的(大的)/ etc / sudoers文件中,我想在sudoers.d中分解成相关的文件。 我已经能够安装saz / sudo模块,但一直在摸索configuration它。 我现在通过使用下面的configuration将它包含在另一个模块site_sudo中: # cwd : /etc/puppetlabs/code/environments/production/modules site_sudo/examples site_sudo/files site_sudo/Gemfile site_sudo/manifests site_sudo/metadata.json site_sudo/Rakefile site_sudo/README.md site_sudo/spec site_sudo/examples/init.pp site_sudo/files/etc site_sudo/files/etc/sudoers.d site_sudo/files/etc/sudoers.d/svc_servicenanme site_sudo/files/etc/sudoers.d/user_username site_sudo/manifests/init.pp site_sudo/spec/classes site_sudo/spec/spec_helper.rb site_sudo/spec/classes/init_spec.rb 与init.pp的内容如下: [root@puppet modules]# cat site_sudo/manifests/init.pp | grep -vP '^#' class site_sudo { class { 'sudo': } sudo::conf { 'user_username': source => 'puppet:///modules/site_sudo/etc/sudoers.d/user_username', } […]

Git:通过ssh推送到ssh rootlogin被禁用的根拥有的存储库

这甚至有可能吗? 总结,我在服务器上运行木偶大师,理想情况下,我们希望通过ssh禁用rootlogin,如果需要root访问,我们希望通过sudo强制所有访问 但是我们有使用git repo来pipe理清单的puppet,这个repo目前由root拥有,目前我只知道2个解决scheme (较不理想)只允许通过密钥authentication的根访问 – 如果是这样,我可以locking它只允许git推命令? 在/ etc / puppet中拥有不同的所有者的回购 – 这样可以傀儡工作吗? 相关的Sudoconfiguration和命令可以解决这个问题吗?