Configure formulas in prepare_minion.py

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2023-01-21 19:51:39 +01:00
parent 7f9bf11048
commit 5e262f5f5f
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57

View File

@ -9,6 +9,7 @@ import socket
roles = roles.get()
grainsfile = '/etc/salt/grains'
idfile = 'pillar/id/' + socket.gethostname() + '.sls'
configfile = '/etc/salt/minion.d/local.conf'
mypwd = os.getcwd()
grainsdata = {'roles': roles}
@ -19,5 +20,13 @@ with open(grainsfile, mode='w') as grainsfh:
with open(idfile, mode='w') as idfh:
idfh.write('# empty')
with open(configfile, mode='w') as configfh:
configfh.write('''# written by prepare_minion.py
file_roots:
production:
- /srv/salt
- /srv/formulas/salt-formula
''')
os.symlink(mypwd + '/salt', '/srv/salt')
os.symlink(mypwd + '/pillar', '/srv/pillar')