FAQ
I too have been pushed into Puppet 3.0. Clients and PuppetMaster are now
at 3.0.0. Not sure if this is a version change or syntax error that I am
experiencing. We'll use 'ntp' as the example and the "build" host is a VM.

The old way:

class baseline::ntpd {
package { "ntp":
ensure => $virtual ? {
physical => present,
vmware => purged,
default => present
}
}

On the client, it always says that it is created, even though it's not
present:

[root@build ~]# puppet agent -tv
Info: Retrieving plugin
Info: Caching catalog for build
Info: Applying configuration version '1349227476'
/Stage[main]/Baseline::Ntpd/Package[ntp]/ensure: created
Finished catalog run in 1.46 seconds
[root@build ~]#
[root@build ~]# rpm -q ntp
package ntp is not installed
[root@build ~]#



When trying the $is_virtual facter......

class baseline-testing::ntpd {
package { "ntp":
ensure => $is_virtual ? {
false => present,
true => purged
}
}
}


On client:

[root@build ~]# puppet agent -tv
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: No matching value for selector param 'true' at
/etc/puppet/manifests/classes/baseline_linux-testing.pp:35 on node build
[root@build ~]#
[root@build ~]# facter | grep virtual
is_virtual => true
virtual => vmware

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/j-ojRf6R83AJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Krzysztof Wilczynski at Oct 5, 2012 at 3:09 pm
    Hey,

    This selector expects to get a true boolean value e.g. true / false
    (TrueClass / FalseClass in Ruby) and that is why it is failing, since you
    are passing a string "true" from the fact (and all values coming from
    Facter are strings, even numeric values).

    Grab this:

    https://raw.github.com/kwilczynski/puppet-functions/master/lib/puppet/parser/functions/str2bool.rb

    And then try:

    class baseline-testing::ntpd {
    package { "ntp":
    ensure => str2bool($is_virtual) ? {
    false => present,
    true => purged
    }
    }
    }

    Hope that helps :)

    KW
    On Wednesday, October 3, 2012 2:43:01 AM UTC+1, Matt wrote:

    I too have been pushed into Puppet 3.0. Clients and PuppetMaster are now
    at 3.0.0. Not sure if this is a version change or syntax error that I am
    experiencing. We'll use 'ntp' as the example and the "build" host is a VM.

    The old way:

    class baseline::ntpd {
    package { "ntp":
    ensure => $virtual ? {
    physical => present,
    vmware => purged,
    default => present
    }
    }

    On the client, it always says that it is created, even though it's not
    present:

    [root@build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349227476'
    /Stage[main]/Baseline::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.46 seconds
    [root@build ~]#
    [root@build ~]# rpm -q ntp
    package ntp is not installed
    [root@build ~]#



    When trying the $is_virtual facter......

    class baseline-testing::ntpd {
    package { "ntp":
    ensure => $is_virtual ? {
    false => present,
    true => purged
    }
    }
    }


    On client:

    [root@build ~]# puppet agent -tv
    Info: Retrieving plugin
    Error: Could not retrieve catalog from remote server: Error 400 on
    SERVER: No matching value for selector param 'true' at
    /etc/puppet/manifests/classes/baseline_linux-testing.pp:35 on node build
    [root@build ~]#
    [root@build ~]# facter | grep virtual
    is_virtual => true
    virtual => vmware
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GUQ5PMTcO9wJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Matt at Oct 6, 2012 at 1:42 am
    Thanks Krzysztof. It successfully runs now, but output is misleading on
    subsequent runs:

    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: ensure changed
    '4.2.4p8-2.el6' to 'purged'
    Finished catalog run in 6.10 seconds
    build ~]#
    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.10 seconds
    build ~]#
    build ~]# rpm -q ntp
    package ntp is not installed


    The only class being called for the 'build' node is
    'baseline-testing::ntpd', which only ensures that the NTP package is
    removed (the 8 lines of code you recommended). It does remove the package,
    but I don't know why it mentions creating it upon the second run, even
    though it does not actually get re-installed. Maybe traditional 'if'
    statements are advised.

    ~Matt

    On Friday, October 5, 2012 11:09:03 AM UTC-4, Krzysztof Wilczynski wrote:

    Hey,

    This selector expects to get a true boolean value e.g. true / false
    (TrueClass / FalseClass in Ruby) and that is why it is failing, since you
    are passing a string "true" from the fact (and all values coming from
    Facter are strings, even numeric values).

    Grab this:


    https://raw.github.com/kwilczynski/puppet-functions/master/lib/puppet/parser/functions/str2bool.rb

    And then try:

    class baseline-testing::ntpd {
    package { "ntp":
    ensure => str2bool($is_virtual) ? {
    false => present,
    true => purged
    }
    }
    }

    Hope that helps :)

    KW
    On Wednesday, October 3, 2012 2:43:01 AM UTC+1, Matt wrote:

    I too have been pushed into Puppet 3.0. Clients and PuppetMaster are now
    at 3.0.0. Not sure if this is a version change or syntax error that I am
    experiencing. We'll use 'ntp' as the example and the "build" host is a VM.

    The old way:

    class baseline::ntpd {
    package { "ntp":
    ensure => $virtual ? {
    physical => present,
    vmware => purged,
    default => present
    }
    }

    On the client, it always says that it is created, even though it's not
    present:

    [root@build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349227476'
    /Stage[main]/Baseline::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.46 seconds
    [root@build ~]#
    [root@build ~]# rpm -q ntp
    package ntp is not installed
    [root@build ~]#



    When trying the $is_virtual facter......

    class baseline-testing::ntpd {
    package { "ntp":
    ensure => $is_virtual ? {
    false => present,
    true => purged
    }
    }
    }


    On client:

    [root@build ~]# puppet agent -tv
    Info: Retrieving plugin
    Error: Could not retrieve catalog from remote server: Error 400 on
    SERVER: No matching value for selector param 'true' at
    /etc/puppet/manifests/classes/baseline_linux-testing.pp:35 on node build
    [root@build ~]#
    [root@build ~]# facter | grep virtual
    is_virtual => true
    virtual => vmware
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/8JkoXA2w8Q0J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Krzysztof Wilczynski at Oct 6, 2012 at 7:07 pm
    Hi,

    No idea, to be honest. Works for me in 2.7 family without problems. The
    code I gave you was originally yours, I just added call to the function :)

    KW
    On Saturday, October 6, 2012 2:42:25 AM UTC+1, Matt wrote:

    Thanks Krzysztof. It successfully runs now, but output is misleading on
    subsequent runs:

    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: ensure changed
    '4.2.4p8-2.el6' to 'purged'
    Finished catalog run in 6.10 seconds
    build ~]#
    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.10 seconds
    build ~]#
    build ~]# rpm -q ntp
    package ntp is not installed


    The only class being called for the 'build' node is
    'baseline-testing::ntpd', which only ensures that the NTP package is
    removed (the 8 lines of code you recommended). It does remove the package,
    but I don't know why it mentions creating it upon the second run, even
    though it does not actually get re-installed. Maybe traditional 'if'
    statements are advised.

    ~Matt

    On Friday, October 5, 2012 11:09:03 AM UTC-4, Krzysztof Wilczynski wrote:

    Hey,

    This selector expects to get a true boolean value e.g. true / false
    (TrueClass / FalseClass in Ruby) and that is why it is failing, since you
    are passing a string "true" from the fact (and all values coming from
    Facter are strings, even numeric values).

    Grab this:


    https://raw.github.com/kwilczynski/puppet-functions/master/lib/puppet/parser/functions/str2bool.rb

    And then try:

    class baseline-testing::ntpd {
    package { "ntp":
    ensure => str2bool($is_virtual) ? {
    false => present,
    true => purged
    }
    }
    }

    Hope that helps :)

    KW
    On Wednesday, October 3, 2012 2:43:01 AM UTC+1, Matt wrote:

    I too have been pushed into Puppet 3.0. Clients and PuppetMaster are
    now at 3.0.0. Not sure if this is a version change or syntax error that I
    am experiencing. We'll use 'ntp' as the example and the "build" host is a
    VM.

    The old way:

    class baseline::ntpd {
    package { "ntp":
    ensure => $virtual ? {
    physical => present,
    vmware => purged,
    default => present
    }
    }

    On the client, it always says that it is created, even though it's not
    present:

    [root@build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349227476'
    /Stage[main]/Baseline::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.46 seconds
    [root@build ~]#
    [root@build ~]# rpm -q ntp
    package ntp is not installed
    [root@build ~]#



    When trying the $is_virtual facter......

    class baseline-testing::ntpd {
    package { "ntp":
    ensure => $is_virtual ? {
    false => present,
    true => purged
    }
    }
    }


    On client:

    [root@build ~]# puppet agent -tv
    Info: Retrieving plugin
    Error: Could not retrieve catalog from remote server: Error 400 on
    SERVER: No matching value for selector param 'true' at
    /etc/puppet/manifests/classes/baseline_linux-testing.pp:35 on node build
    [root@build ~]#
    [root@build ~]# facter | grep virtual
    is_virtual => true
    virtual => vmware
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/uXJCmQELCTwJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Stefan Schulte at Oct 7, 2012 at 5:53 am

    On Fri, Oct 05, 2012 at 06:42:25PM -0700, Matt wrote:
    Thanks Krzysztof. It successfully runs now, but output is misleading on
    subsequent runs:

    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: ensure changed
    '4.2.4p8-2.el6' to 'purged'
    Finished catalog run in 6.10 seconds
    build ~]#
    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.10 seconds
    build ~]#
    build ~]# rpm -q ntp
    package ntp is not installed


    The only class being called for the 'build' node is
    'baseline-testing::ntpd', which only ensures that the NTP package is
    removed (the 8 lines of code you recommended). It does remove the package,
    but I don't know why it mentions creating it upon the second run, even
    though it does not actually get re-installed. Maybe traditional 'if'
    statements are advised.

    ~Matt
    Can you run puppet agent with the --debug flag? This way you should see
    the command puppet is executing.

    I guess puppet uses the yum provider (as your package name indicates a
    redhat system) and the yum provider does not support "purged" (only
    absent). There is an open feature request for it
    http://projects.puppetlabs.com/issues/11450

    And the issue about running yum erase multiple times is also on redmine
    https://projects.puppetlabs.com/issues/2833

    -Stefan

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Matt at Oct 7, 2012 at 6:06 pm
    Hello Stefan,

    Yes, I am using Puppet 3.0.0 and RHEL 6.3.

    According to the Puppetlabs site, 'purged' should be supported with 'yum'
    in the latest version of Puppet:
    http://docs.puppetlabs.com/references/latest/type.html#package
    As 3.0 is a major release, and two versions (and two years) newer...I
    wasn't sure if this bug needs to be reported.

    Anyway.....Here's the debug output:

    build ~]# puppet agent -tv --debug
    Debug: Failed to load library 'rubygems' for feature 'rubygems'
    Debug: Using settings: adding file resource 'lastrunreport':
    'File[/var/lib/puppet/state/last_run_report.yaml]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :mode=>"640",
    :path=>"/var/lib/puppet/state/last_run_report.yaml", :backup=>false}'
    Debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not
    exist
    Debug: Puppet::Type::User::ProviderPw: file pw does not exist
    Debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl
    does not exist
    Debug: Failed to load library 'ldap' for feature 'ldap'
    Debug: Puppet::Type::User::ProviderLdap: feature ldap is missing
    Debug: Using settings: adding file resource 'publickeydir':
    'File[/var/lib/puppet/ssl/public_keys]{:loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet",
    :path=>"/var/lib/puppet/ssl/public_keys", :backup=>false}'
    Debug: Using settings: adding file resource 'privatedir':
    'File[/var/lib/puppet/ssl/private]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :owner=>"puppet", :mode=>"750",
    :path=>"/var/lib/puppet/ssl/private", :backup=>false}'
    Debug: Using settings: adding file resource 'hostcert':
    'File[/var/lib/puppet/ssl/certs/build.pem]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/certs/build.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'vardir':
    'File[/var/lib/puppet]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :path=>"/var/lib/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'client_datadir':
    'File[/var/lib/puppet/client_data]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/client_data",
    :backup=>false}'
    Debug: Using settings: adding file resource 'rundir':
    'File[/var/run/puppet]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"755", :path=>"/var/run/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'localcacert':
    'File[/var/lib/puppet/ssl/certs/ca.pem]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/certs/ca.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'hostcrl':
    'File[/var/lib/puppet/ssl/crl.pem]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/crl.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'certdir':
    'File[/var/lib/puppet/ssl/certs]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :owner=>"puppet", :path=>"/var/lib/puppet/ssl/certs",
    :backup=>false}'
    Debug: Using settings: adding file resource 'requestdir':
    'File[/var/lib/puppet/ssl/certificate_requests]{:loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet",
    :path=>"/var/lib/puppet/ssl/certificate_requests", :backup=>false}'
    Debug: Using settings: adding file resource 'libdir':
    'File[/var/lib/puppet/lib]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :path=>"/var/lib/puppet/lib", :backup=>false}'
    Debug: Using settings: adding file resource 'logdir':
    'File[/var/log/puppet]{:group=>"puppet", :loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet", :mode=>"750",
    :path=>"/var/log/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'statefile':
    'File[/var/lib/puppet/state/state.yaml]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :mode=>"660", :path=>"/var/lib/puppet/state/state.yaml",
    :backup=>false}'
    Debug: Using settings: adding file resource 'hostprivkey':
    'File[/var/lib/puppet/ssl/private_keys/build.pem]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"puppet", :mode=>"600",
    :path=>"/var/lib/puppet/ssl/private_keys/build.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'classfile':
    'File[/var/lib/puppet/classes.txt]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :owner=>"root", :mode=>"640",
    :path=>"/var/lib/puppet/classes.txt", :backup=>false}'
    Debug: Using settings: adding file resource 'clientbucketdir':
    'File[/var/lib/puppet/clientbucket]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/clientbucket",
    :backup=>false}'
    Debug: Using settings: adding file resource 'statedir':
    'File[/var/lib/puppet/state]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"1755", :path=>"/var/lib/puppet/state",
    :backup=>false}'
    Debug: Using settings: adding file resource 'lastrunfile':
    'File[/var/lib/puppet/state/last_run_summary.yaml]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :mode=>"644",
    :path=>"/var/lib/puppet/state/last_run_summary.yaml", :backup=>false}'
    Debug: Using settings: adding file resource 'ssldir':
    'File[/var/lib/puppet/ssl]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :owner=>"puppet", :mode=>"771",
    :path=>"/var/lib/puppet/ssl", :backup=>false}'
    Debug: Using settings: adding file resource 'graphdir':
    'File[/var/lib/puppet/state/graphs]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :path=>"/var/lib/puppet/state/graphs", :backup=>false}'
    Debug: Using settings: adding file resource 'privatekeydir':
    'File[/var/lib/puppet/ssl/private_keys]{:loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet", :mode=>"750",
    :path=>"/var/lib/puppet/ssl/private_keys", :backup=>false}'
    Debug: Using settings: adding file resource 'confdir':
    'File[/etc/puppet]{:loglevel=>:debug, :ensure=>:directory, :links=>:follow,
    :path=>"/etc/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'clientyamldir':
    'File[/var/lib/puppet/client_yaml]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/client_yaml",
    :backup=>false}'
    Debug: Using settings: adding file resource 'hostpubkey':
    'File[/var/lib/puppet/ssl/public_keys/build.pem]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/public_keys/build.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'resourcefile':
    'File[/var/lib/puppet/state/resources.txt]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"root", :mode=>"640",
    :path=>"/var/lib/puppet/state/resources.txt", :backup=>false}'
    Debug: /File[/var/lib/puppet/ssl/private]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/client_data]: Autorequiring
    File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/ssl/certs/build.pem]: Autorequiring
    File[/var/lib/puppet/ssl/certs]
    Debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/state/resources.txt]: Autorequiring
    File[/var/lib/puppet/state]
    Debug: /File[/var/lib/puppet/client_yaml]: Autorequiring
    File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/clientbucket]: Autorequiring
    File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring
    File[/var/lib/puppet/state]
    Debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/classes.txt]: Autorequiring
    File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/state/graphs]: Autorequiring
    File[/var/lib/puppet/state]
    Debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring
    File[/var/lib/puppet/ssl/certs]
    Debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring
    File[/var/lib/puppet/state]
    Debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring
    File[/var/lib/puppet/state]
    Debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/private_keys/build.pem]: Autorequiring
    File[/var/lib/puppet/ssl/private_keys]
    Debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/public_keys/build.pem]: Autorequiring
    File[/var/lib/puppet/ssl/public_keys]
    Debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
    Debug: Finishing transaction 70273526821120
    Debug: Using settings: adding file resource 'publickeydir':
    'File[/var/lib/puppet/ssl/public_keys]{:loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet",
    :path=>"/var/lib/puppet/ssl/public_keys", :backup=>false}'
    Debug: Using settings: adding file resource 'privatedir':
    'File[/var/lib/puppet/ssl/private]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :owner=>"puppet", :mode=>"750",
    :path=>"/var/lib/puppet/ssl/private", :backup=>false}'
    Debug: Using settings: adding file resource 'hostcert':
    'File[/var/lib/puppet/ssl/certs/build.pem]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/certs/build.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'vardir':
    'File[/var/lib/puppet]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :path=>"/var/lib/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'rundir':
    'File[/var/run/puppet]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"755", :path=>"/var/run/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'localcacert':
    'File[/var/lib/puppet/ssl/certs/ca.pem]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/certs/ca.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'hostcrl':
    'File[/var/lib/puppet/ssl/crl.pem]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/crl.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'certdir':
    'File[/var/lib/puppet/ssl/certs]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :owner=>"puppet", :path=>"/var/lib/puppet/ssl/certs",
    :backup=>false}'
    Debug: Using settings: adding file resource 'requestdir':
    'File[/var/lib/puppet/ssl/certificate_requests]{:loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet",
    :path=>"/var/lib/puppet/ssl/certificate_requests", :backup=>false}'
    Debug: Using settings: adding file resource 'libdir':
    'File[/var/lib/puppet/lib]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :path=>"/var/lib/puppet/lib", :backup=>false}'
    Debug: Using settings: adding file resource 'logdir':
    'File[/var/log/puppet]{:group=>"puppet", :loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet", :mode=>"750",
    :path=>"/var/log/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'hostprivkey':
    'File[/var/lib/puppet/ssl/private_keys/build.pem]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"puppet", :mode=>"600",
    :path=>"/var/lib/puppet/ssl/private_keys/build.pem", :backup=>false}'
    Debug: Using settings: adding file resource 'statedir':
    'File[/var/lib/puppet/state]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"1755", :path=>"/var/lib/puppet/state",
    :backup=>false}'
    Debug: Using settings: adding file resource 'ssldir':
    'File[/var/lib/puppet/ssl]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :owner=>"puppet", :mode=>"771",
    :path=>"/var/lib/puppet/ssl", :backup=>false}'
    Debug: Using settings: adding file resource 'privatekeydir':
    'File[/var/lib/puppet/ssl/private_keys]{:loglevel=>:debug,
    :ensure=>:directory, :links=>:follow, :owner=>"puppet", :mode=>"750",
    :path=>"/var/lib/puppet/ssl/private_keys", :backup=>false}'
    Debug: Using settings: adding file resource 'confdir':
    'File[/etc/puppet]{:loglevel=>:debug, :ensure=>:directory, :links=>:follow,
    :path=>"/etc/puppet", :backup=>false}'
    Debug: Using settings: adding file resource 'hostpubkey':
    'File[/var/lib/puppet/ssl/public_keys/build.pem]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"puppet", :mode=>"644",
    :path=>"/var/lib/puppet/ssl/public_keys/build.pem", :backup=>false}'
    Debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/ssl/public_keys/build.pem]: Autorequiring
    File[/var/lib/puppet/ssl/public_keys]
    Debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/private_keys/build.pem]: Autorequiring
    File[/var/lib/puppet/ssl/private_keys]
    Debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring
    File[/var/lib/puppet/ssl/certs]
    Debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
    Debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: /File[/var/lib/puppet/ssl/certs/build.pem]: Autorequiring
    File[/var/lib/puppet/ssl/certs]
    Debug: /File[/var/lib/puppet/ssl/private]: Autorequiring
    File[/var/lib/puppet/ssl]
    Debug: Finishing transaction 70273527463180
    Debug: Using cached certificate for ca
    Debug: Using cached certificate for build
    Debug: Using settings: adding file resource 'lastrunreport':
    'File[/var/lib/puppet/state/last_run_report.yaml]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :mode=>"640",
    :path=>"/var/lib/puppet/state/last_run_report.yaml", :backup=>false}'
    Debug: Using settings: adding file resource 'client_datadir':
    'File[/var/lib/puppet/client_data]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/client_data",
    :backup=>false}'
    Debug: Using settings: adding file resource 'statefile':
    'File[/var/lib/puppet/state/state.yaml]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :mode=>"660", :path=>"/var/lib/puppet/state/state.yaml",
    :backup=>false}'
    Debug: Using settings: adding file resource 'classfile':
    'File[/var/lib/puppet/classes.txt]{:loglevel=>:debug, :ensure=>:file,
    :links=>:follow, :owner=>"root", :mode=>"640",
    :path=>"/var/lib/puppet/classes.txt", :backup=>false}'
    Debug: Using settings: adding file resource 'clientbucketdir':
    'File[/var/lib/puppet/clientbucket]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/clientbucket",
    :backup=>false}'
    Debug: Using settings: adding file resource 'lastrunfile':
    'File[/var/lib/puppet/state/last_run_summary.yaml]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :mode=>"644",
    :path=>"/var/lib/puppet/state/last_run_summary.yaml", :backup=>false}'
    Debug: Using settings: adding file resource 'graphdir':
    'File[/var/lib/puppet/state/graphs]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :path=>"/var/lib/puppet/state/graphs", :backup=>false}'
    Debug: Using settings: adding file resource 'clientyamldir':
    'File[/var/lib/puppet/client_yaml]{:loglevel=>:debug, :ensure=>:directory,
    :links=>:follow, :mode=>"750", :path=>"/var/lib/puppet/client_yaml",
    :backup=>false}'
    Debug: Using settings: adding file resource 'resourcefile':
    'File[/var/lib/puppet/state/resources.txt]{:loglevel=>:debug,
    :ensure=>:file, :links=>:follow, :owner=>"root", :mode=>"640",
    :path=>"/var/lib/puppet/state/resources.txt", :backup=>false}'
    Debug: Finishing transaction 70273526620680
    Debug: Loaded state in 0.00 seconds
    Debug: node supports formats: b64_zlib_yaml pson raw yaml; using pson
    Debug: Using cached certificate for ca
    Debug: Using cached certificate for build
    Debug: Using cached certificate_revocation_list for ca
    Info: Retrieving plugin
    Debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; using
    pson
    Debug: Finishing transaction 70273526388740
    Debug: catalog supports formats: b64_zlib_yaml dot pson raw yaml; using pson
    Debug: Executing '/bin/rpm --version'
    Debug: Executing '/bin/rpm -ql rpm'
    Debug: Executing '/bin/rpm -ql rpm'
    Debug: Executing '/bin/rpm --version'
    Info: Caching catalog for build
    Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
    Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not
    exist
    Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not
    exist
    Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
    Debug: Puppet::Type::Package::ProviderGem: file gem does not exist
    Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info does
    not exist
    Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
    Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude does
    not exist
    Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does
    not exist
    Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not
    exist
    Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not
    exist
    Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist
    Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not
    exist
    Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox
    does not exist
    Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/eix does not
    exist
    Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not
    exist
    Debug: Puppet::Type::Package::ProviderPorts: file
    /usr/local/sbin/portversion does not exist
    Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not exist
    Debug: Puppet::Type::Package::ProviderPortupgrade: file
    /usr/local/sbin/portinstall does not exist
    Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist
    Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does
    not exist
    Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does not
    exist
    Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
    Debug: Creating default schedules
    Debug: Loaded state in 0.00 seconds
    Info: Applying configuration version '1349482471'
    Debug: /Schedule[daily]: Skipping device resources because running on a host
    Debug: /Schedule[monthly]: Skipping device resources because running on a
    host
    Debug: /Schedule[hourly]: Skipping device resources because running on a
    host
    Debug: Prefetching yum resources for package
    Debug: Executing '/bin/rpm --version'
    Debug: Executing '/bin/rpm -qa --nosignature --nodigest --qf '%{NAME}
    %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
    ''
    Debug: Executing '/bin/rpm -q ntp --nosignature --nodigest --qf %{NAME}
    %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}
    '
    Debug: Executing '/usr/bin/yum -y erase ntp'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: created
    Debug: /Stage[main]/Baseline-testing::Ntpd/Package[ntp]: The container
    Class[Baseline-testing::Ntpd] will propagate my refresh event
    Debug: Class[Baseline-testing::Ntpd]: The container Stage[main] will
    propagate my refresh event
    Debug: /Schedule[never]: Skipping device resources because running on a host
    Debug: /Schedule[weekly]: Skipping device resources because running on a
    host
    Debug: /Schedule[puppet]: Skipping device resources because running on a
    host
    Debug: Finishing transaction 70273526577580
    Debug: Storing state
    Debug: Stored state in 0.01 seconds
    Finished catalog run in 1.08 seconds


    Thanks for checking in. ;)

    ~Matt



    On Sunday, October 7, 2012 1:53:38 AM UTC-4, Stefan Schulte wrote:
    On Fri, Oct 05, 2012 at 06:42:25PM -0700, Matt wrote:
    Thanks Krzysztof. It successfully runs now, but output is misleading on
    subsequent runs:

    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: ensure changed
    '4.2.4p8-2.el6' to 'purged'
    Finished catalog run in 6.10 seconds
    build ~]#
    build ~]# puppet agent -tv
    Info: Retrieving plugin
    Info: Caching catalog for build
    Info: Applying configuration version '1349482471'
    /Stage[main]/Baseline-testing::Ntpd/Package[ntp]/ensure: created
    Finished catalog run in 1.10 seconds
    build ~]#
    build ~]# rpm -q ntp
    package ntp is not installed


    The only class being called for the 'build' node is
    'baseline-testing::ntpd', which only ensures that the NTP package is
    removed (the 8 lines of code you recommended). It does remove the package,
    but I don't know why it mentions creating it upon the second run, even
    though it does not actually get re-installed. Maybe traditional 'if'
    statements are advised.

    ~Matt
    Can you run puppet agent with the --debug flag? This way you should see
    the command puppet is executing.

    I guess puppet uses the yum provider (as your package name indicates a
    redhat system) and the yum provider does not support "purged" (only
    absent). There is an open feature request for it
    http://projects.puppetlabs.com/issues/11450

    And the issue about running yum erase multiple times is also on redmine
    https://projects.puppetlabs.com/issues/2833

    -Stefan
    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/f3KPWUEjyT8J.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 3, '12 at 1:43a
activeOct 7, '12 at 6:06p
posts6
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase