files = {
    '/etc/mosquitto/mosquitto.conf': {
        'content_type': 'mako',
        'triggers': {
            'svc_systemd:mosquitto:restart',
        },
    },
    '/usr/local/bin/tasmota-telegraf-plugin': {
        'mode': '0755',
        'needs': {
            'pkg_apt:python3-paho-mqtt',
        },
    },
}

svc_systemd = {
    'mosquitto': {
        'needs': {
            'file:/etc/mosquitto/mosquitto.conf',
            'pkg_apt:mosquitto',
        },
    },
}

if node.has_bundle('telegraf'):
    files['/usr/local/bin/tasmota-telegraf-plugin']['triggers'] = {
        'svc_systemd:telegraf:restart',
    }
