diff options
author | Varac <varac@leap.se> | 2014-10-22 20:42:30 +0800 |
---|---|---|
committer | Gerrit Code Review <gerrit2@review.leap.se> | 2014-10-22 20:42:30 +0800 |
commit | a936a12ca449a844174baad841332f2c5a9a2bff (patch) | |
tree | a0c4a89a23d8bbd89fcfa0b3d3f656682b29cfb5 | |
parent | 51a1e1c6db33ed2868ec74728f854237e3dfd86a (diff) | |
parent | f6ffad33042aa6580ec00ef23836291861c1ae17 (diff) |
Merge "implement custom puppet support (#6201, #6226)" into develop
-rwxr-xr-x | bin/puppet_command | 5 | ||||
-rw-r--r-- | puppet/modules/site_config/manifests/default.pp | 6 |
2 files changed, 7 insertions, 4 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 diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp index fc2179de..790b5a16 100644 --- a/puppet/modules/site_config/manifests/default.pp +++ b/puppet/modules/site_config/manifests/default.pp @@ -59,10 +59,10 @@ class site_config::default { include site_postfix::satellite } - # if class site_custom exists, include it. + # if class custom exists, include it. # possibility for users to define custom puppet recipes - if defined( '::site_custom') { - include ::site_custom + if defined( '::custom') { + include ::custom } include site_check_mk::agent |