summaryrefslogtreecommitdiff
path: root/bin/puppet_command
diff options
context:
space:
mode:
authorMicah Anderson <micah@leap.se>2014-10-20 21:44:37 -0400
committerMicah Anderson <micah@leap.se>2014-10-21 16:43:30 -0400
commitf6ffad33042aa6580ec00ef23836291861c1ae17 (patch)
treeb2f45138bea980e080779c3f139a5c25f64b988b /bin/puppet_command
parent189bd4b704ba685640ca01afe90f592e7b33567a (diff)
implement custom puppet support (#6201, #6226)
change puppet command to include in the --modulepath /srv/leap/files/puppet/modules If a provider places puppet code under files/puppet it will be sync'd over to all the nodes, once leap cli #6225 is merged. The custom puppet entry point is in class 'custom' which can be put into files/puppet/modules/custom/manifests/init.pp Change-Id: I74879c6ee056b03cd4691aa81a7668b60383bdad
Diffstat (limited to 'bin/puppet_command')
-rwxr-xr-xbin/puppet_command5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/puppet_command b/bin/puppet_command
index 5e690bef..cdb0b027 100755
--- a/bin/puppet_command
+++ b/bin/puppet_command
@@ -14,6 +14,8 @@ PUPPET_BIN = '/usr/bin/puppet'
PUPPET_DIRECTORY = '/srv/leap'
PUPPET_PARAMETERS = '--color=false --detailed-exitcodes --libdir=puppet/lib --confdir=puppet'
SITE_MANIFEST = 'puppet/manifests/site.pp'
+SITE_MODULES = 'puppet/modules'
+CUSTOM_MODULES = ':files/puppet/modules'
DEFAULT_TAGS = 'leap_base,leap_service'
HIERA_FILE = '/etc/leap/hiera.yaml'
@@ -93,10 +95,11 @@ end
def puppet_apply(options={}, &block)
options = {:verbosity => @verbosity, :tags => @tags}.merge(options)
manifest = options[:manifest] || SITE_MANIFEST
+ modulepath = options[:module_path] || SITE_MODULES + CUSTOM_MODULES
fqdn = hiera_file['domain']['name']
domain = hiera_file['domain']['full_suffix']
Dir.chdir(PUPPET_DIRECTORY) do
- return run("FACTER_fqdn='#{fqdn}' FACTER_domain='#{domain}' #{PUPPET_BIN} apply #{custom_parameters(options)} #{PUPPET_PARAMETERS} #{manifest}", &block)
+ return run("FACTER_fqdn='#{fqdn}' FACTER_domain='#{domain}' #{PUPPET_BIN} apply #{custom_parameters(options)} --modulepath='#{modulepath}' #{PUPPET_PARAMETERS} #{manifest}", &block)
end
end