Compare commits
3 Commits
b435117808
...
9aa39f97e4
Author | SHA1 | Date | |
---|---|---|---|
9aa39f97e4 | |||
2a5962e292 | |||
73df34c558 |
@ -9,10 +9,10 @@ import yaml
|
|||||||
|
|
||||||
roles = roles.get()
|
roles = roles.get()
|
||||||
grainsfile = '/etc/salt/grains'
|
grainsfile = '/etc/salt/grains'
|
||||||
idfile = os.path.join('pillar/id/', socket.gethostname() + '.sls')
|
idfile = os.path.join('pillar/id/', socket.gethostname(), '.sls')
|
||||||
configfile = '/etc/salt/minion.d/local.conf'
|
configfile = '/etc/salt/minion.d/local.conf'
|
||||||
mypwd = os.getcwd()
|
mypwd = os.getcwd()
|
||||||
formulasfile = 'formulas.yaml'
|
formulasfile = os.path.join('..', 'formulas.yaml')
|
||||||
|
|
||||||
grainsdata = {'roles': roles}
|
grainsdata = {'roles': roles}
|
||||||
|
|
||||||
@ -23,14 +23,14 @@ with open(idfile, mode='w') as idfh:
|
|||||||
idfh.write('# empty')
|
idfh.write('# empty')
|
||||||
|
|
||||||
with open(formulasfile, mode='r') as formulasfh:
|
with open(formulasfile, mode='r') as formulasfh:
|
||||||
formulas = yaml.load(formulasfh, Loader=yaml.FullLoader)
|
formulas = yaml.load(formulasfh, Loader=FullLoader)
|
||||||
|
|
||||||
with open(configfile, mode='w') as configfh:
|
with open(configfile, mode='w') as configfh:
|
||||||
configfh.write('''# written by prepare_minion.py
|
configfh.write(''''# written by prepare_minion.py
|
||||||
file_roots:
|
file_roots:
|
||||||
production:
|
production:
|
||||||
- /srv/salt
|
- /srv/salt
|
||||||
''')
|
'''
|
||||||
for formula in formulas:
|
for formula in formulas:
|
||||||
configfh.write(formula)
|
configfh.write(formula)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user