Ask Your Question
0

migration 2.7 to 3.x and scope

asked 2015-08-21 08:37:16 -0500

f3ex gravatar image

I have a module for the puppet. Now we are trying to migrate from 2.7 to 3.x. But I can not deal with namespase.

Test the code:

site.pp

define some_define () {
     notify {$ project:} 
}

class shared {
     $ project = 'generic'
     some_define {'zxc':} 
}

node 'my_node' {
     include shared 
}

On puppet 2.7:

puppet apply  site.pp 
...
notice: generic
notice: /Stage[main]/Shared/Some_define[zxc]/Notify[generic]/message: defined 'message' as 'generic'
notice: Finished catalog run in 0.44 seconds

On puppet 3:

bash-4.1$ puppet apply site.pp 
Notice: Compiled catalog for xxx in environment production in 0.04 seconds
Notice: undef
Notice: /Stage[main]/Shared/Some_define[zxc]/Notify[undef]/message: defined 'message' as 'undef'
Notice: Finished catalog run in 0.03 seconds

What am I missing?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2015-08-21 09:33:27 -0500

Hi - I think this is a well known change going from 2.7 to 3, for further more detailed info have a look at:

scope and puppet

I think a quick fix would be for you to qualify the variables, e.g.:

shared::project , rather than just project when referred to outside of class shared.

have a great weekend, Stuart

edit flag offensive delete link more

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-08-21 08:37:16 -0500

Seen: 62 times

Last updated: Aug 21 '15