Merge "Enable the use of a non-standard module-path for ansible."
This commit is contained in:
commit
3aee7e82b2
hot/software-config/elements/heat-config-ansible/install.d
tests/software_config
@ -51,6 +51,7 @@ def main(argv=sys.argv):
|
||||
variables[input['name']] = input.get('value', '')
|
||||
|
||||
tags = c['options'].get('tags')
|
||||
modulepath = c['options'].get('modulepath')
|
||||
|
||||
fn = os.path.join(WORKING_DIR, '%s_playbook.yaml' % c['id'])
|
||||
vars_filename = os.path.join(WORKING_DIR, '%s_variables.json' % c['id'])
|
||||
@ -80,6 +81,10 @@ def main(argv=sys.argv):
|
||||
if tags:
|
||||
cmd.insert(3, '--tags')
|
||||
cmd.insert(4, tags)
|
||||
if modulepath:
|
||||
cmd.insert(3, '--module-path')
|
||||
cmd.insert(4, modulepath)
|
||||
|
||||
log.debug('Running %s' % (' '.join(cmd),))
|
||||
try:
|
||||
subproc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
|
@ -47,6 +47,17 @@ class HookAnsibleTest(common.RunScriptTest):
|
||||
'config': 'the ansible playbook'
|
||||
}
|
||||
|
||||
data_modulepath = data.copy()
|
||||
data_modulepath.update({
|
||||
'options': {'modulepath': '/opt/ansible:/usr/share/ansible'},
|
||||
})
|
||||
|
||||
data_tags_modulepath = data.copy()
|
||||
data_tags_modulepath.update({
|
||||
'options': {'modulepath': '/opt/ansible:/usr/share/ansible',
|
||||
'tags': 'abc,def'},
|
||||
})
|
||||
|
||||
def setUp(self):
|
||||
super(HookAnsibleTest, self).setUp()
|
||||
self.hook_path = self.relative_path(
|
||||
@ -78,6 +89,17 @@ class HookAnsibleTest(common.RunScriptTest):
|
||||
def test_hook_tags(self):
|
||||
self._hook_run(data=self.data_tags, options=['--tags', 'abc,def'])
|
||||
|
||||
def test_hook_modulepath(self):
|
||||
self._hook_run(data=self.data_modulepath,
|
||||
options=['--module-path',
|
||||
'/opt/ansible:/usr/share/ansible'])
|
||||
|
||||
def test_hook_tags_modulepath(self):
|
||||
self._hook_run(data=self.data_tags_modulepath,
|
||||
options=['--module-path',
|
||||
'/opt/ansible:/usr/share/ansible',
|
||||
'--tags', 'abc,def'])
|
||||
|
||||
def _hook_run(self, data=None, options=None):
|
||||
|
||||
self.env.update({
|
||||
|
Loading…
x
Reference in New Issue
Block a user