Example #1
0
def start():
    # In case we're being redeployed to the same machines, try
    # to make sure everything is running as soon as possible.
    if ceph.systemd():
        service_restart('ceph-mon')
    else:
        service_restart('ceph-mon-all')
    if cmp_pkgrevno('ceph', '12.0.0') >= 0:
        service_restart('ceph-mgr@{}'.format(socket.gethostname()))
Example #2
0
def aa_profile_changed(service_name='ceph-osd-all'):
    """
    Reload AA profie and restart OSD processes.
    """
    log("Loading new AppArmor profile")
    service_reload('apparmor')
    log("Restarting ceph-osd services with new AppArmor profile")
    if ceph.systemd():
        for osd_id in ceph.get_local_osd_ids():
            service_restart('ceph-osd@{}'.format(osd_id))
    else:
        service_restart(service_name)
Example #3
0
def aa_profile_changed(service_name='ceph-osd-all'):
    """
    Reload AA profie and restart OSD processes.
    """
    log("Loading new AppArmor profile")
    service_reload('apparmor')
    log("Restarting ceph-osd services with new AppArmor profile")
    if ceph.systemd():
        for osd_id in ceph.get_local_osd_ids():
            service_restart('ceph-osd@{}'.format(osd_id))
    else:
        service_restart(service_name)
Example #4
0
def install_apparmor_profile():
    """
    Install ceph apparmor profiles and configure
    based on current setting of 'aa-profile-mode'
    configuration option.
    """
    log('Installing apparmor profile for ceph-osd')
    copy_profile_into_place()
    if config().changed('aa-profile-mode'):
        aa_context = CephOsdAppArmorContext()
        aa_context.setup_aa_profile()
        service_reload('apparmor')
        if ceph.systemd():
            for osd_id in ceph.get_local_osd_ids():
                service_restart('ceph-osd@{}'.format(osd_id))
        else:
            service_restart('ceph-osd-all')