salt/bin/prepare_mock.py
Georg Pfuetzenreuter a42961e982
Update mocking base
- adapt preparation script to new environment
- add sample mocking pillar including README

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-01-21 18:54:58 +01:00

15 lines
348 B
Python
Executable File

#!/usr/bin/env python3
import os
import shutil
import socket
iddir = 'pillar/id/'
secretiddir = 'pillar/secret/id/'
baseidfile = 'pillar/mock/example.sls'
myidfile = socket.gethostname() + '.sls'
shutil.copyfile(baseidfile, os.path.join(iddir, myidfile))
os.makedirs(secretiddir)
shutil.copyfile(baseidfile, os.path.join(secretiddir, myidfile))