Exemple #1
0
def config_changed():

    setup_ocf_files()

    if config('prefer-ipv6'):
        assert_charm_supports_ipv6()

    corosync_key = config('corosync_key')
    if not corosync_key:
        message = 'No Corosync key supplied, cannot proceed'
        status_set('blocked', message)
        raise Exception(message)

    enable_lsb_services('pacemaker')

    if config('prefer-ipv6'):
        for rid in relation_ids('hanode'):
            ensure_ipv6_requirements(rid)

    status_set('maintenance', "Setting up corosync")
    if configure_corosync():
        pcmk.wait_for_pcmk()
        configure_cluster_global()
        configure_monitor_host()
        configure_stonith()

    update_nrpe_config()
Exemple #2
0
def config_changed():

    setup_ocf_files()

    if config('prefer-ipv6'):
        assert_charm_supports_ipv6()

    corosync_key = config('corosync_key')
    if not corosync_key:
        message = 'No Corosync key supplied, cannot proceed'
        status_set('blocked', message)
        raise Exception(message)

    enable_lsb_services('pacemaker')

    for rid in relation_ids('hanode'):
        hanode_relation_joined(rid)

    status_set('maintenance', "Setting up corosync")
    if configure_corosync():
        try_pcmk_wait()
        configure_cluster_global()
        configure_monitor_host()
        configure_stonith()

    update_nrpe_config()

    cfg = config()
    if (is_leader()
            and cfg.previous('maintenance-mode') != cfg['maintenance-mode']):
        maintenance_mode(cfg['maintenance-mode'])
Exemple #3
0
def config_changed():

    # if we are paused, delay doing any config changed hooks.
    # It is forced on the resume.
    if is_unit_paused_set():
        log("Unit is pause or upgrading. Skipping config_changed", "WARN")
        return

    setup_ocf_files()

    if config('prefer-ipv6'):
        assert_charm_supports_ipv6()

    corosync_key = config('corosync_key')
    if not corosync_key:
        message = 'No Corosync key supplied, cannot proceed'
        status_set('blocked', message)
        raise Exception(message)

    enable_lsb_services('pacemaker')

    for rid in relation_ids('hanode'):
        hanode_relation_joined(rid)

    status_set('maintenance', "Setting up corosync")
    if configure_corosync():
        try_pcmk_wait()
        if is_leader():
            run_initial_setup()

    update_nrpe_config()

    cfg = config()
    if (is_leader()
            and cfg.previous('maintenance-mode') != cfg['maintenance-mode']):
        maintenance_mode(cfg['maintenance-mode'])

    if config('no_quorum_policy').lower() in [
            'ignore', 'freeze', 'stop', 'suicide'
    ]:
        pcmk.set_property("no-quorum-policy",
                          config('no_quorum_policy').lower())
    else:
        message = 'Invalid setting for no_quorum_policy'
        status_set('blocked', message)
    status_set(*assess_status_helper())
Exemple #4
0
def config_changed():

    # if we are paused, delay doing any config changed hooks.
    # It is forced on the resume.
    if is_unit_paused_set():
        log("Unit is pause or upgrading. Skipping config_changed", "WARN")
        return

    setup_ocf_files()

    if config('prefer-ipv6'):
        assert_charm_supports_ipv6()

    corosync_key = config('corosync_key')
    if not corosync_key:
        message = 'No Corosync key supplied, cannot proceed'
        status_set('blocked', message)
        raise Exception(message)

    enable_lsb_services('pacemaker')

    for rid in relation_ids('hanode'):
        hanode_relation_joined(rid)

    status_set('maintenance', "Setting up corosync")
    if configure_corosync():
        try_pcmk_wait()
        failure_timeout = config('failure_timeout')
        configure_cluster_global(failure_timeout)
        configure_monitor_host()
        configure_stonith()

    update_nrpe_config()

    cfg = config()
    if (is_leader()
            and cfg.previous('maintenance-mode') != cfg['maintenance-mode']):
        maintenance_mode(cfg['maintenance-mode'])
Exemple #5
0
def config_changed():

    # if we are paused, delay doing any config changed hooks.
    # It is forced on the resume.
    if is_unit_paused_set():
        log("Unit is pause or upgrading. Skipping config_changed", "WARN")
        return

    setup_ocf_files()

    if config('prefer-ipv6'):
        assert_charm_supports_ipv6()

    corosync_key = config('corosync_key')
    if not corosync_key:
        message = 'No Corosync key supplied, cannot proceed'
        status_set('blocked', message)
        raise Exception(message)

    enable_lsb_services('pacemaker')

    for rid in relation_ids('hanode'):
        hanode_relation_joined(rid)

    status_set('maintenance', "Setting up corosync")
    if configure_corosync():
        try_pcmk_wait()
        configure_cluster_global()
        configure_monitor_host()
        configure_stonith()

    update_nrpe_config()

    cfg = config()
    if (is_leader() and
            cfg.previous('maintenance-mode') != cfg['maintenance-mode']):
        maintenance_mode(cfg['maintenance-mode'])