[Puppet Users] 2.6.3 differs in behavior from 2.6.1

Brian Gallew
Mon, 29 Nov 2010 21:10:10 -0000

Before I go and write yet another custom fact, I just want to be sure that
the behavior I''m seeing is "as designed" rather than a
regression.

When I ran 2.6.1, I had the following snippets working as expected:
base/manifests/minimal.pp:

  class {"ssh::sshd_config": stage => post}


ssh/manifests/init.pp:

class ssh::sshd_config {
  service{"sshserver":
    name => $operatingsystem ? {
      Solaris => "/network/ssh",
      default => "sshd"
    },
    ensure => running
  }

  file{"/etc/ssh/sshd_config":
    content => template("ssh/sshd_config.erb"),
    notify => Service["sshserver"],
    owner => root, group => root, mode => 0644,
  }
}


ssh/template/sshd_config.erb:

<%
my_login_groups = [''root'', ''wheel'',
''sysadmin'']
my_login_groups << ''netdb'' if
classes.index(''bind::server'') != nil
my_login_groups << ''jira'' if
classes.index(''jira'') != nil
my_login_groups << ''archiva'' if
classes.index(''archiva'') != nil
my_login_groups << ''maven'' if
classes.index(''maven'') != nil
my_login_groups << ''oinstall'' if
classes.index(''oracle'') != nil
my_login_groups << ''dba'' if
classes.index(''oracle'') != nil
my_login_groups << ''puppet'' if
classes.index(''puppet::master'') != nil
my_login_groups << ''jboss'' if
classes.index(''jboss'') != nil
my_login_groups << ''nagios'' if
classes.index(''nagios::server'') != nil
%>
AllowGroups <%= my_login_groups.join('' '') %>


IN 2.6.1, this generated an AllowGroup stanza based on the complete set of
classes assigned to any given puppet client.  In 2.6.3, however, when the
template is parsed classes contains *only* the classes that were included in
minimal.pp before the ssh:sshd_config stanza.  I was under the impression
that the intention was that evaluation order wasn''t supposed to matter,
so
toplevel variables like classes should be *complete* before any templates
are evaluated.

If this *is* the desired behavior then I''ll just create a custom fact
that
will extract the data from the classes.txt file on the client which will be
fugly but functional.  If it''s not, let me know and I''ll open
a bug report.

--
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