def _update_firewalls(self, config_section): # Generate the correct file execute('firewall.update_files', section=config_section) task = functions.get_task_instance('firewall.update_files') filename = task.get_section_path(config_section) execute('firewall.sync_single', filename=filename) # Update any section where this section appears for section in env.config_object.sections(): if config_section in env.config_object.get_list(section, env.config_object.ALLOWED_SECTIONS): execute('firewall.update_files', section=section)
def _update_firewalls(self, config_section): if self.setup_firewall: # Generate the correct file execute('firewall.update_files', section=config_section) task = functions.get_task_instance('firewall.update_files') filename = task.get_section_path(config_section) execute('firewall.sync_single', filename=filename) # Update any section where this section appears for section in env.config_object.server_sections(): if config_section in env.config_object.get_list( section, env.config_object.ALLOWED_SECTIONS): execute('firewall.update_files', section=section)
def run(self, name=None): """ """ self._update_config(self.config_section) master = self._get_master() self._secure_ssh() self._set_profile() self._add_snmp(self.config_section) self._update_firewalls(self.config_section) execute('postgres.slave_setup', master=master, section=self.config_section) self._save_config() # update firewall for db-server task = functions.get_task_instance('firewall.update_files') filename = task.get_section_path('db-server') execute('firewall.sync_single', filename=filename, hosts=[master])
def run(self, name=None): """ """ self._secure_ssh() self._set_profile() self._update_config(self.config_section) master = self._get_master() self._add_snmp(self.config_section) self._update_firewalls(self.config_section) execute('postgres.slave_setup', master=master, section=self.config_section) self._save_config() # update firewall for db-server task = functions.get_task_instance('firewall.update_files') if task: filename = task.get_section_path('db-server') execute('firewall.sync_single', filename=filename, hosts=[master])
def _add_snmp(self, config_section): if self.setup_snmp: execute('snmp.update_files', section=config_section) task = functions.get_task_instance('snmp.update_files') filename = task.get_section_path(config_section) execute('snmp.sync_single', filename=filename)