Ask Your Question
1

Need help with Error: puppet Error 400 on SERVER: Could not match “Ubuntu”

asked 2014-08-28 08:05:38 -0500

andyinva gravatar image

updated 2014-08-28 13:03:48 -0500

ramindk gravatar image

I get the error ( puppet Error 400 on SERVER: Could not match “Ubuntu” ) when running the following code from Pro Puppet Errata on CentOS 6.5 64 bit. It runs in version 2.7 but does not run on master and agent version 3.6.2. I have re-installed a few times with the same results.

class sudo {
  package { sudo:
    ensure => present,
  }

  if $operatingsystem == “Ubuntu” {
    package { “sudo-ldap”:
      ensure => present,
      require => Package[“sudo”],
    }
  }

  file { "/etc/sudoers":
    owner => "root",
    group => "root",
    mode => 0440,
    source => "puppet:///modules/sudo/etc/sudoers",
    require => Package[“sudo”],
  }    
}
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2014-08-28 13:20:34 -0500

ramindk gravatar image

Your quoting of resources is all over the place at least in your paste. You don't use it in some places and oddly have smart quotes in the paste as well. That maybe causing some of your problems.

I can never remember when case matters within Puppet. You might try swapping a regex into your if statement.

class sudo {

  package { 'sudo': ensure => installed, }

  if ($::operatingsystem =~ /(?i:ubuntu)/ ) {
    package { 'sudo-ldap':
      ensure  => installed,
      require => Package['sudo'],
    }
  }

  file { '/etc/sudoers':
    ensure  => file,
    owner   => 'root',
    group   => 'root',
    mode    => '0440',
    source  => 'puppet:///modules/sudo/etc/sudoers',
    require => Package['sudo'],
  }
}
edit flag offensive delete link more

Comments

This answer worked. I found line 5 was an important correction. Great help thanks!

andyinva gravatar imageandyinva ( 2014-08-31 13:17:43 -0500 )edit

No problem. If you're set, you can mark my answer as the solution so it shows up answered.

ramindk gravatar imageramindk ( 2014-08-31 14:01:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-08-28 08:05:38 -0500

Seen: 901 times

Last updated: Aug 28 '14