Skip to content
Snippets Groups Projects
Commit 8f5f50a4 authored by František Dvořák's avatar František Dvořák
Browse files

Hadoop: copy to machines also the 2nd stage recipes

parent d3725c87
No related branches found
No related tags found
No related merge requests found
Pipeline #420 passed
...@@ -21,19 +21,25 @@ class ComponentHadoop: ...@@ -21,19 +21,25 @@ class ComponentHadoop:
def action(self, action): def action(self, action):
if action == 'files': if action == 'files':
print('-> site.pp')
if not self.args.dry_run: if not self.args.dry_run:
template = None template = None
with open('%s/site.pp.tmpl' % self.config['type'], 'r') as f: with open('%s/site.pp.tmpl' % self.config['type'], 'r') as f:
template = string.Template(f.read()) template = string.Template(f.read())
if template: if template:
print('-> site.pp')
site = template.substitute(self.params) site = template.substitute(self.params)
with open('site.pp', 'w') as f: with open('site.pp', 'w') as f:
f.write(site) f.write(site)
self.params['hdfs_deployed'] = 'true'
site = template.substitute(self.params)
print('-> site2.pp')
with open('site2.pp', 'w') as f:
f.write(site)
def init_commands(self): def init_commands(self):
return [ return [
['ansible', '-i', './inventory', '-m', 'copy', '-a', 'src=site.pp dest=/root', 'all'], ['ansible', '-i', './inventory', '-m', 'copy', '-a', 'src=site.pp dest=/root', 'all'],
['ansible', '-i', './inventory', '-m', 'copy', '-a', 'src=site2.pp dest=/root', 'all'],
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment