diff --git a/cdist/conf/type/__file/gencode-local b/cdist/conf/type/__file/gencode-local index ed7482cb..674650b7 100755 --- a/cdist/conf/type/__file/gencode-local +++ b/cdist/conf/type/__file/gencode-local @@ -66,8 +66,17 @@ destination_upload="\$($__remote_exec $__target_host "mktemp $tempfile_template" DONE if [ "$upload_file" ]; then echo upload >> "$__messages_out" + # IPv6 fix + case "${__target_host}" in + *:*) + my_target_host="[${__target_host}]" + ;; + *) + my_target_host="${__target_host}" + ;; + esac cat << DONE -$__remote_copy "$source" "${__target_host}:\$destination_upload" +$__remote_copy "$source" "${my_target_host}:\$destination_upload" DONE fi # move uploaded file into place diff --git a/cdist/conf/type/__jail_freebsd10/gencode-local b/cdist/conf/type/__jail_freebsd10/gencode-local index d4b89730..766692a2 100755 --- a/cdist/conf/type/__jail_freebsd10/gencode-local +++ b/cdist/conf/type/__jail_freebsd10/gencode-local @@ -43,7 +43,16 @@ basepresent="$(cat "$__object/explorer/basepresent")" if [ "$state" = "present" ]; then if [ "$basepresent" = "NONE" ]; then - echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}" + # IPv6 fix + case "${__target_host}" in + *:*) + my_target_host="[${__target_host}]" + ;; + *) + my_target_host="${__target_host}" + ;; + esac + echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}" fi # basepresent=NONE fi # state=present diff --git a/cdist/conf/type/__jail_freebsd9/gencode-local b/cdist/conf/type/__jail_freebsd9/gencode-local index 08c7b7bf..35b6f789 100755 --- a/cdist/conf/type/__jail_freebsd9/gencode-local +++ b/cdist/conf/type/__jail_freebsd9/gencode-local @@ -39,7 +39,16 @@ basepresent="$(cat "$__object/explorer/basepresent")" if [ "$state" = "present" ]; then if [ "$basepresent" = "NONE" ]; then - echo "$__remote_copy" "${jailbase}" "$__target_host:${remotebase}" + # IPv6 fix + case "${__target_host}" in + *:*) + my_target_host="[${__target_host}]" + ;; + *) + my_target_host="${__target_host}" + ;; + esac + echo "$__remote_copy" "${jailbase}" "${my_target_host}:${remotebase}" fi # basepresent=NONE fi # state=present diff --git a/cdist/conf/type/__pf_ruleset/gencode-local b/cdist/conf/type/__pf_ruleset/gencode-local index c2495509..307c89ec 100644 --- a/cdist/conf/type/__pf_ruleset/gencode-local +++ b/cdist/conf/type/__pf_ruleset/gencode-local @@ -59,12 +59,22 @@ case $uname in ;; esac +# IPv6 fix +case "${__target_host}" in + *:*) + my_target_host="[${__target_host}]" + ;; + *) + my_target_host="${__target_host}" + ;; +esac + if [ -n "${cksum}" ]; then if [ ! "\${currentSum}" = "${cksum}" ]; then - $__remote_copy "${source}" "$__target_host:${rcvar}.new" + $__remote_copy "${source}" "${my_target_host}:${rcvar}.new" fi else # File just doesn't exist yet - $__remote_copy "${source}" "$__target_host:${rcvar}.new" + $__remote_copy "${source}" "${my_target_host}:${rcvar}.new" fi EOF