def master_state_relation_changed(): if not relation_get('identity'): juju_log('Relationship with slave-state not yet complete') return process_clustered_data() state = relation_get('state') if check_all_clustered_nodes(state): if state == 'install': status_set('maintenance', 'Installing grid') if install_grid(): install_root_scripts() send_notification("master-state", "cluster") elif state == 'clustered': if install_db(): status_set('maintenance', 'Installing Database') install_db_root_scripts() send_notification("master-state", "database") elif state == 'final': send_notification("master-state", "final") set_oracle_env() create_db() configure_database() for rid in relation_ids('oracle'): oracle_relation_changed(relation_id=rid) juju_log("Oracle Rac 12C installation is succeeded on master") status_set('active', 'Unit is ready')
def start(): if config('jboss-db-on-host'): oracle_host = set_oracle_host() if oracle_host: set_oracle_env() configure_database() 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 start(): if not config('slave-units-number'): status_set('maintenance', 'Performing Oracle standalone Installation') download_cplane_packages() copy_oracle_package() modify_oracle_db_response_file() if install_db(): install_db_root_scripts() set_oracle_env() create_db() configure_database() juju_log('Database is created and the listerner is started') status_set('active', 'Unit is ready')