#!/usr/bin/expect -f

spawn cryptsetup luksChangeKey /dev/sda2 -S 0

expect "Enter passphrase to be changed: " { send -- "{{ default_luks_password }}\r" }

expect "Enter new passphrase: " { send -- "{{ luks_password }}\r" }

expect "Verify passphrase: " { send -- "{{ luks_password }}\r" }

expect eof

spawn cryptsetup luksChangeKey /dev/sda3 -S 0

expect "Enter passphrase to be changed: " { send -- "{{ default_luks_password }}\r" }

expect "Enter new passphrase: " { send -- "{{ luks_password }}\r" }

expect "Verify passphrase: " { send -- "{{ luks_password }}\r" }

expect eof

exit 0