我从RedHat Enterprise Linux 6上的puppetlabs回购站运行puppet open source 3.1.0,并使用hiera 1.1.2。 我遇到了似乎是hiera如何与参数化类一起工作的一个bug或根本的误解。 我已经设置了一个默认值的参数化子类。 我试图在一个特定的节点上设置不同的值。 该节点是在没有类的主要清单之一中声明的,并且在该清单中有hiera_include('classes')。 我正在尝试更改“my_firewall”类中“activate”参数的值。 当我的hiera节点文件如下所示: — classes: – puppetmaster rel::auth_users: ['puppet'] rel::my_firewall::activate: false rel :: my_firewall甚至没有加载(我已经通知两个布尔值的“激活”,没有看到他们)。 rel :: auth_usersparameter passing正常。 rel类是在hiera的父类中定义的。 当我将其更改为: — classes: – puppetmaster – rel::my_firewall rel::auth_users: ['puppet'] rel::my_firewall::activate: false 它加载rel :: my_firewall类,但使用默认值,而不是false值。 作为一个健全性检查,当我在节点清单中以正常方式定义事物时,事情工作正常: node 'puppet.my.domain' { class { 'rel::my_firewall': activate => false, } […]
我们在大约100台服务器上使用RHEL 6.2和Puppet 2.7。 我打算用puppet 3.2将puppet更新到RHEL 6.2。 我知道我必须重写一些清单才能使这些模块正常工作。 但是木偶3.2支持Puppet 2.7客户端,还是必须将所有客户端更新到3.x?
我试图configurationAPT不安装推荐的软件包。 我正在使用puppetforge puppetlabs / apt模块,所以我希望通知该模块的Exec['apt_update']资源。 我正在使用这个: class init { include apt # Configure apt to not install recommends file { "/etc/apt/apt.conf.d/80mymodule-norecommends": ensure => present, owner => root, group => root, mode => 644, source => "puppet:///modules/mymodule/apt/80mymodule-norecommends", notify => Exec['apt_update'], } } 但是,我得到以下错误: 无法在/etc/puppet/modules/mymodule/manifests/apt.pp:18findFile [/etc/apt/apt.conf.d/80mymodule-norecommends]的依赖Exec [apt_update] 我已经尝试了几个语法选项(如notify => Apt::Exec['apt_update'], ),但我不明白为什么我不能通知该资源。
我对Augeas相当陌生,但我被告知这是用puppet修改configuration的工具。 我试图创build一个简单的类,如果它不存在,添加一行到/ etc / hosts。 augeas { "test_config": context => "/files/etc/hosts/01/", changes => [ "set ipaddr 192.168.100.3", "set canonical test.localdomain", "set alias[1] test", ], 这创build了我后面的路线。 hosts文件看起来像这样 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.0.3 test.localhost test 192.168.0.4 badger.oam.eeint.co.uk badger 因为我不想重复,我在augtool中创build了一个匹配行来获得匹配。 augtool> match / files / etc / hosts / 3 / alias […]
我已经使用安装指南安装了Puppet,但是似乎我只能从amzn-* repos安装Puppet包,即使我已经使用amzn-* 提供的说明安装了PuppetLabs EL6 Yum存储库。 [ec2-user@ip-172-31-1-239 ~]$ rpm -qa | grep facter facter-1.6.18-7.25.amzn1.noarch [ec2-user@ip-172-31-1-239 ~]$ sudo yum upgrade facter Loaded plugins: priorities, update-motd, upgrade-helper 1048 packages excluded due to repository priority protections No packages marked for update 我需要安装至lessFacter 1.7.0,以便包括修复 ,以确定osfmamily正确。 如何在Amazon Linux(2014.09.2)上安装Facter 1.7.0?
看起来很简单… # /path/to/puppet/modules/custom/lib/puppet/parser/functions module Puppet::Parser::Functions newfunction(:release_check) do |args| raise(Puppet::ParseError, "Testing!") end end # /path/to/puppet/modules/mysql/manifests/install.pp class mysql::install { # Doesn't work release_check(1) # Does work, but I don't want anything returned making the assignment superfluous $whocares = release_check(1) } 但是我一直得到这个错误: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Function 'release_check' must be […]
有没有办法来解决这个问题? 我可以更改接口顺序吗? 我有很多使用$ :: ipaddress的puppet模块,在Docker上可以在CentOS 6上正常工作,但是没有7 interfaces => docker0,eno16780032,lo ipaddress => 172.17.42.1 ipaddress_docker0 => 172.17.42.1 ipaddress_eno16780032 => 10.251.17.170 ipaddress_lo => 127.0.0.1
我在下面用puppet user资源写下面的代码片段来创buildunix用户。 node 'node2.example.com','node3.example.com'{ user { 'askar': ensure => 'present', managehome => 'true', comment => 'man Home', home => '/home/askar', shell => '/bin/bash', expiry => '2016-03-22', password => '$1$cs1j/tD$4Q2Ocr0pulyNTUx/', password_min_age => '30', password_max_age => '60', } exec { 'chage': path => '/usr/bin/', command => 'chage -d 0 askar', } } 它对我来说工作正常,但对我来说,我需要创build10到20个用户。 我如何重用上述代码段来创build10个用户。 我是puppet新手,所以指针会有很大的帮助。
这对我来说是一个很大的问题,因为我不熟悉木偶。 傀儡大师的错误: debug: importing '/etc/puppet/manifests/nodes/group-1.pp' err: Could not parse for environment production: Syntax error at '{'; expected '}' at /etc/puppet/manifests/nodes/group-1.pp:6 傀儡客户机上的错误: err:无法从远程服务器检索目录:SERVER上的错误400:无法parsing环境生成:在语法错误'{'; 在/etc/puppet/manifests/nodes/group-1.pp:6预期'}' 在组1.pp中: node 'group1' { include ntp class { 'nagios::host': #this is line 6 nodename => $clientcert, appname => 'test', } } nagios ::主机在模块模块/ nagios / host.pp代码在这里: class nagios::host($nodename, $hostgroup) { file { […]
我的木偶文件看起来像这样: # Test finger harry harry.pp exec {'harryd': command => "/usr/bin/finger $title", logoutput => true } 当我运行puppet apply harry.pp我得到这个输出: notice: /Stage[main]//Exec[harryd]/returns: finger: main: no such user. notice: /Stage[main]//Exec[harryd]/returns: executed successfully notice: Finished catalog run in 0.14 seconds 运行finger harryd得到我预期的输出。 它看起来像傀儡运行finger main ,但我不明白为什么。