def save_cert(name, master):
 ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}
 cert = '/etc/icinga2/pki/trusted-master.crt'
 if os.path.isfile(cert):
  ret['comment'] = 'No execution needed. Cert: {0} already saved.'.format(cert)
  return ret
 if __opts__['test']:
  ret['result'] = None
  ret['comment'] = 'Certificate save for icinga2 master would be executed'
  return ret
 cert_save = __salt__['icinga2.save_cert'](name, master)
 if (not cert_save):
  ret['comment'] = 'Certificate for icinga2 master saved'
  ret['changes']['cert'] = 'Executed. Certificate saved: {0}'.format(cert)
 return ret

def save_cert ( name , master ) : ret = { 'name' : name , 'changes' : { } , 'result' : True , 'comment' : '' } cert = '/etc/icinga2/pki/trusted-master.crt' if os . path . isfile ( cert ) : ret [ 'comment' ] = 'No execution needed. Cert: {0} already saved.' . format ( cert ) return ret if __opts__ [ 'test' ] : ret [ 'result' ] = None ret [ 'comment' ] = 'Certificate save for icinga2 master would be executed' return ret cert_save = __salt__ [ 'icinga2.save_cert' ] ( name , master ) if ( not cert_save ) : ret [ 'comment' ] = 'Certificate for icinga2 master saved' ret [ 'changes' ] [ 'cert' ] = 'Executed. Certificate saved: {0}' . format ( cert ) return ret
save the certificate for master icinga2 node .