[Unit]
Description={{ item.name }} key fetch service
After={{ fetch_key_service_after }}
Before={{ fetch_key_service_before }}

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/open_volume "{{ key_server }}" {{ disk_image_path }} {{ device_name }}
ExecStop=/usr/sbin/cryptsetup close {{ device_name }}

[Install]
WantedBy={{ fetch_key_service_wantedby }}
