Can I import a class with vagrant

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I import a class with vagrant

agibson
I have followed the tutorials online and have a Vagrant file configured to enable the puppet provisioner, inside of manifests I have a vagrant.pp file. I would like to be able to include a class / module that i have written in that vagrant.pp file to test the class and ensure it's working with a vagrant provision. Any advice on how this would work would be appreciated, I guess I am just not getting the syntax correct or something.

I have tried 'import' 'include' etc in vagrant.pp but I always get an error.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Can I import a class with vagrant

Simon McCartney
Can you paste or share what your Vagrant file looks like?

Here's what I have that working well for me:

  # Enable provisioning with Puppet stand alone.  Puppet manifests
  # are contained in a directory path relative to this Vagrantfile.
  # You will need to create the manifests directory and a manifest in
  # the file base.pp in the manifests_path directory.
  config.vm.provision :puppet, :module_path => "puppet/modules" do |puppet|
    puppet.manifests_path = "puppet/manifests"
    puppet.manifest_file  = "base-ppa.pp"
  end

So the directory containing Vagrantfile contains a directory called puppet, with modules & manifests sub-directories:


simonm@MacBook:~/src/vagrant-moniker $ ls -la Vagrantfile puppet/manifests/ puppet/modules/
-rw-r--r--  1 simonm  staff  2693  3 Jan 10:19 Vagrantfile

puppet/manifests/:
total 24
drwxr-xr-x  5 simonm  staff   170  3 Jan 15:53 .
drwxr-xr-x  6 simonm  staff   204  2 Jan 19:56 ..
-rw-r--r--  1 simonm  staff   254  3 Jan 14:50 base-ppa.pp

puppet/modules/:
total 8
drwxr-xr-x   8 simonm  staff  272  3 Jan 11:27 .
drwxr-xr-x   6 simonm  staff  204  2 Jan 19:56 ..
-rw-r--r--   1 simonm  staff  357  3 Jan 11:27 README.sh
drwxr-xr-x  12 simonm  staff  408  2 Jan 19:55 apt
drwxr-xr-x   7 simonm  staff  238 21 Dec 17:10 moniker
drwxr-xr-x   7 simonm  staff  238 20 Dec 18:20 python
drwxr-xr-x  14 simonm  staff  476  2 Jan 19:55 stdlib
drwxr-xr-x  18 simonm  staff  612 21 Dec 16:56 vcsrepo
simonm@MacBook:~/src/vagrant-moniker $

Does that help explain a working layout?

On 12 March 2013 22:24, <[hidden email]> wrote:
I have followed the tutorials online and have a Vagrant file configured to enable the puppet provisioner, inside of manifests I have a vagrant.pp file. I would like to be able to include a class / module that i have written in that vagrant.pp file to test the class and ensure it's working with a vagrant provision. Any advice on how this would work would be appreciated, I guess I am just not getting the syntax correct or something.

I have tried 'import' 'include' etc in vagrant.pp but I always get an error.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Simon McCartney
M: +44 7710 836 915

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Can I import a class with vagrant

agibson
Simon,

Thanks for the reply, I figured this out. I was not properly include the "puppet_modules" syntax in my Vagrant file. It's working now, thanks again.

-Aaron.

On Wednesday, March 13, 2013 9:32:43 AM UTC-6, Simon McCartney wrote:
Can you paste or share what your Vagrant file looks like?

Here's what I have that working well for me:

  # Enable provisioning with Puppet stand alone.  Puppet manifests
  # are contained in a directory path relative to this Vagrantfile.
  # You will need to create the manifests directory and a manifest in
  # the file base.pp in the manifests_path directory.
  config.vm.provision :puppet, :module_path => "puppet/modules" do |puppet|
    puppet.manifests_path = "puppet/manifests"
    puppet.manifest_file  = "base-ppa.pp"
  end

So the directory containing Vagrantfile contains a directory called puppet, with modules & manifests sub-directories:


simonm@MacBook:~/src/vagrant-moniker $ ls -la Vagrantfile puppet/manifests/ puppet/modules/
-rw-r--r--  1 simonm  staff  2693  3 Jan 10:19 Vagrantfile

puppet/manifests/:
total 24
drwxr-xr-x  5 simonm  staff   170  3 Jan 15:53 .
drwxr-xr-x  6 simonm  staff   204  2 Jan 19:56 ..
-rw-r--r--  1 simonm  staff   254  3 Jan 14:50 base-ppa.pp

puppet/modules/:
total 8
drwxr-xr-x   8 simonm  staff  272  3 Jan 11:27 .
drwxr-xr-x   6 simonm  staff  204  2 Jan 19:56 ..
-rw-r--r--   1 simonm  staff  357  3 Jan 11:27 README.sh
drwxr-xr-x  12 simonm  staff  408  2 Jan 19:55 apt
drwxr-xr-x   7 simonm  staff  238 21 Dec 17:10 moniker
drwxr-xr-x   7 simonm  staff  238 20 Dec 18:20 python
drwxr-xr-x  14 simonm  staff  476  2 Jan 19:55 stdlib
drwxr-xr-x  18 simonm  staff  612 21 Dec 16:56 vcsrepo
simonm@MacBook:~/src/vagrant-moniker $

Does that help explain a working layout?

On 12 March 2013 22:24, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iV3WE5aNj5QJ">agi...@...> wrote:
I have followed the tutorials online and have a Vagrant file configured to enable the puppet provisioner, inside of manifests I have a vagrant.pp file. I would like to be able to include a class / module that i have written in that vagrant.pp file to test the class and ensure it's working with a vagrant provision. Any advice on how this would work would be appreciated, I guess I am just not getting the syntax correct or something.

I have tried 'import' 'include' etc in vagrant.pp but I always get an error.

Thanks!

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iV3WE5aNj5QJ">vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Simon McCartney
E: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iV3WE5aNj5QJ">si...@...
M: +44 7710 836 915

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.