Unfortunately, this if !defined() thing is rife will ill-repute in the puppet world. Due to puppet's non-deterministic way of compiling things, this may cause weird confusing things to happen. Basically by using defined() you are introducing a parse-order dependency. Also defined() only checks that it has been defined elsewhere, not with what attributes. I think it would be better to to try and figure out a different way to accomplish this.