if node.has_bundle('pppd'):
    files['/etc/ppp/ip-up.d/radvd'] = {
        'source': 'ip-up',
        'mode': '0755',
    }
    files['/etc/ppp/ip-down.d/radvd'] = {
        'source': 'ip-down',
        'mode': '0755',
    }

    # Will be started and stopped by pppd.
    SHOULD_BE_RUNNING = None
    SHOULD_BE_ENABLED = False
else:
    SHOULD_BE_RUNNING = True
    SHOULD_BE_ENABLED = True

files['/etc/radvd.conf'] = {
    'content_type': 'mako',
    'context': {
        'interfaces': node.metadata['radvd']['interfaces'],
    },
    'triggers': {
        'svc_systemd:radvd:restart',
    },
}

svc_systemd = {
    'radvd': {
        'running': SHOULD_BE_RUNNING,
        'enabled': SHOULD_BE_ENABLED,
        'needs': {
            'file:/etc/radvd.conf',
        },
    },
}
