Gradle ssh プラグインで reject HostKey エラー

CentOS7 への Django アプリケーションデプロイを Gradle で半自動化 したが、別の仮想マシン接続先を変更したら、以下のエラー

* What went wrong: Execution failed for task ':deploy'. > com.jcraft.jsch.JSchException: reject HostKey: 192.168.0.35 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED

https://stackoverflow.com/questions/36374260/reject-hostkey-when-deploying-jar-with-gradle-ssh-plugin

ssh.settings {
     knownHosts = allowAnyHosts}

を追記して、成功

task deploy {
    doLast {
        ssh.settings {
            knownHosts = allowAnyHosts}
        ssh.run {
            session(remotes.web02) {
                execute "rm -R -f ${REOMOTE_PATH}/${APP_NAME}"
                execute "rm -f ${REOMOTE_PATH}/${APP_NAME}.zip"
                put from:"${projectDir}\\${BUID_DIR}\\${APP_NAME}.zip", into:"${REOMOTE_PATH}/${APP_NAME}.zip"
                execute "unzip ${REOMOTE_PATH}/${APP_NAME}.zip -d ${REOMOTE_PATH}"
            }
        }
    }
}