import subprocess def _puppet_config(name): output = subprocess.check_output(['puppet', 'config', 'print', name]) return str(output, 'utf-8').strip() puppet_key = _puppet_config('hostprivkey') puppet_crt = _puppet_config('hostcert') puppet_ca = _puppet_config('localcacert') puppet_ca_host = 'puppet-ca.uninett.no' puppet_ca_port = 8140 puppetdb_host = 'puppetdb.uninett.no' puppetdb_port = 8081