def install(): pkgs = determine_packages() apt_install(pkgs, fatal=True) download_cplane_packages() install_oracle() configure_oracle() install_reboot_scripts()
def install(): pkgs = determine_packages() apt_install(pkgs, fatal=True) configure_host() download_cplane_packages() install_oracle() configure_oracle() install_reboot_scripts()
def upgrade_charm(): download_cplane_installer() upgrade_type = get_upgrade_type() stop_jboss_service() if upgrade_type == 'clean-db': clean_create_db() cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() start_services(upgrade_type)
def oracle_relation_changed(): if config('jboss-db-on-host') is False: oracle_host = set_oracle_host() if oracle_host: if check_jboss_service() is False: cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() prepare_database() start_services('create-db')
def oracle_relation_changed(): if config('jboss-db-on-host') is False: oracle_host = set_oracle_host() if oracle_host: if check_jboss_service() is False: cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() if is_leader(): configure_database() prepare_database() start_services('create-db')
def upgrade_charm(): download_cplane_installer() upgrade_type = get_upgrade_type() stop_jboss_service() if upgrade_type == 'clean-db': if is_leader(): leader_set({'status': "db_cleaned"}) clean_create_db() cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() start_services(upgrade_type)
def config_changed(): upgrade_type = get_upgrade_type() if upgrade_type == 'clean-db' or upgrade_type == 'reuse-db': flush_upgrade_type() elif check_jboss_service() is True: stop_jboss_service() run_cp_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() start_services('config-change') for r_id in relation_ids('cplane-controller'): cplane_controller_relation_joined(rid=r_id)
def install(): apt_update(fatal=True) pkgs = determine_packages() apt_install(pkgs, fatal=True) prepare_env() flush_upgrade_type() download_cplane_packages() install_jboss() install_jdk() cmd = "echo '#Added by cplane' >> /etc/hosts" os.system(cmd) if config('jboss-db-on-host'): install_oracle() configure_oracle() else: install_oracle_client() configure_oracle_client() cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts()
def install(): apt_update(fatal=True) pkgs = determine_packages() apt_install(pkgs, fatal=True) prepare_env() flush_upgrade_type() download_cplane_packages() install_jboss() install_jdk() cmd = "echo '#Added by cplane' >> /etc/hosts" os.system(cmd) if config('jboss-db-on-host'): install_oracle() configure_oracle() else: install_oracle_client() configure_oracle_client() cplane_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts()
def config_changed(): if config('controller-app-mode') == 'msm' or config('controller-app-mode') == 'doctl': configs.write_all() upgrade_type = get_upgrade_type() if upgrade_type == 'clean-db' or upgrade_type == 'reuse-db': flush_upgrade_type() elif check_jboss_service() is True: stop_jboss_service() run_cp_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() start_services('config-change') for r_id in relation_ids('cplane-controller'): cplane_controller_relation_joined(rid=r_id) mtu_string = config('intf-mtu') if mtu_string: intf_mtu = mtu_string.split(',') for line in intf_mtu: interface = line.split('=') log("Change request for mtu for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'mtu', interface[1]) tso_string = config('tso-flag') if tso_string: intf_tso = tso_string.split(',') for line in intf_tso: interface = line.split('=') log("Change request for tso for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'tso', interface[1]) gso_string = config('gso-flag') if gso_string: intf_gso = gso_string.split(',') for line in intf_gso: interface = line.split('=') log("Change request for gso for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'gso', interface[1]) rx_string = config('rx-flag') if rx_string: intf_rx = rx_string.split(',') for line in intf_rx: interface = line.split('=') log("Change request for rx for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'rx', interface[1]) tx_string = config('tx-flag') if tx_string: intf_tx = tx_string.split(',') for line in intf_tx: interface = line.split('=') log("Change request for tx for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'tx', interface[1]) sg_string = config('sg-flag') if sg_string: intf_sg = sg_string.split(',') for line in intf_sg: interface = line.split('=') log("Change request for sg for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'sg', interface[1]) ufo_string = config('ufo-flag') if ufo_string: intf_ufo = ufo_string.split(',') for line in intf_ufo: interface = line.split('=') log("Change request for ufo for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'ufo', interface[1]) gro_string = config('gro-flag') if gro_string: intf_gro = gro_string.split(',') for line in intf_gro: interface = line.split('=') log("Change request for gro for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'gro', interface[1]) lro_string = config('lro-flag') if lro_string: intf_lro = lro_string.split(',') for line in intf_lro: interface = line.split('=') log("Change request for lro for interface {} = {}" .format(interface[0], interface[1])) change_iface_config(interface[0], 'lro', interface[1])
def config_changed(): if config('controller-app-mode') == 'msm' or \ config('controller-app-mode') == 'doctl': configs.write_all() upgrade_type = get_upgrade_type() if upgrade_type == 'clean-db' or upgrade_type == 'reuse-db': flush_upgrade_type() elif check_jboss_service() is True: stop_jboss_service() run_cp_installer() if config('intall-reboot-scripts') == 'y': install_reboot_scripts() start_services('config-change') for r_id in relation_ids('cplane-controller'): cplane_controller_relation_joined(rid=r_id) mtu_string = config('intf-mtu') if mtu_string: intf_mtu = mtu_string.split(',') for line in intf_mtu: interface = line.split('=') log("Change request for mtu for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'mtu', interface[1]) tso_string = config('tso-flag') if tso_string: intf_tso = tso_string.split(',') for line in intf_tso: interface = line.split('=') log("Change request for tso for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'tso', interface[1]) gso_string = config('gso-flag') if gso_string: intf_gso = gso_string.split(',') for line in intf_gso: interface = line.split('=') log("Change request for gso for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'gso', interface[1]) rx_string = config('rx-flag') if rx_string: intf_rx = rx_string.split(',') for line in intf_rx: interface = line.split('=') log("Change request for rx for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'rx', interface[1]) tx_string = config('tx-flag') if tx_string: intf_tx = tx_string.split(',') for line in intf_tx: interface = line.split('=') log("Change request for tx for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'tx', interface[1]) sg_string = config('sg-flag') if sg_string: intf_sg = sg_string.split(',') for line in intf_sg: interface = line.split('=') log("Change request for sg for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'sg', interface[1]) ufo_string = config('ufo-flag') if ufo_string: intf_ufo = ufo_string.split(',') for line in intf_ufo: interface = line.split('=') log("Change request for ufo for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'ufo', interface[1]) gro_string = config('gro-flag') if gro_string: intf_gro = gro_string.split(',') for line in intf_gro: interface = line.split('=') log("Change request for gro for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'gro', interface[1]) lro_string = config('lro-flag') if lro_string: intf_lro = lro_string.split(',') for line in intf_lro: interface = line.split('=') log("Change request for lro for interface {} = {}".format( interface[0], interface[1])) change_iface_config(interface[0], 'lro', interface[1])