def run(module, result): match = module.params['match'] replace = module.params['replace'] candidate = get_candidate(module) if match != 'none': config = get_running_config(module) path = module.params['parents'] configobjs = candidate.difference(config, match=match, replace=replace, path=path) else: configobjs = candidate.items if configobjs: commands = dumps(configobjs, 'commands').split('\n') if module.params['lines']: if module.params['before']: commands[:0] = module.params['before'] if module.params['after']: commands.extend(module.params['after']) result['commands'] = commands result['updates'] = commands if not module.check_mode: load_config(module, commands) result['changed'] = True
def run(module, result): match = module.params['match'] replace = module.params['replace'] candidate = get_candidate(module) if match != 'none': config = get_running_config(module) path = module.params['parents'] configobjs = candidate.difference(config, match=match, replace=replace, path=path) else: configobjs = candidate.items if configobjs: commands = dumps(configobjs, 'commands').split('\n') if module.params['lines']: if module.params['before']: commands[:0] = module.params['before'] if module.params['after']: commands.extend(module.params['after']) result['commands'] = commands result['updates'] = commands if not module.check_mode: load_config(module, commands) result['changed'] = True
def cli_load_config(self, commands): """load config by cli""" if not self.module.check_mode: load_config(self.module, commands)
def cli_load_config(self, commands): """ Cli load configuration """ if not self.module.check_mode: load_config(self.module, commands)
def cli_load_config(self, commands): """load config by cli""" if not self.module.check_mode: load_config(self.module, commands)
def cli_load_config(self, commands): """ Cli method to load config """ if not self.module.check_mode: load_config(self.module, commands)
def cli_load_config(self, commands): """ Load configure through cli """ if not self.module.check_mode: load_config(self.module, commands)
def cli_load_config(self, commands): """ Cli load configuration """ if not self.module.check_mode: load_config(self.module, commands)