Compare commits
3 Commits
b435117808
...
f949c0aba0
Author | SHA1 | Date | |
---|---|---|---|
f949c0aba0 | |||
56a1e11ef6 | |||
d627582075 |
@ -13,7 +13,9 @@ idfile = os.path.join('pillar/id/', socket.gethostname() + '.sls')
|
||||
configfile = '/etc/salt/minion.d/local.conf'
|
||||
mypwd = os.getcwd()
|
||||
formulasfile = 'formulas.yaml'
|
||||
formulasdir = '/srv/formulas'
|
||||
|
||||
configdata = {'file_roots': {'production': ['/srv/salt']}}
|
||||
grainsdata = {'roles': roles}
|
||||
|
||||
with open(grainsfile, mode='w') as grainsfh:
|
||||
@ -25,14 +27,13 @@ with open(idfile, mode='w') as idfh:
|
||||
with open(formulasfile, mode='r') as formulasfh:
|
||||
formulas = yaml.load(formulasfh, Loader=yaml.FullLoader)
|
||||
|
||||
with open(configfile, mode='w') as configfh:
|
||||
configfh.write('''# written by prepare_minion.py
|
||||
file_roots:
|
||||
production:
|
||||
- /srv/salt
|
||||
''')
|
||||
for formula in formulas:
|
||||
configfh.write(formula)
|
||||
for formula in formulas:
|
||||
formula = os.path.join('/srv/formulas/', formula + '-formula')
|
||||
configdata['file_roots']['production'].append(formula)
|
||||
|
||||
with open(configfile, mode='w') as configfh:
|
||||
configfh.write('# written by prepare_minion.py\n')
|
||||
yaml.dump(configdata, configfh)
|
||||
|
||||
os.symlink(mypwd + '/salt', '/srv/salt')
|
||||
os.symlink(mypwd + '/pillar', '/srv/pillar')
|
||||
|
Loading…
x
Reference in New Issue
Block a user