Ask Your Question
0

profile: uninclude a class?

asked 2015-12-14 09:42:42 -0600

erichymowitz gravatar image

updated 2015-12-14 09:47:17 -0600

Greetings.

I'm running a very old version of puppet 2.7.26 (I am not allowed to update).

I have a profile that includes a bunch of modules.

class profiles::generic
{
  include a
  include b
  include c
  class { 'd' :
   variable1 => 5,
   variable2 => 12
  }
}

node 'host1'
{
  class { 'profiles::generic' : }
}
node 'host2'
{
  class { 'profiles::generic' : }
}

I now want to test a new version of modules c and d on host1, before I push the changes to all of my other hosts. Is there an easy way that I can say something like

node 'host1'
{
  class { 'profiles::generic' : }
  uninclude c
  include ctest
  uninclude d
  class { 'dtest' :
   variable1 => 5,
   variable2 => 12
  }
}

without having to re-write the entire profile into the host1 definition?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-12-14 12:40:11 -0600

lavaman gravatar image

There is no built-in way to exclude a class.

Generally, you want to test code changes like this using environments. Put your changes into a new, separate environment, then point your test node at that new environment. This way, you can keep all the same class names and profile definitions while testing your changes.

edit flag offensive delete link more

Comments

Thanks. I know nothing about puppet environments yet, but I guess it's time to learn.

erichymowitz gravatar imageerichymowitz ( 2015-12-14 13:28:16 -0600 )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: 2015-12-14 09:42:42 -0600

Seen: 340 times

Last updated: Dec 14 '15