What else in stead of using "import" keyword?

111 views
Skip to first unread message

Sans

unread,
Jul 13, 2014, 10:53:54 AM7/13/14
to puppet...@googlegroups.com
With import is being phased out, what's the equivalent? I did go through this deprecation notice but didn't really get it.

Say, I've some side-wide global variables defines in sites.pp

#/etc/puppet/manifests/sites.pp
$my_var1 = 'ThisIsMyVar-2'
$my_var2 = 'ThisIsMyVar-2'
$my_other_var1 = 'ThisIsMyOtherVar-1'
$my_other_var2 = 'ThisIsMyOtherVar-2'

And in my does nodes.pp, I want to use them:

#/etc/puppet/manifests/nodes.pp
node default {
    notify { "This is my MY_VAR: ${my_var}": }
}

How do I do this? Doing above, yields variable not found.  Any idea?
Best!

Felix Frank

unread,
Jul 13, 2014, 12:50:25 PM7/13/14
to puppet...@googlegroups.com
Hi,

actually, the very link you shared advises:

To keep your node definitions in separate files, specify a directory as your main manifest.

Have you done that and still face errors?

Regards,
Felix


On 07/13/2014 12:53 PM, Sans wrote:

Sans

unread,
Jul 13, 2014, 8:42:19 PM7/13/14
to puppet...@googlegroups.com
Thanks Felix! it worked.
Some reason, I missed that "directory as manifest" thing when first time I read it.

BTW, I'm actually back to square one again: Using Vagrant for the provisioning and it doesn't accept/understand the directory as main manifest, throwing in error:

puppet provisioner:
* The configured Puppet manifest is missing. Please specify a path to an existing manifest:


Do you (/any one) know a workaround? Best!

Felix Frank

unread,
Jul 13, 2014, 8:56:06 PM7/13/14
to puppet...@googlegroups.com
On 07/13/2014 10:42 PM, Sans wrote:
puppet provisioner:
* The configured Puppet manifest is missing. Please specify a path to an existing manifest:


Do you (/any one) know a workaround? Best!

I assume this is a Vagrant bug, and there is likely no workaround.

I'll take a quick look, might be easy to fix.

Cheers,
Felix

Sans

unread,
Jul 13, 2014, 9:12:32 PM7/13/14
to puppet...@googlegroups.com
Just found the bug report and the fix is HERE.
JFI, on OS X, basically, you need to open the file:

/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/provisioners/puppet/config/puppet.rb

and replace the line 108, with: if !expanded_manifest_file.file? && !expanded_manifest_file.directory?

worked just find for me. Best!

Felix Frank

unread,
Jul 13, 2014, 10:20:36 PM7/13/14
to puppet...@googlegroups.com
On 07/13/2014 11:12 PM, Sans wrote:
Just found the bug report and the fix is HERE.
JFI, on OS X, basically, you need to open the file:

/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/provisioners/puppet/config/puppet.rb

and replace the line 108, with: if !expanded_manifest_file.file? && !expanded_manifest_file.directory?

worked just find for me. Best!

Good find. Would have saved me 15 minutes ;)

https://github.com/mitchellh/vagrant/pull/4185
Reply all
Reply to author
Forward
0 new messages