mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-25 00:44:42 +00:00
Merge pull request #1354 from t-woerner/extended_infra_image_container_functions
infra/image/shcontainer: Volume support and new container_tee
This commit is contained in:
@@ -19,6 +19,7 @@ container_create() {
|
|||||||
cpus=*) extra_opts+=("--${opt}") ;;
|
cpus=*) extra_opts+=("--${opt}") ;;
|
||||||
memory=*) extra_opts+=("--${opt}") ;;
|
memory=*) extra_opts+=("--${opt}") ;;
|
||||||
capabilities=*) extra_opts+=("--cap-add=${opt##*=}") ;;
|
capabilities=*) extra_opts+=("--cap-add=${opt##*=}") ;;
|
||||||
|
volume=*) extra_opts+=("--volume=${opt##*=}") ;;
|
||||||
*) log error "container_create: Invalid option: ${opt}" ;;
|
*) log error "container_create: Invalid option: ${opt}" ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -197,3 +198,15 @@ container_fetch() {
|
|||||||
podman cp "${name}:${source}" "${destination}"
|
podman cp "${name}:${source}" "${destination}"
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
container_tee() {
|
||||||
|
local name=${1}
|
||||||
|
local destination=${2}
|
||||||
|
tmpfile=$(mktemp /tmp/container-temp.XXXXXX)
|
||||||
|
|
||||||
|
log info "= Creating ${name}:${filename} from stdin ="
|
||||||
|
cat - > ${tmpfile}
|
||||||
|
podman cp "${tmpfile}" "${name}:${destination}"
|
||||||
|
rm "${tmpfile}"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user