from bundlewrap.utils.dicts import merge_dict defaults = { 'apt': { 'packages': { 'influxdb': {}, }, 'repos': { 'influxdb': { 'items': { 'deb https://repos.influxdata.com/{os} {os_release} stable', }, }, }, }, } if node.has_bundle('zfs'): defaults = merge_dict(defaults, { 'apt': { 'packages': { 'influxdb': { 'needs': { 'zfs_dataset:tank/influxdb', }, }, }, }, 'zfs': { 'datasets': { 'tank/influxdb': { 'mountpoint': '/var/lib/influxdb', }, }, }, })