Class: Vagrant::Provisioners::Puppet::Config
- Inherits:
-
Config::Base
- Object
- Config::Base
- Vagrant::Provisioners::Puppet::Config
- Defined in:
- lib/vagrant/provisioners/puppet.rb
Instance Attribute Summary collapse
-
#facter ⇒ Object
Returns the value of attribute facter.
-
#manifest_file ⇒ Object
Returns the value of attribute manifest_file.
-
#manifests_path ⇒ Object
Returns the value of attribute manifests_path.
-
#module_path ⇒ Object
Returns the value of attribute module_path.
-
#options ⇒ Object
Returns the value of attribute options.
-
#pp_path ⇒ Object
Returns the value of attribute pp_path.
Instance Method Summary collapse
-
#expanded_manifests_path(root_path) ⇒ Object
Returns the manifests path expanded relative to the root path of the environment.
-
#expanded_module_paths(root_path) ⇒ Object
Returns the module paths as an array of paths expanded relative to the root path.
- #validate(env, errors) ⇒ Object
Methods inherited from Config::Base
#instance_variables_hash, json_create, #merge, #set_options, #to_hash, #to_json
Instance Attribute Details
#facter ⇒ Object
Returns the value of attribute facter.
16 17 18 |
# File 'lib/vagrant/provisioners/puppet.rb', line 16 def facter @facter end |
#manifest_file ⇒ Object
Returns the value of attribute manifest_file.
11 12 13 |
# File 'lib/vagrant/provisioners/puppet.rb', line 11 def manifest_file @manifest_file end |
#manifests_path ⇒ Object
Returns the value of attribute manifests_path.
12 13 14 |
# File 'lib/vagrant/provisioners/puppet.rb', line 12 def manifests_path @manifests_path end |
#module_path ⇒ Object
Returns the value of attribute module_path.
13 14 15 |
# File 'lib/vagrant/provisioners/puppet.rb', line 13 def module_path @module_path end |
#options ⇒ Object
Returns the value of attribute options.
15 16 17 |
# File 'lib/vagrant/provisioners/puppet.rb', line 15 def @options end |
#pp_path ⇒ Object
Returns the value of attribute pp_path.
14 15 16 |
# File 'lib/vagrant/provisioners/puppet.rb', line 14 def pp_path @pp_path end |
Instance Method Details
#expanded_manifests_path(root_path) ⇒ Object
Returns the manifests path expanded relative to the root path of the environment.
26 27 28 |
# File 'lib/vagrant/provisioners/puppet.rb', line 26 def (root_path) Pathname.new(manifests_path).(root_path) end |
#expanded_module_paths(root_path) ⇒ Object
Returns the module paths as an array of paths expanded relative to the root path.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/vagrant/provisioners/puppet.rb', line 32 def (root_path) return [] if !module_path # Get all the paths and expand them relative to the root path, returning # the array of expanded paths paths = module_path paths = [paths] if !paths.is_a?(Array) paths.map do |path| Pathname.new(path).(root_path) end end |
#validate(env, errors) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/vagrant/provisioners/puppet.rb', line 44 def validate(env, errors) # Calculate the manifests and module paths based on env = (env.root_path) = (env.root_path) # Manifests path/file validation if !.directory? errors.add(I18n.t("vagrant.provisioners.puppet.manifests_path_missing", :path => )) else = .join(manifest_file) if !.file? errors.add(I18n.t("vagrant.provisioners.puppet.manifest_missing", :manifest => .to_s)) end end # Module paths validation .each do |path| if !path.directory? errors.add(I18n.t("vagrant.provisioners.puppet.module_path_missing", :path => path)) end end end |