diff --git a/hot/software-config/elements/heat-config-puppet/README.rst b/hot/software-config/elements/heat-config-puppet/README.rst index 3c7386d1..d03eb615 100644 --- a/hot/software-config/elements/heat-config-puppet/README.rst +++ b/hot/software-config/elements/heat-config-puppet/README.rst @@ -8,3 +8,5 @@ Hook Options: use_facter: default True. Set to True to pass puppet inputs via Facter use_hiera: default False. Set to True to pass puppet inputs via Hiera modulepath: If set, puppet will use this filesystem path to load modules + tags: If set, puppet will use the specified value(s) to apply only a + subset of the catalog for a given manifest. diff --git a/hot/software-config/elements/heat-config-puppet/install.d/hook-puppet.py b/hot/software-config/elements/heat-config-puppet/install.d/hook-puppet.py index 25632cf1..cb418cea 100755 --- a/hot/software-config/elements/heat-config-puppet/install.d/hook-puppet.py +++ b/hot/software-config/elements/heat-config-puppet/install.d/hook-puppet.py @@ -60,6 +60,7 @@ def main(argv=sys.argv): use_hiera = c['options'].get('enable_hiera', False) use_facter = c['options'].get('enable_facter', True) modulepath = c['options'].get('modulepath') + tags = c['options'].get('tags') facts = {} hiera = {} @@ -103,6 +104,9 @@ def main(argv=sys.argv): if modulepath: cmd.insert(-1, '--modulepath') cmd.insert(-1, modulepath) + if tags: + cmd.insert(-1, '--tags') + cmd.insert(-1, tags) log.debug('Running %s %s' % (env_debug, ' '.join(cmd))) try: subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE, diff --git a/tests/software_config/test_hook_puppet.py b/tests/software_config/test_hook_puppet.py index 5516bac0..225da9e0 100644 --- a/tests/software_config/test_hook_puppet.py +++ b/tests/software_config/test_hook_puppet.py @@ -161,6 +161,7 @@ class HookPuppetTest(common.RunScriptTest): modulepath = self.working_dir.join() data = copy.deepcopy(self.data) data['options']['modulepath'] = modulepath + data['options']['tags'] = 'package,file' returncode, stdout, stderr = self.run_cmd( [self.hook_path], self.env, json.dumps(data)) @@ -184,6 +185,8 @@ class HookPuppetTest(common.RunScriptTest): '--detailed-exitcodes', '--modulepath', modulepath, + '--tags', + 'package,file', puppet_script ], state['args'])