def config_present(name, value):
 name = name.lower()
 ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''}
 config = _load_config()
 if isinstance(value, bool):
  value = ('true' if value else 'false')
 if (not value):
  value = ''
 if (name in config):
  if (str(config[name]) == str(value)):
   ret['result'] = True
   ret['comment'] = 'property {0} already has value "{1}"'.format(name, value)
  else:
   ret['result'] = True
   ret['comment'] = 'updated property {0} with value "{1}"'.format(name, value)
   ret['changes'][name] = value
   config[name] = value
 else:
  ret['result'] = True
  ret['comment'] = 'added property {0} with value "{1}"'.format(name, value)
  ret['changes'][name] = value
  config[name] = value
 if ((not __opts__['test']) and (len(ret['changes']) > 0)):
  ret['result'] = _write_config(config)
 return ret

def config_present ( name , value ) : name = name . lower ( ) ret = { 'name' : name , 'changes' : { } , 'result' : None , 'comment' : '' } config = _load_config ( ) if isinstance ( value , bool ) : value = ( 'true' if value else 'false' ) if ( not value ) : value = '' if ( name in config ) : if ( str ( config [ name ] ) == str ( value ) ) : ret [ 'result' ] = True ret [ 'comment' ] = 'property {0} already has value "{1}"' . format ( name , value ) else : ret [ 'result' ] = True ret [ 'comment' ] = 'updated property {0} with value "{1}"' . format ( name , value ) ret [ 'changes' ] [ name ] = value config [ name ] = value else : ret [ 'result' ] = True ret [ 'comment' ] = 'added property {0} with value "{1}"' . format ( name , value ) ret [ 'changes' ] [ name ] = value config [ name ] = value if ( ( not __opts__ [ 'test' ] ) and ( len ( ret [ 'changes' ] ) > 0 ) ) : ret [ 'result' ] = _write_config ( config ) return ret
ensure a specific configuration line exists in the running config name config line to set examples: .