Hmm - This is a little tricky but is there a reason to deploy_templates before calling init. I think doing deploy after init is safer as directories like /root/ephemeral-hdfs/conf might be missing at startup and might get created during init.