There are a couple methods depending on how you handle your configuration and/or build your automations and scripts.
For static (and “relatively” static) data like your mapping example, one option is to use a custom Jinja file. You can declare variables in a file in your custom_templates
folder.
#/config/custom_templates/constants.jinja
{% set speaker_mapping = {
'master bedroom': 'media_player.master_bedroom_speaker_ma',
'living room': 'media_player.living_room_display_ma',
'kitchen': 'media_player.kitchen_speaker_ma',
'floor up': 'media_player.floor_up_ma',
'floor below': 'media_player.floor_below_ma',
'children room': 'media_player.children_s_speaker_ma',
'office': 'media_player.office_room_speaker_ma',
'zvi room': 'media_player.office_room_speaker_ma',
'yael room': 'media_player.children_room_speaker_ma',
'all speakers': 'media_player.all_speakers_ma'} %}
Then import them into templates anywhere you need to.
{% from 'constants.jinja' import speaker_mapping %}
{{ speaker_mapping.get('kitchen') }}