Compare commits
3 Commits
f949c0aba0
...
b435117808
Author | SHA1 | Date | |
---|---|---|---|
b435117808 | |||
e93fd5c0a8 | |||
18e26723dd |
@ -13,9 +13,7 @@ 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:
|
||||
@ -27,13 +25,14 @@ with open(idfile, mode='w') as idfh:
|
||||
with open(formulasfile, mode='r') as formulasfh:
|
||||
formulas = yaml.load(formulasfh, Loader=yaml.FullLoader)
|
||||
|
||||
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)
|
||||
configfh.write('''# written by prepare_minion.py
|
||||
file_roots:
|
||||
production:
|
||||
- /srv/salt
|
||||
''')
|
||||
for formula in formulas:
|
||||
configfh.write(formula)
|
||||
|
||||
os.symlink(mypwd + '/salt', '/srv/salt')
|
||||
os.symlink(mypwd + '/pillar', '/srv/pillar')
|
||||
|
Loading…
x
Reference in New Issue
Block a user